Documentation: explain that Blender 2.80 Exporting a textured OBJ with any shader other than Principled BSDF will result in an MTL without map_Kd pointing to texture file #68704
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
10 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#68704
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
{F7666260}System Information
Operating system: Windows 10
Graphics card: NVIDIA GeForce GTX 950M
Blender Version
Broken: 2.80
Short description of error
When exporting an OBJ of a mesh with a material using an image texture, the MTL file only includes the necessary map_Kd line at the end when using the "Principled BSDF" shader.
If you export an OBJ using another shader, such as "Diffuse BSDF," or no special shader (connecting the "color" of the texture node directly to the "surface" of the output node, when you export an OBJ, the MTL file has no map_Kd line, and the texture is not visible in other applications. You can manually add the map_Kd line, and the model works fine, with the proper texture. But this workaround is not ideal.
Exact steps for others to reproduce the error
If you download the attached blend file, which includes a mesh with a material using an image texture, and export the OBJ, you will reproduce the error. If you go into the "shading" interface and add a "Principled BDSF" shader between the texture and output node, then when you export the OBJ, the MTL will have the map_Kd line and will work properly.
Added subscriber: @lmeeken
Added subscriber: @StephenSwaney
Don't forget to attach the attached .blend!
Weird, I uploaded it, but it wasn't in the post. It should be there now, though.
Added subscriber: @rjg
This report is accurate. For the .mtl creation the exporter use
mat_wrap = node_shader_utils.PrincipledBSDFWrapper(mat) if mat else None
and maps the socket inputs to the map types. Could be a design choice (?), but it's not documented in the manual.Added subscribers: @Blendify, @mont29, @lichtwerk
This is a design choice, yes.
It is documented in code
So this is not a bug from a code-point-of-view, but I will confirm this as being an issue with the documentation, it should be documented in the manual as well (as there are other limitations also, see #68399)
@mont29: do you want to do that (change the manual)?
@Blendify: I think it makes sense if I could get a member of the documentation team as well (and get commit rights), I could do this then, too...?
Blender 2.80 Exporting a textured OBJ with any shader other than Principled BSDF results in an MTL without map_Kd pointing to texture fileto Documentation: explain that Blender 2.80 Exporting a textured OBJ with any shader other than Principled BSDF will result in an MTL without map_Kd pointing to texture fileThis issue was referenced by blender/documentation@5715
Changed status from 'Open' to: 'Resolved'
If it is a(n undocumented) design choice, it is different from the design choice in 2.7 versions of Blender, which exported a usable .mtl . It also feels like an ill-advised design choice as it depends on a workaround outside of the program itself (manually adding the map_Kt line to the mtl in a text editor) to "remedy."
If the issue is just going to be band-aided by updating the documentation/manual, it would be helpful for users, especially the new users attracted by 2.8's more student/amateur-friendly interface, if that documentation includes information on how to export a proper MTL (or, if that's not possible in any way through Blender now, how to jerry-rig their MTL in a text editor to work properly).
It is plainly impossible to export any kind of node-based shading system into a fixed-pipeline thing like MTL or FBX formats suport. That’s just basic common sense. We can only offer some very limited approximation in some well-defined cases. Note that 2.7x did not export node-based materials at all.
@lichtwerk you now have commit rights.
Added subscriber: @Spartacus1
It's strange that Blender 2.8 solved most interface annoyances when compared with other 3D packages but keep some that are still unique. I've tested most 3D packages and Blender is the only one that is unable to save a .obj file with image textures (even if this option is available in the export as "Export Materials". If we are using an image file we must add manually a mat_kd line with the proper image name after. Come on guys, this is not, by any means. a design choice, it's just clumsy and unique to blender. If I choose in the options to export materials and "copy" option available, the used textures should be copied and the respective mat_kd line added.
Added subscriber: @ryanackley
Took me days of pulling hair and googling to find that textures not exporting is by design. I don't think it's an unreasonable user expectation for simple shaders like Diffuse BDSF to export texture images. I can live with the workaround however. It's just extremely obscure and unintuitive.
Instead of burying it in the manual somewhere, why not indicate the limitation in the application UI. For example, "some materials in your export don't support the export of textures". Just a suggestion to help the next poor slob who has the same problem. I'm happy I have a solution finally.
As Ryan said, it's tolerable that complex textures with layers are not exported. However, image textures should be exported correctly, as in any other 3D package.
Added subscriber: @CameronA
I wanted to offer a different perspective into why this should be addressed and usable .mtl files should be exported.
I'm using blender in my full colour 3D printing workflow. Because there's no repository of printable colour models, i'm having to transform animation assets into printable files.
In this context i want to have a baked on version of the texture/material and having to manually edit the .mtl seems silly given the power and versatility of blender.
Can we change this from resolved and just add the export of map_Kd "file name" to the .mtl please?