USD import: investigate texture color space conversion issue #93904

Open
opened 2021-12-09 15:42:00 +01:00 by Michael Kowalski · 14 comments

@brurpo Reported the following issue:

When exporting USD from maya to blender none of the textures comes with the correct color space, they are all srgb.
Importing on maya again, on a clean scene, does not have this issue, all textures are loaded with the correct color space.
Is there a workaround for this, or is this planned?

I'll be looking into this.

@brurpo Reported the following issue: > When exporting USD from maya to blender none of the textures comes with the correct color space, they are all srgb. > Importing on maya again, on a clean scene, does not have this issue, all textures are loaded with the correct color space. > Is there a workaround for this, or is this planned? I'll be looking into this.
Michael Kowalski self-assigned this 2021-12-09 15:42:00 +01:00
Author
Member

Added subscribers: @brurpo, @makowalski

Added subscribers: @brurpo, @makowalski

#97136 was marked as duplicate of this issue

#97136 was marked as duplicate of this issue
Author
Member

@brurpo thank you for the test assets to reproduce this. I'll look into this and will let you know what I find.

@brurpo thank you for the test assets to reproduce this. I'll look into this and will let you know what I find.

@makowalski You are awesome! Let me know if you need anything, even if you want a call for me to show you the process or if you want a simpler usd.

@makowalski You are awesome! Let me know if you need anything, even if you want a call for me to show you the process or if you want a simpler usd.

Hi @makowalski ! Recently, maya released an update that fixed this, so it was not a problem on blenders side afterall. What was weird is that maya was importing the colorspace correctly, maybe it used something that only maya could read and now it uses something that is more generic?
If you want, I can send you the new exported USD.
Cheers.

Hi @makowalski ! Recently, maya released an update that fixed this, so it was not a problem on blenders side afterall. What was weird is that maya was importing the colorspace correctly, maybe it used something that only maya could read and now it uses something that is more generic? If you want, I can send you the new exported USD. Cheers.
Author
Member

@brurpo I'm glad there's a fix in Maya!

I tracked the issue down to the following: the colorSpace metadata in that USD is given as "Raw" (note the capitalization). Lowercase "raw" is the actual standard, I believe. In my code I was checking for "raw" as well as "RAW" (all caps) which is another variant I've seen. If I change my code to do a case-insensitive string comparison against "raw", the color space comes is correctly for this USD.

I'm guessing that Maya updated their code to use the standard "raw" token now, so we'll have to consider whether doing this fix is worth the effort. I'll give it some thought.

@brurpo I'm glad there's a fix in Maya! I tracked the issue down to the following: the `colorSpace` metadata in that USD is given as "Raw" (note the capitalization). Lowercase "raw" is the actual standard, I believe. In my code I was checking for "raw" as well as "RAW" (all caps) which is another variant I've seen. If I change my code to do a case-insensitive string comparison against "raw", the color space comes is correctly for this USD. I'm guessing that Maya updated their code to use the standard "raw" token now, so we'll have to consider whether doing this fix is worth the effort. I'll give it some thought.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

In #93904#1269872, @makowalski wrote:
@brurpo I'm glad there's a fix in Maya!

I tracked the issue down to the following: the colorSpace metadata in that USD is given as "Raw" (note the capitalization). Lowercase "raw" is the actual standard, I believe. In my code I was checking for "raw" as well as "RAW" (all caps) which is another variant I've seen. If I change my code to do a case-insensitive string comparison against "raw", the color space comes is correctly for this USD.

I'm guessing that Maya updated their code to use the standard "raw" token now, so we'll have to consider whether doing this fix is worth the effort. I'll give it some thought.

@makowalski: I assume this can be confirmed then?
It would still be good to have an example .USD here (maybe alongside screenshots expected vs. actual behavior) just in case someone else will end up looking at this

> In #93904#1269872, @makowalski wrote: > @brurpo I'm glad there's a fix in Maya! > > I tracked the issue down to the following: the `colorSpace` metadata in that USD is given as "Raw" (note the capitalization). Lowercase "raw" is the actual standard, I believe. In my code I was checking for "raw" as well as "RAW" (all caps) which is another variant I've seen. If I change my code to do a case-insensitive string comparison against "raw", the color space comes is correctly for this USD. > > I'm guessing that Maya updated their code to use the standard "raw" token now, so we'll have to consider whether doing this fix is worth the effort. I'll give it some thought. @makowalski: I assume this can be confirmed then? It would still be good to have an example .USD here (maybe alongside screenshots expected vs. actual behavior) just in case someone else will end up looking at this
Author
Member

Hi @lichtwerk. Thanks for following up on this. Yes, this bug can be confirmed, and I'll provide a USD example, as you suggested. This is a relatively simple change, and I will most likely make the fix after the latest USD Preview Surface import patch (https://developer.blender.org/D13297) has been approved and merged into master.

Hi @lichtwerk. Thanks for following up on this. Yes, this bug can be confirmed, and I'll provide a USD example, as you suggested. This is a relatively simple change, and I will most likely make the fix after the latest USD Preview Surface import patch (https://developer.blender.org/D13297) has been approved and merged into master.
Author
Member

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Author
Member

I'm uploading the notebook.7z archive originally provided by @brurpo that contains the USDs and textures that exhibit the behavior. Note that this example is for Windows only, as it references textures in the c: drive. To test on Windows, extract the contents under the c: root for the texture paths to resolve correctly.

notebook.7z

An example of the issue is that the roughness textures in the USD

asset inputs:file = @C:/notebook/TEXTURES/ESTRUTURA_TOP/NOTEBOOK_ESTRUTURA_TOP_SG_Roughness.png@ (
                    colorSpace = "Raw"
                )

is imported with color space sRGB:

image.png

I'm uploading the notebook.7z archive originally provided by @brurpo that contains the USDs and textures that exhibit the behavior. Note that this example is for Windows only, as it references textures in the `c:` drive. To test on Windows, extract the contents under the `c:` root for the texture paths to resolve correctly. [notebook.7z](https://archive.blender.org/developer/F12927937/notebook.7z) An example of the issue is that the roughness textures in the USD ``` asset inputs:file = @C:/notebook/TEXTURES/ESTRUTURA_TOP/NOTEBOOK_ESTRUTURA_TOP_SG_Roughness.png@ ( colorSpace = "Raw" ) ``` is imported with color space `sRGB`: ![image.png](https://archive.blender.org/developer/F12928042/image.png)

Added subscribers: @weirdmonkey2807, @mano-wii

Added subscribers: @weirdmonkey2807, @mano-wii

Added subscriber: @codeloadgame

Added subscriber: @codeloadgame
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:40:38 +01:00
Philipp Oeser removed the
Interest
Pipeline, Assets & IO
label 2023-02-10 08:54:06 +01:00
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 Assignees
6 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#93904
No description provided.