OBJ files exported from Blender don't show textured in macOS's file browser #78126
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#78126
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 575 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.8
Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-21 14:55, hash:
blender/blender@f2b5f731d5
Worked: (newest version of Blender that worked as expected)
Short description of error
object .obj doesn't appear texture
Exact steps for others to reproduce the error
June 22, 2020
Blender 2.90 Alpha
Macintosh MacOS 10.15.5 Catalina
object .obj doesn't appear texture.
They made one Lola Bunny, but I am create 1 cube box and put texture I have fail to see all gray few times.
Apply textures to the model .obj yes
Lola Bunny model is not my create. I just download.
Blender by Kent Davis.zip
Added subscriber: @Kent-Davis
I forget to put my. .blend document and other they document link. https://www.dropbox.com/s/x3nz2kk8tna56s2/Blender%20by%20Kent%20Davis.zip?dl=0
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs User Info'
Hm, seems to be fine here, exporting LolaBunny.blend to OBJ gives me
LolaBunny__.mtl
LolaBunny__.obj
Since the Textures paths are relative the Textures folder needs to sit next to those files.
If that is the case, this imports just fine back into Blender, can you confirm?
(so this might turn out to be a problem of the preview in Finder -- or whatever this is previewed with?)
Regarding the Cube, this seems to be a packed texture [which dont get exported afaict], if I save that manually, then export, the texture shows up everywhere, can you confirm?
How can I do export .obj? I am tried many times years and years I don't understand.
(Cube box) I create myself with create color grid texture on Materials. Within EEVEE
Please @Kent-Davis:
I am not good english to explain text. I am deaf and do sign language.
Confirm how?
blender.org/community
is they banned me out
Added subscriber: @rjg
@Kent-Davis you need to save the texture in Blender separately from the model export and place it in the same directory as the exported model. The obj/mtl file format can only reference the texture file by name.
Sorry you are wrong answer.
Export Collada .dae it work auto appear texture and .dae itself very well.
Export .obj not work. I show you picture proof.
@Kent-Davis If the texture file is already saved somewhere else on disk you can set the Path Mode to Copy in the exporter settings.
show me your screenshot?
@Kent-Davis
The next time you have a user support question, please post it either on [Blender's StackExchange ]] or [ https:*blenderartists.org/c/support/9 | blenderartists.org .
Export > .obj then " Path Mode to Copy " I did follow your screenshot.
Are you use your own Macintosh ?
Still not work did not appear texture
@Kent-Davis Have you previously saved your texture to your hard drive or are you just using a procedurally generated / baked / painted texture within Blender? If you haven't previously saved the image to your hard drive, it won't copy it to the output directory. That is a limitation of the current obj exporter.
Collada .dae it work auto copy texture itself.
.obj doesn't auto copy texture itself.
I ask you again. Are you use your own Macintosh yourself?
Miss picture screenshot.
@Kent-Davis Like I said before the .obj exporter doesn't automatically save the texture file for you. It can only copy a texture file that is already saved to your hard drive to the destination directory. This is a known limitation. You may consider this a bug, but it's more of a missing feature.
This is irrelevant for this particular issue since the way the obj exporter works is platform independent.
Allright
What is consider, irrelevant, particular, platform, independent
I knowledge limit word. I do know sign language as well, I am full deaf.
@Kent-Davis I will try to simplify what I wrote:
The obj exporter does not save the texture. It can only copy a texture that is already saved. Other exporters can save the texture. That is not a bug, some exporters can do more than others. The situation is the same on all operating systems (Mac, Windows, Linux).
Allright. Are they plan to add feature will automatic itself same as Collada .dae ?
Texture Paint and (UV map save texture) into Finder Textures folder and export .obj and copy doesn't work you can see below texture
@Kent-Davis I'm not sure. There is currently a project for faster importer/exporter. Maybe this can be added when the project is done or when a developer has time to work on it.
@rjg Yes I agree with you. Take Developers time to processing there thousand bug to fix.
I figure very hard thinking for long time many years (from 2.5x until now 2.90) until I decide to send here and now we get know each other.
Still fail doesn't appear texture in .obj there file zip I know there bug.
Fail object doesn't appear texture.zip
Sorry first .zip wrong one I just save .blend now add Fail object doesn't appear texture v.1.0.0
Fail object doesn't appear texture v.1.0.0.zip
Added subscriber: @ideasman42
This is working for me:
Fail object doesn't appear texture v.1.0.0.zip.
Import the file, Press Z, Select render, the texture is shown.
@ideasman42
You are wrong answer.
I know already about push the "z" key and rendering.
Focus on .obj
Are you use your own Macintosh?
if you see Finder focus on .obj make sure appear texture without too white object.
@Kent-Davis no, I'm not on macOS, are you saying the issue is that the texture from an exported .OBJ file doesn't show in the macOS finder?
Yes correct answer " the issue is that the texture from an exported .OBJ file doesn't show in the macOS finder "
Did you try setting "Absolute" path mode when exporting?
I already show you on many pictures above
@lichtwerk you may know about .obj should appear texture itself on Mac Finder. Look above few pictures.
Added subscriber: @jenkm
Not sure how it should work, but I just downloaded a random file, and re-export in Blender.
Here are both, the original and from the Blender:
cat_test.zip
And this is not only textures but also colors are not displayed in the Finder.
@jenkm
Now MacOS 11 Finder preview you can see too white did not appear texture itself of .obj.
@jenkm
Now other .obj I can see texture appear this one.
@rjg @ideasman42
I found the problem. There should also be
map_Ka
.Adding the next line fixes the bug:
Also,
map_Bump
doesn't seem to work, it should bemap_bump
.Or it is different things, but it give a different visual result in the preview in Finder.
Compare
mtl
files, the original and the one from the Blender:cat_test.zip
map_Ka
is for ambient reflectivity and not a required parameter that must be written in the .mtl. As long as themap_Kd
parameter is written to the file, it is a valid .mtl file that references the diffuse texture. Perhaps Apple's viewer requires themap_Ka
parameter for displaying the preview, but that is an assumption that isn't supported by the specification.@jenkm Thanks for investigating this and identifying the issue. That is rather strange handling of the file format by the previewer. I don't think it would be correct for the exporter to just add the diffuse texture as ambient reflectivity.
@jenkm that again still not work ReSave on .obj for Mac Finder Preview.
Kent check copy from 3D max text then paste into Blender of .obj
This file ReSave on blender-resaved.mtl. I just let you know need to fix on Blender 2.91 Alpha
August 24, 2020
newmtl Cat
Ns 10.000002
Ka 1.000000 1.000000 1.000000
Kd 1.000000 1.000000 1.000000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.500000
d 1.000000
illum 1
map_Bump Cat_bump.jpg <== remove
map_Kd Cat_diffuse.jpg <== remove
See on iMac Preview on Finder.
@rjg @ideasman42 and @jenkm
@rjg
I have file that contain both parameters
map_Ka
andmap_Kd
.I open this file in Blender. What happens to the
map_Ka
data?Then I export back to obj. Should the
map_Ka
data be written back?Oh, the
Ka 1.000000 1.000000 1.000000
is also set here, which results in a white color.Removing this returns the texture but it is look darker than the original .obj.
And
map_Bump
doesn't work, it must bemap_bump
.It seems to me that the import process is also incorrect.
Exporting a cube with a red Base Color gives:
@jenkm Good question, I'll have to look at the code. I expect that
map_Ka
is currently ignored during import and thus can't be exported properly.Maximum ambient reflectivity does seems like it might be a wrong default.
Yes, that appears to be incorrect.
That doesn't seem right either.
I haven't had time to test any of these myself, but there seem to be issues with the
Ka
related processing in import and export.Added subscriber: @ankitm
Changed status from 'Needs User Info' to: 'Needs Triage'
Changed status from 'Needs Triage' to: 'Confirmed'
Setting this as a paper-cut, since it's not a bug, it's an interaction issue with an external OBJ loader.
object .obj doesn't appear textureto OBJ files exported from Blender don't show textured in macOS's file browser@ideasman42 The problem here is not how it is displayed in the Finder.
It set
Ka
to1.000000 1.000000 1.000000
which gives the all-white material.Which is definitely wrong. See a couple of comments above.
@jenkm Good job answer.
Are you still work processing about .mit match between texture and .obj preview?
According to astrand135 on Twitter they are working on an updated mtl exporter. The patch hasn't been submitted yet though.
Thank you for let me know no problem. I know Twitter and I never like Twitter. I had use many times they never support for deaf people. I reject Twitter.
Added subscriber: @KenzieMac130
I did on the 11th, it is here: https://developer.blender.org/D8868#220138
Correct for import but for export its actually worse... The current version of Blender's Obj exporter actually writes a mangled metalness value... I have no idea why so I didn't touch it but now it seems that has to go as well.
I've investigated this issue, it stems from Autodesk messing up their loading of diffuse from MTL files in Max and Maya... As a result countless packages intentionally incorrectly swap ambient and diffuse. (I wish I was joking) I am looking for a compromise to this problem.
That explains the issue. Perhaps it would be a good idea to include a property in the add-on settings that allows to switch between the specified and Autodesk's interpretation of MTL files, if that is within scope of your update.
Current plan is to add an option to write diffuse to ambient. Walking into this task I had no idea the ecosystem was this broken... I will probably have to write up a blog about this.
Added subscriber: @Raimund58
I am still wait for you too long about MTL and OBJ
Sorry, I got sidetracked. The obj exporter is currently being moved to C based on my knowledge for better performance. blender/blender#68936 Thus I am in a bit of gridlock as my patch is a modified python script. I will try to finish up my exporter patch tomorrow but I doubt it twill be merged.
As for the current problem you are having with viewing diffuse in the mac file viewer this is a legacy compatibility issue that should be handled by Apple. I will provide a compatibility option for this kind of edge case but this goes to a bigger obj infrastructure issue and would likely cause many other applications to interpret broken materials if enabled.
Allright thank you for explain me.
About you will work on it tomorrow. Take your time.
only on MTL and obj script
Our Mac problem NO.
Blender problem yes.
Export itself on MTL
map_Kd /Users/kentdavis/Downloads/One.png
Did not make texture (One.png) into folder.
Blender 2.92 Alpha of November 12, 2020
MTL file
.# Blender MTL File: 'Test Cube November 13 2020.blend'
.# Material Count: 1
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd /Users/kentdavis/Downloads/One.png <=== see.
For example some one put texture on MTL and OBJ with Lola Bunny it work.
that come from Maya (.ma)
It will be easier for me to change the C++ code if your patch lands in the addon.
That is great.
Good to know, I will continue work on it then.
It might not make it in soon enough, there are other patches it depends on and I will have to dust it off and fix any problems. Worse comes to worse and it doesn't make it in: I can send you just a patched version of the addon to alleviate your problem.
Okay, my most recent diff should have fixed your issue... The exporter is still not finished as of now but I figured it would be unfair to make you wait any longer seeing as though this appears to be more than a minor inconvenience to you. You can either apply this patch or use this link and replace the contents of "io_scene_obj" in your blender installation's addon folder. https://drive.google.com/drive/folders/1Var0hEkzr2l2LIZ7x57ZQKQDEgBVftc8?usp=sharing Hopefully this will smooth things over but tell me if you run into any issues (keep this issue open though, the change is not merged). Again... Sorry for the wait.
(Edit: This won't work without changes to "node_shade_utils.py" in "scripts/modules/bpy_extras". Something got broken in the most recent versions of that file and I need to fix it and re-implement the extra stuff. Here is the modified older version I am using https://drive.google.com/file/d/1zY0K1BdkMDn3lGZ_dMXHbSiO1PLYu3QW/view?usp=sharing)
@astrand130 did you mean your suggest on .obj your own script able to preview on your own Mac Finder?
Haven't tested it on the mac since I do not use mac. but I am mostly sure that is what your problem is and this fixed it. The problem is likely a well over 20 year old incompatibility issue in the format's definition of diffuse and ambient term tinting between the Alias/Wavefront Specification and Autodesk's implementation in 3D Studio Max that Apple seems to have sided with the incorrect implementation in Max.
This normally isn't an issue as most exporters write a duplicate of diffuse to ambient tinting anyways... However... Blender's MTL exporter erroneously writes garbled metallic information to the ambient tint (which the mac viewer reads because of the legacy issue previously described). At a metalness of 0 it writes white to ambient otherwise a scalar gradient of the metalness value and shoves the metallic map into the cubemap texture specifer... This is utter nonsense that should not happen. It was an incorrect rushed implementation to accommodate the constraints on non-extended MTL when when moving blender to PBR. My patch fixes this issue by removing this code and duplicating diffuse to ambient while ambient is ignored on import because it is obsolete.
Please tell me if this fixes your issue.
@astrand130
Blender of object..zip
https://youtu.be/I47pt8HKHM0
@Kent-Davis I hope that it is Youtubes fault that it is only 360p... I would recommend that you set your screen resolution to 1080p and not to 5K. Otherwise I need a magnifying glass to see what you are doing on your screen.
Hi @Raimund58
Yes wait until youtube processing to be 4K come soon because of youtube still processing. I do use 5K retina Display on my iMac. wait for 1 hour then try again.
I do use Command + Shift + 5 and record screen.
I don't really need the entire process. But judging from the last bit of the video where you show the MTL file you aren't using the updated script or following the workaround people on this thread are asking by copying the line with "map_Kd" and replacing that lines definition with "map_Ka". This should fix your problem entirely. I need to know if this works for you, it should verify my theory.
@astrand130
Look at youtube I show you. https://youtu.be/h_31158dO0Q
It is making a difference when when switching between diffuse and ambient. There are spaces in the file path. Try removing that from the texture name. That often breaks the tokenizer and file paths with spaces is technically unsupported by MTL.
There already support space because Maya on .obj "Lola Bunny.png" that space it work.
Weird... I guess this makes it a little more complicated than my initial assumption... Can you paste the Mtl of the Maya version and Blender version in a code comment (this button </>)? It seems there might be a formatting difference with the file path that the Apple viewer doesn't like.
@astrand130 the main problem here is that
Ka
set to1.000000 1.000000 1.000000
- which is all-white material, and Finder shows it as white. ChangingKa
tozeros
fixes the problem in Finder. I'll assume that you only needmap_Ka
because of the wrongKa
.Ok I double check and take test about space on Maya of Lola Bunny .MTL and .OBJ and drag into Texture folder and rename .png within space and without space and add " _ " change more test..
Now I see body.png rename to b ody.png (doesn't appear texture.)
Now I see body.png rename to b_body.png (I can see texture there.)
Blender.app on 2.92 Alpha
Need to fix feature see step by step on collada -VS- .obj
I just find out right now.
File > External Data Pack All Into .Blend (Already have inside .blend file before)
Should be appear texture plus rename from (SPACE) to + _ + but doesn't work
Example: Export > Collada (.dae) automatic appear texture copy from file to other folder into export file texture itself.
.obj doesn't.
This export collada .dae
I have to drag make a copy texture from collada to object folder and rename.
from Kd to Ka
FINAL and there look too bright not normal.
Download file .zip
Blender by Kent Davis Update 1.0.0.zip
This Lola Bunny still Kd not Ka.
from
to
now you see
@jenkm was right.
Now you know @astrand130
If the apple viewer is treating a Ka of white as a fullbright material then that would be out of spec on their part. The example formula from the spec states that Ka is a multiplier for the ambient light which is added to the diffuse term. A Ka of white should only appear to wash out the ambient term while zeroing out Ka should kill the ambient term. It should not be added on top in the style of emission and turn the material white. Defining the "map_Ka" here is quite possibly causing the previewer to attempt to load a texture (fail for some reason I am still trying to determine) and return a black texture and having the same effect as zeroing out Ka.
Obviously this exact formula isn't set in stone but the overall intent should be preserved. But it seems that is not the issue that is happening here as demonstrated by when the OP is able to properly load a texture.
First example Ka is white and map_Ka is defined, it is tinting the ambient term but the diffuse term is white... This image is the correct result of that formula.
Second example Ka is black and map_Kd is defined, the ambient term isn't present (I assume the light is at an angle in the screenshot) and the diffuse term gets tinted by the texture... This again is the correct result of that formula.
Previous examples where the texture is not being loaded it appears white because Ka is white and (I assume) the map_Kd is failing to load and returning a black texture... All that is left visible is the white ambient term, failed to load texture but still correct.
The ideal result happens when both the ambient and diffuse term gets tinted by the texture (and the texture is successfully loaded), for this to happen Ka and Kd should be white, and map_Ka and map_Kd should be the base color texture.
Okay, I see where I was going wrong here. I missed the part where the texture file the MTL is pointing to is literally unable to be loaded, not just invisible on the surface but in memory. Since the other developers where talking about the ambient term being incorrect and since I was aware of an common issue surrounding ambient, I incorrectly assumed that was the issue that was occurring here. map_Ka and map_Kd seem like they are not being swapped here after all.
As it seems you were able to see your texture when removing the spaces entirely from the file path, this is the expected behavior as spaces should not be supported because of the way the string is parsed... Actually there is an exact comment in the importer code that mentions this.
Based on your screenshot it seems like Maya is writing a copy of the image file to the directory with spaces stripped from the name. This explains why it is able to get around the issue with spaces. Blender doesn't make a copy of the file and just writes the relative path to this file (or absolute if specified, please don't use this though). If there are spaces in the resulting "map_XXX" line where the file path is you will encounter this issue in lots of software, as spaces are used by MTL to separate optional parameters for the texture.
To get around this limitation with the format try structuring your project folder structure something like this:
Notice how the relative path from the blend file's folder to the texture contains no spaces or other special characters: ("textures/base_texture.png" or "textures/bump_texture.png") After exporting you can move the obj/mtl/texture directory structure wherever you want and the file should still be loadable, if not then make sure absolute path is unchecked.
The format is very old and perhaps this limitation isn't being made clear to the user (maybe there could be a warning).
So yes this is technically user error but given it's obscurity I don't blame you.
Gooooooooood and I am wait for Blender.app update when they fix code.
Export > Collada there have texture make a copy check box turn on.
Export > .obj doesn't have texture make a copy and rename from " " to "_" automatic.
Collada -VS- .obj
Changed status from 'Confirmed' to: 'Archived'
Believe me I have noticed this when working on the exporter. To my knowledge the GLTF and DAE exporters are the only ones that write texture files... And only GLTF has a valid reason as it supports channel packing. This difference is definitely a bit of an inconsistency but there are many others as well. Exporting from blender in general could be made a bit more unified.
It seems like we figured out your issue so in the future just make sure to avoid white spaces in file paths with MTL, especially if your target application can't read them.
Allright
Why you put invalid. They must work on .obj code.
I can get mad at you. You hate me as well.
You are use Windows only and you reject me about Macintosh.
We found your problem. I don't hate you, I spent quite some time trying to figure out your issue and it appears to be an issue with your setup, marking as invalid is just means it is not a bug. I didn't reject this potential problem altogether, assigned myself a task to give a warning on white spaces about potential incompatibility but otherwise there was nothing really to fix about this. Please don't open duplicate tasks or get angry with me over this. I tried to help, and found your answer.
I don't want this thread to go on any longer. Too many people have tried to help you just for you to feel unsatisfied with the answer and throw a tantrum. Please just walk away and cool down.
@astrand130 - I still don't understand how this is supposed to work.
Let's take the simplest example, without any textures. I just set the color to red, and exported.
The
Ka
set to1.0 1.0 1.0
- is this correct? And it's wrong that the Mac viewer shows this in white?I also noticed that the "Metallic" value is copied to
Ka
,but if Metallic = 0, it set Ka = 1.0, why?
If I set some Metallic (0.001) and Ka becomes not zero, Mac viewer shows red, as I expected.
It looks quite reasonable, a value of 1.0 gives a fully specular reflection, which simply reflects an all-white environment.
If your model isn't being lit by diffuse then it should appear white or depending on the ambient light strength it might be added together to be out of the visible range. That might be the issue.
Ka of white for a red material is not correct.
I think this was an off spec hack to swizzle the metallic into the ambient while using "illum" as a flag to swap out for dialectics. This is an incorrect approach as extensions for metal/rough have been proposed, this just mangles the file for existing software.
Ka is basically the diffuse tint but only applied to the ambient light, ambient does not get affected by Kd.
So Ka should in pretty much every case be the same as Kd.
Ka is not specular and should not be tied to metallic at all. I've already being solving the issue with incorrect ambient tied to metallic in my patch.
Hopefully this clears up any confusion but since things appear to be getting heated I honestly I feel like this thread is not worth continuing.
Check youtube to explain to you. Please do it fix code on Blen der. Our Mac have no issue. Blender does issue. See youtube
https://youtu.be/VZ_-Je6OUY0
FINAL I show you youtube
https://youtu.be/VZ_-Je6OUY0
@lichtwerk
@rjg
@ideasman42
@jenkm
@ankitm
This is spam. We told you what the issue is and how to fix it but you aren't listening. Please stop.
Removed subscriber: @KenzieMac130