Obj Material transparencies not automatically connected correctly when using jpeg #83749
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#83749
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: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.09
Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-12 18:07, hash:
blender/blender@4797c13e8f
Worked: 2.90.1 Stable 23-Sep-20-06:43 3e85bb34d0d7
Short description of error
I noticed that the latest blender versions automatically connect alpha node of an image texture to the alpha node of the principled shader when importing obj. This would be fine if the image texture were a png that has transparencies. But with Jpegs this won't work as intended. It used to connect it correctly in this build: Ybrpk66MT_!YksF . Now I have to go in and manually correct every shader of all my imported shaders that came from an obj to the correct node. Which can take a long time, and stops me from using the "newer" Blender builds
Exact steps for others to reproduce the error
Just import an Obj mesh that uses transparency using jpeg image texture
[Based on the default startup or an attached .blend file (as simple as possible)]
Added subscriber: @vaik.nay
Added subscriber: @rjg
Changed status from 'Needs Triage' to: 'Needs User Info'
I've just tested this with
blender/blender@c6075118d5
andblender/blender@4797c13e8f
and it doesn't seem to connect the alpha output with the models I had around. Also when connecting the alpha channel on purpose the result still looks correct, since the .jpg doesn't have an alpha channel and this returns a value of 1.0 across the image for me.Could you provide a minimal example .obj, .mtl and texture that shows this problem? For instance a cube with the texture applied.
Sure, here a plane with eyelashes
File here
@vaik.nay Please upload the file here and make sure it's a minimal example.
test_eyelashes.obj
test_eyelashes.mtl
Changed status from 'Needs User Info' to: 'Archived'
Thank you for the files. The problem is that the *.mtl contains a
map_d
instead of amap_Kd
. The former is used for "dissolve", as the mtl specification calls it. This is essentially an alpha texture and how Blender interprets it. The latter is what you want for a diffuse texture. If you simply renamemap_d
tomap_Kd
it will import as expected.This is not a bug in Blender, but either a configuration issue or bug in the software that created the *.mtl.
So why is it that previous blender versions open them just fine?
I think I might have misunderstood you. Your issue is not that the alpha socket gets an input, but rather that the alpha output of the image is used for jpegs instead of the color output, since jpegs don't have any alpha. Is that correct?
While I haven't verified this yet, the change could've been introduced by blender/blender@0696eaa3e8.
Correct. It's a huge problem in workflows that depends a lot on importing obj files using jpegs for transparencies.
Changed status from 'Archived' to: 'Needs Triage'
I'm reopening the ticket. This needs further investigation.
Added subscriber: @iss
This issue is caused by blender/blender@0696eaa3e8.
Not sure if checking extension of image would be acceptable. Crude, but it would work I guess?
You mean using png instead of jpeg?
@iss that's maybe not the cleanest solution as we would have to repeat this for all image formats without an alpha channel, but I currently don't see a cleaner way to do this with the Python API (e.g. we cannot use
alpha_mode
to check this, as this is still set toSTRAIGHT
when using JPEG, although it doesn't have an alpha channel).Wouldn't it be possible to have the program check if there is an alpha channel before connecting it so? Or at least have it be as it was before where jpegs would always be connected with from the color node?
@iss There might be a more elegant way though the Python API. We could check if
.depth
is 24 (3 * 8) and thus the image has no alpha channel.@vaik.nay That's what we are trying to do. No, we cannot revert the change introduced in
blender/blender@0696eaa3e8
, as the modification of the defaults affects other add-ons too.Added subscribers: @mont29, @lichtwerk
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
@mont29 , to not get stuck with this issue: could you make a decision here?
Quoting the commit message again:
OTOH, checking depth sounds like a useful improvement?
This issue was referenced by blender/blender@ae82410329
Changed status from 'Needs Developer To Reproduce' to: 'Resolved'