• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by AnOrdinarySandwich · Apr 20, 2017 at 07:34 AM · unity 5texturematerialimportblender

Blender 2.78 Unity 5.5 the correct way to retain material/textures on import?

2017/04/20

[edit for clarification] I am not trying to import blend files into unity. As per my list of steps I'm taking, my last step was to export FBX. This is what I am using, not the blender file itself :) [/end edit]

I've done searching for this in google and here for a while now and everyone seems to say the same things, that the texture has to be saved separately in blender and placed into the material manually in unity. As well, most posts I find are for older version of unity or blender.

Now, I know I can import a model made in Blender with textures/materials intact w/o having to save a separate image. How do I know? I've done it twice, somehow. I don't know exactly what I've done that made it work. But, generally, I can't reproduce this, and it's frustrating. I'm looking for help from someone using the current version of blender (2.78) and unity (5.5 in my case), that also knows the correct steps to make this happen.

Here's what I'm doing :

  1. Make model in blender.

  2. Add new Material to the object (w/ object selected, in Properties->material - assuming one hasn't already been assigned)

  3. Add new Texture to the object (Properties->texture, click on empty slot, click new, then under image mapping->coordinates: UV)

  4. In edit mode, mark appropriate edges as seams

  5. In UV/image edit pane, make new texture

  6. Select all of model, then UVUnwrap

  7. In UV/image edit pane, go to paint mode and paint texture

  8. Under UVs, pack as PNG.

  9. Back in properties->textures, under the Image section, I click the browse image to be linked, and select my newly painted texture.

  10. Export to FBX.

After import in unity, no texture :( I really don't know what I did those two times I got it to work. I've been trying for about a month to get this to work again, where I can reproduce it, and no go.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kamil1064 · Apr 20, 2017 at 06:00 PM 0
Share

Hi @AnOrdinarySandwitch, packing textures is saving texture to blend file, not to exported file.

avatar image AnOrdinarySandwich Kamil1064 · Apr 21, 2017 at 12:46 AM 0
Share

Hi $$anonymous$$amil! Thanks for the comment :) I know that packing saves the image in the blend file, what I'm looking for is retaining it in the exported fbx.

I see lots and lots of older posts that say oh you can't there's no way but I beg to differ as I have somehow managed to do it twice! :) And if it can't be done at all as those posts suggest, then $$anonymous$$aya couldn't do it either. As well, in Unity, I can preview fbx imports that show their textures, while others don't.

avatar image AnOrdinarySandwich Kamil1064 · Apr 21, 2017 at 12:50 AM 0
Share

Oh, and there's no 't' in my name :)

avatar image Kamil1064 AnOrdinarySandwich · Apr 21, 2017 at 06:53 PM 2
Share

Sorry for T :D From my experience I can say you just saved image in your asset folder when it was working.

7 Replies

· Add your reply
  • Sort: 
avatar image
15
Best Answer

Answer by AnOrdinarySandwich · Apr 26, 2017 at 04:11 PM

Well, I guess this is the best I'll get. For everyone out there asking this question time and time again, and getting the same old tired responses, I logically thought there has to be more to it, but I guess not.

Anyway, thanks to the two who took the time to reply.

[update 2017/04/26]

I made a discovery today that answered my question and will give everyone seeking this solution a REAL answer for importing textures to Unity from FBX made in Blender. No you don't have to save out separate image files.

Here's how to do it:

After making your model and assigning materials/textures, make sure it looks good in texture mode, then:

  • Go to export -> FBX.

  • Make sure FBX 7.4 Binary is selected

  • Look towards the bottom of the "Export FBX" options, and locate "Path Mode". Set path mode to "Copy", and then click the little icon to its right, so that its background is darker (a little page icon will appear on it). This copies the texture data and embeds it into the FBX file.

  • Save the exported file.

Now, when you import this into unity, the model.fbm folder will be generated, and the textures will be intact on the model. I just tested this with a new model in a new project and it worked like a charm! No separate image files needed!

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zilppuri · Apr 26, 2017 at 06:05 PM 0
Share

And the textures get imported to Unity as well? Can you verify on an empty project?

avatar image AnOrdinarySandwich Zilppuri · Apr 26, 2017 at 06:49 PM 0
Share

I did that before I wrote the reply :) (for clarification, a new empty project is what I meant by "new project" above)

avatar image meat5000 ♦ AnOrdinarySandwich · Feb 25, 2018 at 08:15 AM 0
Share

There is an option in Blender to pack textures anyway. You find that option in UV window menus. Have you tried this? In Conjunction with selecting the correct data storage mode (object/block etc), you may not need the copy option. 'Path $$anonymous$$ode' seems to be a previous missing link in making this work. Others also mention that Baking in Cycles also works. +1'd for excellent work.

avatar image TutiBueno2 · Apr 13, 2018 at 01:00 PM 1
Share

Life saver!

avatar image Nathan1258 · Apr 13, 2018 at 03:40 PM 1
Share

Thank you so much

avatar image Extrumus · Sep 09, 2018 at 03:53 PM 2
Share

Also it should be mentioned, that this only works on Blender Render engine, not on Cycles Render as of now (2018/09/09)

avatar image arufolo · May 01, 2019 at 03:08 PM 1
Share

That's no ordinary sandwich...

Show more comments
avatar image
-1

Answer by Zilppuri · Apr 21, 2017 at 10:25 AM

