OBJ Import Alpha Map Problem #32637

Closed
opened 2012-09-23 11:37:47 +02:00 by Hikmet Koyuncu · 10 comments

%%%Intel Pentium Core 4 I5 2500K
Intel HD 3000
8 GB RAM
Windows 7 Ultimate 64-bit
Blender 2.63a and 2.64 RC1

When import an OBJ model in Blender, if Texture has an Alpha Channel, this channel is skipped.

I opened "import_obj.py" script file and checked.

      if image:
          texture.image = image
          has_data = image.has_data

In this code, "image.has_data" always return "False" value. If change this code:

      if image:
          texture.image = image
          has_data = True

Fix this problem.

And use "map_d" in MTL file, and load "Alpha Map", then this texture slot must up on the Diffuse Texture, otherwise not work properly and user be obliged to change this order manual.

   map_d   Texture_ALPHA.png
   map_Kd Texture.png

This order work.

   map_Kd Texture.png
   map_d   Texture_ALPHA.png

This order is not work. Import script must fix order automaticly, but not do.%%%

%%%Intel Pentium Core 4 I5 2500K Intel HD 3000 8 GB RAM Windows 7 Ultimate 64-bit Blender 2.63a and 2.64 RC1 When import an OBJ model in Blender, if Texture has an Alpha Channel, this channel is skipped. I opened "import_obj.py" script file and checked. ``` if image: texture.image = image has_data = image.has_data ``` In this code, "image.has_data" always return "False" value. If change this code: ``` if image: texture.image = image has_data = True ``` Fix this problem. And use "map_d" in MTL file, and load "Alpha Map", then this texture slot must up on the Diffuse Texture, otherwise not work properly and user be obliged to change this order manual. ``` map_d Texture_ALPHA.png map_Kd Texture.png ``` This order work. ``` map_Kd Texture.png map_d Texture_ALPHA.png ``` This order is not work. Import script must fix order automaticly, but not do.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%Campbell, can you please check on that? Not a stopper, can be fixed after release though. %%%

%%%Campbell, can you please check on that? Not a stopper, can be fixed after release though. %%%

%%%This makes sense, if textures are not assigned to alpha textrue channels we dont have to set the alpha values.

Having the image data available isn''t a given so probably we better jabe it check for map_d or map_tr%%%

%%%This makes sense, if textures are not assigned to alpha textrue channels we dont have to set the alpha values. Having the image data available isn''t a given so probably we better jabe it check for map_d or map_tr%%%
Member

%%%note that map_tr stands for "Translucency" and map_d for "transparency"%%%

%%%note that map_tr stands for "Translucency" and map_d for "transparency"%%%
Author

%%%Order problem fixed on 2.64a.

Some programs not write "map_d", if image has an alpha channel, only write "map_Kd". Example XFrog export from "DEEP Exploration" program.

Some programs cannot read space characters in path. Path value get inside double quotes. So all programs will able to read OBJ files export from Blender (example DAZ Studio).

In Blender, alpha masked materials should "Alpha = 0" and when export OBJ file, write "d 0.000000". But most programs cannot reads this value correctly, because in this programs use "d 1.000000" value (example 3ds Max, DAZ Studio). And on this programs surface appear completely transparent (invisible).%%%

%%%Order problem fixed on 2.64a. Some programs not write "map_d", if image has an alpha channel, only write "map_Kd". Example XFrog export from "DEEP Exploration" program. Some programs cannot read space characters in path. Path value get inside double quotes. So all programs will able to read OBJ files export from Blender (example DAZ Studio). In Blender, alpha masked materials should "Alpha = 0" and when export OBJ file, write "d 0.000000". But most programs cannot reads this value correctly, because in this programs use "d 1.000000" value (example 3ds Max, DAZ Studio). And on this programs surface appear completely transparent (invisible).%%%
Member

%%%the problem is that blender interpretes "tr" values as transparency while all others follow the obj documentation and use it as translucency which has inverted values to alpha.
i already tried to explain this in irc but seems its really hard to understand that d!=tr / transparency != TRANSLUCENCY and need to be handled seperately.
this is why it fails.%%%

%%%the problem is that blender interpretes "tr" values as transparency while all others follow the obj documentation and use it as translucency which has inverted values to alpha. i already tried to explain this in irc but seems its really hard to understand that d!=tr / transparency != TRANSLUCENCY and need to be handled seperately. this is why it fails.%%%

%%%Hi, looking into this report, since its opened some of the issues with material setting import/export have been resolved.

Hikmet Koyuncu: You say...
In Blender, alpha masked materials should "Alpha = 0" and when export OBJ file, write "d 0.000000". ...

This should be reported as a separate bug, with example of expected output and blend file which produces incorrect output.%%%

%%%Hi, looking into this report, since its opened some of the issues with material setting import/export have been resolved. Hikmet Koyuncu: You say... In Blender, alpha masked materials should "Alpha = 0" and when export OBJ file, write "d 0.000000". ... This should be reported as a separate bug, with example of expected output and blend file which produces incorrect output.%%%

%%%Could you include an OBJ that doesnt import correctly?

I can see how the code might not work but Id like to verify the changes fix this bug.
%%%

%%%Could you include an OBJ that doesnt import correctly? I can see how the code might not work but Id like to verify the changes fix this bug. %%%

%%%fixed r4028. now has_data works as it used to.%%%

%%%fixed r4028. now has_data works as it used to.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#32637
No description provided.