USD image assets paths are not resolved in a cross platform manner #97362
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#97362
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?
USD files exported with image assets on Windows can't be loaded on Linux and vice versa. The same happens with Windows and MacOS.
Original Report
System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.42
Blender Version
Broken: version: 3.1.2, branch: master, commit date: 2022-03-31 17:40, hash:
cc66d1020c
Worked: (newest version of Blender that worked as expected)
Short description of error
USD Exporter is using back slashes for texture paths. When zipped to a usdz, this causes MacOS/Quicklook to fail loading the texture. If forward slashes are used, loading works as expected.
Exact steps for others to reproduce the error
Add a diffuse texture to default cube
Export as usda with textures and relative texture paths
Zip usda and texture folder to usdz (no compression)
Try to preview with Quicklook - no texture
Redo above steps but edit usda to use forward slashes before zipping and preview works as expected with texture.
Added subscriber: @copeg
Added subscriber: @PratikPB2123
Added subscriber: @OmarEmaraDev
Changed status from 'Needs Triage' to: 'Needs User Info'
Can you attach a small sample file with back slashes for us to debug this better?
usd_test.zip
Sure, here is the default cube with a texture exported as .usda along with the textures folder and texture.
So apparently I can't import that file back into Blender on Linux or Mac due to the Windows-like paths. So that's different already a problem.
The question is, can UNIX-like paths import into Blender on Windows?
Can you try that? Does the edited usda with forward slashes import back into Blender on Windows for you?
I'm not getting any errors importing that file with either forward or backslashes on Windows, but either way it also doesn't seem to import the texture.
Just to double check, did you enable Import USD Preview when importing? Because otherwise textures will not be imported I think.
Also, is there any error in the console after importing?
Yes, I enabled Import USD Preview in both cases, but other than that just the default options.
I don't see any errors, but get 4 instances of this warning after import:
Warning (secondary thread): in GetType at line 385 of E:\db19\build\S\VS1564R\build\usd\src\external_usd\pxr\base\vt\value.cpp -- Returning unknown type for VtValue with unregistered C++ type pxr_half::half
Here is what I found so far. USD assets can have any path format, including Windows or UNIX paths, however, the importing application will have to support resolving that format, from the documentation:
There is a default resolver in USD, which I guess is used by Blender by default, in that resolver, we see:
Moreover, on Windows
TfNormPath
is called to also replace backward slashes with forward slashes and lower case drive specifiers. So the default resolver will eventually produce a UNIX path which Blender can accept.So I suspect Quicklook is at fault here, maybe it uses a custom resolver that doesn't do this normalization? Have you tried contacting their support about this?
For the other issue, that is, textures are not importing at all no matter how the paths are constructed, can you open a separate report for it?
Based on the your quote from the spec, yes it seems like Quicklook should handle those paths. I have not contacted them, but can try. It's odd though because USD files produced with other tools work fine, so they must all be using forward slashes.
That being said, it still seems inconsistent that the importer is ensuring forward slashes when resolving but the exporter is using backslashes (or maybe it's platform dependent?) - the other internal file structure paths look to use forward slashes regardless.
Also, shouldn't that resolver solve your "WARNING: Couldn't resolve image asset '@.\textures\scene-image-medium.jpg@' for Texture Image node." issue?
Changed status from 'Needs User Info' to: 'Needs Triage'
The exporter seems to just the path as is, so it is platform dependent, while the importer should do the normalization and resolution.
You are right, we should expect it to resolve correctly in my case, but apparently the path is read as an empty string, so something is wrong somewhere.
Changed status from 'Needs Triage' to: 'Confirmed'
Setting this to confirmed as path resolution doesn't seem to be working in a cross platform manner. I tried to investigate this myself, but a more experience developer should look into this instead.
USD export texture path formatting causes problems on MacOSto USD image assets paths are not resolved in a cross platform mannerAdded subscribers: @makowalski, @lichtwerk
CC @makowalski
Thanks for investigating this, @OmarSquircleArt. I believe the solution is to ensure that relative paths have forward slashes when exporting USD from Blender. I will take this task and will work on a fix in the next couple of days.
The forward slashes should work when importing back on Windows. It didn't work for this example because of the material-name collision issue, being addressed here:
https://developer.blender.org/D14869
Because of this issue, the material wouldn't load, regardless of whether forward or back slashes are used. If I rename
Material
toMaterial2
in that USDA, the materials load fine with the forward slashes on Windows.This issue was referenced by
add1da52ad
Changed status from 'Confirmed' to: 'Resolved'
@copeg Hi Jamie. The fix is committed. Please let me know if there are remaining issues with regard to the texture paths.
Excellent! Thanks so much Michael.