You can't embed image data in .blend file and import it to Unity.

You can have a Texture/Material name in a .blend file that corresponds to a image file in a subfolder. Unity will automatically create a material with the Texture/Material name in the .blend and create .mat files to match. If a corresponding image file is found, it will also auto assign that.

So: 1. Unity searches for a .mat file with matching name as .blend files texture/material 2. If no .mat file is found, it creates one. If image matching the material/texture is found, it is used when creating this material

So if you simply match your texture/material names and have the image files in correct folders (or adjust the import settings), then the textures will be retained.

What you might have done, is exported an fbx file, where the correct images have been exported to filename.fbm folder, where Unity could have looked them up when creating the necessary material files.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AnOrdinarySandwich · Apr 22, 2017 at 02:40 PM 1
Share

@Zilppuri & @$$anonymous$$amil1064,

Through my current research, I came across a post about this topic from around 2011 (sorry, I can't find that post anymore) where someone much later casually commented (in 2014) that FBX added embedded media support into the file itself. To support this, according to this older version of blender's fbx export documentation, the fbx format does indeed store texture data in it, as well as material<->texture connection. Additionally, from the video link I posted in a comment above, $$anonymous$$aya can do this as well. And, user $$anonymous$$ in this blender stack exchange post answers a slightly different question by saying the fbx exporter packs textures used by the model, indicating that yes FBX files exported from blender can include not just materials, but textures as well. And one more bit of evidence that FBX can include textures that get imported in another program/engine, this older post from 2014 about FBX importing into Unreal Development $$anonymous$$it (Unreal 3 Engine), $$anonymous$$itchell Stokes says "Just confir$$anonymous$$g that the Embed Texture option works with packed textures []" (in regards to exported FBX from blender into UD$$anonymous$$ with textures intact).

So, where lies the issue? Has blender's modern version of export FBX broken the embed media? Does Unity just not understand the embedded media? Is it embedding the wrong format of texture? I still say it should work, based on all this!

avatar image
1

Answer by AnOrdinarySandwich · Apr 21, 2017 at 11:12 AM

I've been thinking, trying to remember everything I did and tried when I got it to work with an FBX. I don't recall saving out the image file, but I can't say definitely I didn't either.

I hate to admit defeat when I've been so sure it was possible! lol But at least not having to manually assign textures to albedo's for every model import is a step in the right direction.

Thanks, Zilppuri, I'll contemplate this and see if I can't find my old project files for comparison.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by dansopanso · Jan 03, 2019 at 04:40 PM

Is this still working in with Unity 2018? For some reason there is no materials folder generated when I import the fbx. I followed the steps accordingly to the post :/

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Extrumus · Jan 04, 2019 at 06:07 AM 0
Share

Check what Rendering engine you are using

avatar image AnOrdinarySandwich · Jan 04, 2019 at 06:24 AM 0
Share

Hi! To be honest, I don't know! :( I haven't had any time - since Unity 2018 came out - to do much work with fbx imports. I'll try to make time to see about this, but if someone active in 2018 could test it and post their results, that'd be awesome!

avatar image dansopanso · Jan 06, 2019 at 09:10 PM 0
Share

@Extrumus Does the Rendering Engine make a difference when doing the fbx export? Didn't know that... I think I'm in cycles but do you suggest to use blender render ins$$anonymous$$d?

avatar image Extrumus dansopanso · Jan 06, 2019 at 10:52 PM 0
Share

Cycles looks better and more realistic, but takes longer to export it into unity (uses image baking), blender render looks rough, but is easy to export. Pick your poison

avatar image AnOrdinarySandwich · May 02, 2019 at 05:01 PM 0
Share

I don't have any problems importing textures and materials from blender-exported fbx files in 2018. I do a lot of import/edit/export on models I purchase too. Oh and I wanted to give a little something-something here for anyone who works with importation of fbx files into blender and doesn't have a way to multi-import. I've taken a script I found online and got it to work using a set path where the fbx files are stored. The script:

 import os
     import bpy
     import sys
     import logging
     
     vImportPath='C:/Full/Path/To/Location/Of/FBX/Files'
     bIsPath=os.path.isdir(vImportPath)
     
     if not bIsPath:
         logging.warning('invalid path')
         logging.warning(vImportPath)
         exit()
     
     vFileList = sorted(os.listdir(vImportPath))
     
     for vItem in vFileList:
         if not (vItem.endswith('.FBX') or vItem.endswith('.fbx') ):
             continue
         fullFilename = os.path.join(vImportPath, vItem)
         logging.warning('importing'+vItem)
         bpy.ops.import_scene.fbx(filepath = fullFilename)

How to use it:

In blender, open a text editor area/window. Then, paste this code in. Then, set the variable 'vImportPath' to the location where your fbx files are located. Then click the 'run script' button at the bottom. It may take a while if there are a bunch!

avatar image
1

Answer by ambareeshsrja16 · Jul 17, 2019 at 05:52 PM

@dansopanso Did you figure it out with the latest Unity? I'm not able to do it either!

I am not able to read the comment replies here, is there a setting I need to activate?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

160 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Material not shown on imported FBX sphere 0 Answers

Importing Blender FBX into Unity (pictures) 1 Answer

texture not applied, despite many attempts 2 Answers

Texturing blender models in Unity 2 Answers

How to Get Procedural Materials to work on Unity Tree Creator 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges