The FBX format supports packing textures into a file. To embed textures into the .fbx file when exporting from Blender, we need to specify the value of the Path Mode parameter equal to “Copy” in the export parameters and enable the Embed Textures option.
Pay attention that the texture Image Texture node in the material must be linked to the Principled BSDF node. If another node type is used, for example. the Diffuse BSDF node, the texture will not be packed to the .fbx file.
When we export to FBX format with the Blender Python API, to pack the textures into a file, we need to set the same parameters in the code:
1 2 3 4 5 6 7 8 9 10 11 |
bpy.ops.export_scene.fbx( filepath='d:/default_cube.fbx', check_existing=False, use_selection=True, use_visible=True, axis_forward='Y', axis_up='Z', use_mesh_modifiers=False, path_mode='COPY', embed_textures=True ) |
The “path_mode” parameter must have only the “COPY” value, embedding textures doesn’t work with another variants.