USD import: investigate texture color space conversion issue #93904

Open
opened 1 year ago by makowalski · 14 comments
Collaborator

@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.
makowalski self-assigned this 1 year ago
Poster
Collaborator

Added subscribers: @brurpo, @makowalski

Added subscribers: @brurpo, @makowalski
Collaborator

#97136 was marked as duplicate of this issue

#97136 was marked as duplicate of this issue
Poster
Collaborator

@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.
brurpo commented 1 year ago

@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.
brurpo commented 1 year ago

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.
Poster
Collaborator

@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.
Collaborator

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Collaborator

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

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

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
Poster
Collaborator

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.
Poster
Collaborator

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

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

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)
Collaborator

Added subscribers: @weirdmonkey2807, @mano-wii

Added subscribers: @weirdmonkey2807, @mano-wii

Added subscriber: @codeloadgame

Added subscriber: @codeloadgame
mont29 added this to the Pipeline, Assets & IO project 18 hours ago
lichtwerk removed the
legacy module/Pipeline, Assets & IO
label 1 hour ago
lichtwerk removed the
Interest/Pipeline, Assets & I/O
label 1 hour ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Datablocks and Libraries
Interest/Dependency Graph
Interest/Development Management
Interest/Eevee
Interest/Overrides
Interest/Performance
Interest/Pipeline, Assets & I/O
Interest/Translations
Interest/Undo
Interest/USD
Interest/Video Sequencer
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Eevee & Viewport
legacy project/Freestyle
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/Geometry Nodes
legacy project/GPU / Viewport
legacy project/Grease Pencil
legacy project/GSoC
legacy project/Images & Movies
legacy project/Import/Export
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Line Art
legacy project/Masking
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Modeling
legacy project/Modifiers
legacy project/Motion Tracking
legacy project/Nodes
legacy project/Nodes & Physics
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Performance
legacy project/Physics
legacy project/Platforms, Builds, Tests & Devices
legacy project/Pose Library Basics
legacy project/Python API
legacy project/Render & Cycles
legacy project/Render Pipeline
legacy project/Retrospective
legacy project/Sculpt, Paint & Texture
legacy project/Text Editor
legacy project/Tracker Curfew
legacy project/Triaging
legacy project/User Interface
legacy project/UV Editing
legacy project/VFX & Video
legacy project/Virtual Reality
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#93904
Loading…
There is no content yet.