Search code examples
unity-game-engineblenderunity3d-editor

How to renderer and bake the objects in blender and export them with all the materials and textures to unity3d?


I'm using blender version 4.2.1 LTS and unity3d version 2021.3.38f1 personal

I created a ball and a checkboard objects.

then in the shading workplace i added image texture node created new image named it BakedTexture.

I didn't connect the node to any of the other nodes only selected it.

image texture selected

then i clicked on the right on the render properties tab and selected the cycles.

selected cycles

then scrolled down to the bake area and after settings i click the bake button.

bake area

when i click the bake button i see at the bottom a message: No active image found in material "Material 002" (0) for object "Plane".

but i selected the Plane the Ball objects before clicking the Bake button. so why i get this message?

No active image message

then it's continued and do the baking part and, in the end, show this message:

Baking map saved to internal image, save it externally or pack it.

what should i do now after this message and after i will fix the plane no active image message ?

the main goal is after baking to export the two objects with materials and textures to unity3d and see it as it is in blender in unity.

if i just export it like this to a fbx file and drag it to the unity editor i will see it the objects in unity3d but without the materials and textures from blender.

in unity i added to the objects my own materials. but i want to get the materials and textures i used in blender :

unity3d

i also tried in unity3d to go in the inspector to the Materials tab and clicked the extract materials the extract textures button was disabled.

but the extracted materials were not helping so i created my own materials just for testing in the unity editor.


Solution

  • When I was working on a project with similar use case as yours, I found out (on very extensive research) that the materials and textures made in blender are generally not supported in unity. Infact, my node setups as well did not work, so it is probably (most certainly) a limitation (my cut-off knowledge on this is Feb-Mar 2024)

    I also found a stackoverflow reference to this ancient limitation that hasn't still be addressed and likely will not be lol.

    Ref: Exporting blender objects with textures to unity3d

    Edit: moved this from comments to answer