Search Unity

Do I have to retexture everything?

Discussion in 'General Discussion' started by Cosmology27, Jan 20, 2020.

  1. Cosmology27

    Cosmology27

    Joined:
    Jul 11, 2019
    Posts:
    61
    I'm using Blender, which I thought was supposed to work really well with Unity. So far, things are going kind of meh. I create objects and import the fbx into Unity, and a lot of the texture work (which is where things start actually looking good) gets completely omitted. If I have a texture image, it's gone. I do work with emitters, they're gone. The animations for things like textures seem non-existent in Unity. I made a glass ball and brought it in, and it didn't retain any of those properties. Bumps and basically everything that can be done is not brought into Unity.
    I just tried to bring in a simple fence, nothing too complicated, where I had unwrapped it, and put different wood textures on it. When I brought it into Unity, it's literally just all white. It seems the only thing Unity actually remembers is just plain colors, and that's it. You made the thing green? It'll stay green. Other than that, Unity doesn't retain anything at all.

    I'm REALLY hoping there's something I'm missing, and it's some little setting that I was too stupid to enable, haha.
    Is there any way to make your Blender work come into Unity and looks half ways decent? Or do I have to retexture everything in Unity?
     
    reedgrenager likes this.
  2. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Only a limited number of things are going to transfer across from Blender to Unity. Such things include:

    * The mesh
    * The uv maps (up to 5 IIRC)
    * Keyframe animations
    * Armatures
    * The materials to a limited extent

    You will have to save the images as separate files out of Blender and import them in Unity. You may have to make new materials for the models too. As the models have their UV maps, textures should just need to be assigned to the materials to work. Bump maps are more complicated, depending on how you did them.

    Emitters, animated textures etc will not export out of blender (or any other modelling software, I believe).
     
    Kiwasi, aer0ace and Ryiah like this.
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    The texture coordinates are there. But if you have complex materials, you'll have to re-configure them in unity. You do not need to "retexture" because that implies redoing UV and repainting textures. Just use textures you already have.

    And yes, that's not really convenient, but given that blender has shader graph editor, it is not surprising.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    For effects like glass and other fancy textures, you will need play with shades, within Unity. Also there is FX tool as well. Importing from blender, or other 3D software as mentioned above, usually don't work that way.
     
  5. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    It's a real shame it doesn't, would think by now Maya/Blender and Unity would have a similar shader graph setup that doing material shaders in any would transfer across the same to other... a universal shader library that looks and works the same.
     
    reedgrenager likes this.
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    It doesn't work this way, unfortunately. Graph setups are unique along with the shader configurations.

    Initiatives like blender's "principled bsdf" help, but the rest of tech stack isn't here.

    It is also definitely possible to invest into a better blender exporter, but I'm unsure if people would pay for it.
     
    reedgrenager likes this.
  7. Cosmology27

    Cosmology27

    Joined:
    Jul 11, 2019
    Posts:
    61
    Thanks for the responses!
    Wow this is a massive pain. I'm trying to drag the FBX in with the textures, and it doesn't automatically assign them. So I'm trying to manually assign them, doing everything single texture over again, and even then, it's not recognizing a bunch of them.

    When I drag it in, it brings all the stuff in (uv, materials, cubes), but the materials are blank, like it's just a regular grey. So I have to manually drag in every texture image, and then manually assign each image to the albedo for each of their respective materials.

    The whole process is absolutely painful though. I can't imagine having to do this a dozen times for a single object like a building, nonetheless everything in the game. I'm really hoping there's a simpler way to go about this, but all the videos on YouTube about it are quite outdated sadly.

    I see people doing this, and it seems to just "work" for them, and I have no idea why. Any ideas? Or is it just this painful?
     
    Last edited: Jan 21, 2020
  8. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    You can import standard materials with textures assigned, just set Path Mode to Copy and click the little icon to the right of it which is 'Embed Textures' (it should show a paper in the box).



    In Unity, when you click on the fbx file, click the Materials tab and then you have the option to extract both materials and textures.

    I doubt you can import your customized materials from blender because shaders are highly customized to whatever application you're using.

    source: https://docs.highfidelity.com/en/rc82/create/avatars/blender-tutorial.html
     
  9. Cosmology27

    Cosmology27

    Joined:
    Jul 11, 2019
    Posts:
    61
    It looks like you have a different version of Blender than me (I'm using the most up to date version on Steam), but the idea is still the same (but version might be affecting it). I choose copy, and click the button next to it, and the little paper pops up. I then get the FBX file in that folder I saved it to (nothing else saves into that folder except the FBX). I then drag the FBX into Unity, and I still don't get the option to "extract textures". I tried dragging the FBX with the texture images, and while they come in fine and show up, I still don't get the option to "extract textures", and the images still aren't attached to the materials, so I have to do it manually still.
     
  10. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    If I follow the above steps and export directly into Unity's Assets folder, the model already has the texture showing in the preview window, is it the same for you?
     
  11. Cosmology27

    Cosmology27

    Joined:
    Jul 11, 2019
    Posts:
    61
    I hadn't tried exporting directly to the assets folder, but I just did that to try it, still didn't work.

    I even created a whole new project, and exported from Blender directly into the assets folder. The object shows up in my assets folder, but the preview doesn't show any textures on it, and when dragging it into the scene, it has no textures. The object in the assets folder also still doesn't allow me to extract textures. Also, the process did not bring in the texture images into Unity (even though I believe it should have, and which is probably the thing causing the problem, because I have to manually bring them in, which makes sense why I would manually have to connect them). So I end up with blank materials, and no texture images. Extracting the materials seems to just bop the materials back one folder from being in the object, to just being in the assets folder. As I said, I cannot extract the textures (because they just aren't there). I have to do the same process of putting the textures back into the assets, and relinking them to the object's materials by albedo.

    I've attached an image of my export settings from Blender, just in case I'm doing something stupid.
     

    Attached Files:

  12. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    Not sure what's happening there, but when I am using Blender 2.79 and Unity 2018, with just a default Blender material with one texture, it exports with the textures applied to Unity.
     
  13. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    Blender 2.8x uses eevee by default. Eevee materials are similar to cycles materials, and cycles materials, as far as I remember, were exported as white. Due to them using a shadergraph.
     
    Billy4184 likes this.
  14. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    make your model in blender
    export FBX to Unity
    bake textures out
    copy paste via Windows to unity
    create new material in Unity
    assign textures.

    I never considered it much of a hassle, to be honest. I had no idea in earlier versions of Blender it could auto-read and assign materials. I still kind of doubt it did.
     
    Teila likes this.
  15. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    I'm just going to drop this here, since it's extremely relevant to the topic:

    http://undertheweathersoftware.com/blender-to-unity-asset-builder/

    It's a writeup I did about how I export from Blender to Unity with a custom build pipeline. I would understand if you think it's a bit heavy-handed to implement such a thing, but this was back in 2015, and I've probably used this export pipeline thousands of times since then, saving me hours, if not days, of dev time. Just imagine, if you make just one change to your model or texture, you have to re-export, and spend that extra time figuring out what needs to be updated to Unity. This adds up quickly. What a pain.
     
    Billy4184 likes this.
  16. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    Yes, custom pipeline is the way to go if you want less hassle while working with materials. The issue is initial development cost.

    Default way of transferring things to unity does have some quirks anyway. I never figured out how to completely get rid of "90 degree rotation" and "90 degree rotation and scale by 1000" bones that tend to appear in animations produced in blender.
     
  17. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    Definitely. I've tried numerous times in the past 5 years, all with varying degrees of success. I finally decided on a solution though, but it's a destructive process. Meaning, I have a Blender script that transforms the model prior to export, and I DO NOT save that version of the Blender file, as it completely modifies the axes. I just close and reopen Blender if I need to continue editing. It's a minor inconvenience, but I got to a point in my game that I absolutely needed the rotation to be removed in Unity (For vehicle physics, the wheel collider expects a specific orientation of your objects).

    I wish there was one point of discussion about the 90 degree rotation issue, that covers all the attempts, but usually there's just several smatterings of threads that only give shallow solutions. There's Blender FBX export options which people claim work, but seems to give me mixed results. Sometimes it works, sometimes it doesn't. And there's the Unity post process method (similar to Edy's solution), where after importing from Blender/FBX, modify the points and write the asset back out. I've never been a fan of this option, and wanted to stick with trying to get Blender to behave.

    I'm happy for now, but boy was there a lot of trial and error to get to that point.
     
    angrypenguin likes this.
  18. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    @zombiegorilla occasionaly showed up to tell about blender export settings, the thing is I never managed to get rid of the root rotation completley. That bone causes trouble with animated models, because it scales skin, which means if you wanted to use part of skin, for example, for cloth, this is going to be interesting.

    There's probably a need for completely custom exporter.
     
    zombiegorilla likes this.
  19. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,051
    You can fix the rotation by changing the axes in the fbx export and applying transform.
    upload_2020-1-23_17-31-12.png
    I forget which settings are for normal, it may be forward: Y Forward / Up: -Z Up . (though that may a setting I use for UI meshes) . But if you bake them it will work. I doesn't really work if you use the .blend file (unless you animate it complete in the wrong (right for Unity) direction.
     
  20. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    I recall that, the thing is, I was unable to exterminate temporary rotational bone when exporting characters. Maybe I need to check this again.
     
  21. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    The problem, IIRC, is that this doesn't work for child objects. Edy of Edy's Vehicle Physics goes into more detail about this, regarding inverse transforms stored in Blender. I haven't investigated that too far, but if removing that inverse transform from each parent/child is the answer to getting the Apply Transforms to work in the FBX exporter, it may be worth it.

    There are other complications that get thrown into the mix too, like Mirror modifiers, mirrored objects, and instantiated objects that need to be converted to single user, which require pre-processing before exporting from Blender anyway, which can all be automated by scripts, so adding the last transform isn't too much of a problem anyway.
     
  22. reedgrenager

    reedgrenager

    Joined:
    Feb 6, 2019
    Posts:
    1
    I've had the same issue so many times. The most I've ever successfully exported into Unity with the model was the color map. Besides that you have to completely recreate each material from scratch basically. It sucks. I also kinda makes me wonder, how do big game developer companies do it? Do they have teams to create materials inside of Unity? If someone could make an add-on or something for Unity or Blender to translate the materials across platforms, that would be amazing and could speed-up a lot of people's workflows by a lot. Or if Unity could do something about it, it would make a lot of people happy. Unity, we need a way to, with one click, export an entire scene from Blender into Unity with each material looking exactly like it did in Blender.
     
  23. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,140
    You really had to resurrect a 2 year old thread for this?

    Second, there is literally already features in Unity to help with this sort of thing and they've been there for ages.

    https://docs.unity3d.com/2017.4/Documentation/Manual/FBXImporter-Materials.html
     
  24. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    It doesn't really help with fbx materials exported from blender. You're still going to assign textures by hand for every single material, unless you write an asset postprocessor.
     
    aer0ace likes this.
  25. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,140
    This is a valid point. I forgot my custom postprocessor was part of my project start import package.
     
    neoshaman, aer0ace and neginfinity like this.