USD Import Renames Prim above Mesh #123820

Open
opened 2024-06-27 10:58:32 +02:00 by Chris · 10 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.23

Blender Version
Broken: version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: 40a5e739e270

Short description of error
When importing a USD file the Import renames Prim above Mesh to match the Object Data name.
This is possibly going to be hard to explain, due to terminology. By default blender has a object name Suzanne (orange triangle) and the Object Data below (green triangle) is also called Suzanne. When exported to to USD the object name gets stored as a 'Xform' prim and the Object Data gets stored as a 'Mesh' prim. Perfect!
The issue is upon importing. It appears that the 'Mesh' prim name over write the name of the 'Xform' prim, meaning in Blender we get a object name of whatever the name of the Object Data below is called.
This actually goes further up, if you have the object under an actual 'Xform' prim and you manually remove that in the usd file, then that 'Xform' prim gets named based on the Object Data, which is very concerning.
Hopefully the images attached explain it clearly.

Exact steps for others to reproduce the error
Create a hierarchy with some Empties like this:

  • asset_name (empty)
    • geo (empty)
      • Suzanne (orange triangle)
        • SuzanneMesh (green triangle) <- note that this name does not match the name above

export this to USD, then reimport it to Blender and you will get:

  • asset_name (empty)
    • geo (empty)
      • SuzanneMesh (orange triangle)
        • SuzanneMesh (green triangle) <- note that this name does not match the name above

if I manually remove the xform prim in the USD file representing 'Suzanne' (orange triangle) then re-import it the 'geo' empty will be renamed now:

  • asset_name (empty)
    • SuzanneMesh (orange triangle)
      • SuzanneMesh (green triangle) <- note that this name does not match the name above

Ideally the import should match the export with the Object Name and Object Data names being the same.
In the case of the manual removal, I am not sure what to suggest in terms of how it should handle this situation. Either create an Object to store the Mesh Data or have a tick box asking the user if it should use the prim above as the Object. But the way it removed the 'geo' prim from the hierarchy is not great.

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.23 **Blender Version** Broken: version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: `40a5e739e270` **Short description of error** When importing a USD file the Import renames Prim above Mesh to match the Object Data name. This is possibly going to be hard to explain, due to terminology. By default blender has a object name Suzanne (orange triangle) and the Object Data below (green triangle) is also called Suzanne. When exported to to USD the object name gets stored as a 'Xform' prim and the Object Data gets stored as a 'Mesh' prim. Perfect! The issue is upon importing. It appears that the 'Mesh' prim name over write the name of the 'Xform' prim, meaning in Blender we get a object name of whatever the name of the Object Data below is called. This actually goes further up, if you have the object under an actual 'Xform' prim and you manually remove that in the usd file, then that 'Xform' prim gets named based on the Object Data, which is very concerning. Hopefully the images attached explain it clearly. **Exact steps for others to reproduce the error** Create a hierarchy with some Empties like this: + asset_name (empty) + geo (empty) + Suzanne (orange triangle) + SuzanneMesh (green triangle) <- note that this name does not match the name above export this to USD, then reimport it to Blender and you will get: + asset_name (empty) + geo (empty) + SuzanneMesh (orange triangle) + SuzanneMesh (green triangle) <- note that this name does not match the name above if I manually remove the xform prim in the USD file representing 'Suzanne' (orange triangle) then re-import it the 'geo' empty will be renamed now: + asset_name (empty) + SuzanneMesh (orange triangle) + SuzanneMesh (green triangle) <- note that this name does not match the name above Ideally the import should match the export with the Object Name and Object Data names being the same. In the case of the manual removal, I am not sure what to suggest in terms of how it should handle this situation. Either create an Object to store the Mesh Data or have a tick box asking the user if it should use the prim above as the Object. But the way it removed the 'geo' prim from the hierarchy is not great.
Chris added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2024-06-27 10:58:32 +02:00
Iliya Katushenock added the
Interest
Pipeline & IO
Interest
USD
labels 2024-06-27 11:50:37 +02:00
Member

Can confirm, will check (Alembic does not have the same issue btw...)

Can confirm, will check (Alembic does not have the same issue btw...)
Philipp Oeser self-assigned this 2024-06-27 12:18:28 +02:00
Author

Awesome, thanks for looking into that.

Interestingly maya has a similar issue, but it actually makes another Data Object so it goes in the opposite direction: https://github.com/Autodesk/maya-usd/issues/3837

Awesome, thanks for looking into that. Interestingly maya has a similar issue, but it actually makes another Data Object so it goes in the opposite direction: https://github.com/Autodesk/maya-usd/issues/3837
Member

this is the export of the attached .blend (so that is indeed fine)

 `--root [def Xform]
     |--Asset [def Xform]
     |   `--geo [def Xform]
     |       `--Suzanne [def Xform]
     |           `--SuzanneMesh [def Mesh] (active = true)
     `--env_light [def DomeLight]

Looking at the import now...

this is the export of the attached .blend (so that is indeed fine) ``` `--root [def Xform] |--Asset [def Xform] | `--geo [def Xform] | `--Suzanne [def Xform] | `--SuzanneMesh [def Mesh] (active = true) `--env_light [def DomeLight] ``` Looking at the import now...
Member

Comparing AbcObjectReader::AbcObjectReader and USDPrimReader::USDPrimReader there might be ways to extract the parent Xform from GetPrimPath(), lets see...

Comparing `AbcObjectReader::AbcObjectReader` and `USDPrimReader::USDPrimReader` there might be ways to extract the parent Xform from `GetPrimPath()`, lets see...
Member

OK, PoC (below is the patched import) is working, will refine and check with the module tomorrow...

image

OK, PoC (below is the patched import) is working, will refine and check with the module tomorrow... ![image](/attachments/f3251b24-e91c-47bf-a3c0-326f52b05568)
Author

Amazing stuff 😋 not sure if everyone's use case will be the same... but this solution looks promising.

Amazing stuff :yum: not sure if everyone's use case will be the same... but this solution looks promising.
Chris closed this issue 2024-06-27 13:47:14 +02:00
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-06-27 13:47:17 +02:00
Chris reopened this issue 2024-06-27 13:47:52 +02:00
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2024-06-27 13:47:55 +02:00
Author

Sorry I think I clicked 'Close with Comment' by accident instead of 'Comment'

Sorry I think I clicked 'Close with Comment' by accident instead of 'Comment'
Iliya Katushenock added
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-06-27 13:55:49 +02:00
Bastien Montagne added this to the USD project 2024-06-28 10:05:32 +02:00
@deadpin @makowalski FYI :)

@lichtwerk Thanks for looking into this! Yes, by all means, please create a pull request for this patch when you are ready.

@lichtwerk Thanks for looking into this! Yes, by all means, please create a pull request for this patch when you are ready.
Member

Fix is up, see !124041

Fix is up, see !124041
Bart van der Braak added
Type
Bug
and removed
Type
Report
labels 2024-08-14 12:58:24 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#123820
No description provided.