Fix: USD instancing export errors #126210

Merged
Michael Kowalski merged 2 commits from makowalski/blender:usd-instancing-export-ref-path-fix into main 2024-08-12 16:36:13 +02:00

Fixed two errors when exporting to USD with Instancing enabled:

Ensuring the mesh prototype prim exists before referencing it to
avoid the "Unresolved reference prim path" error messages in the
console.

Adding the Root Prim path prefix to the prototype reference path.

To Reproduce Errors

Open the attached instanced_plane.blend and export the scene to USDA with Instancing enabled.

Note the errors about "Unresolve reference prim path" in the console.

Next, import the USDA back into Blender and note that one of the meshes is empty. Open the USDA in a text editor to see that the mesh reference path is missing the Root Prim prefix /root:

prepend references = </Plane/Plane>
Fixed two errors when exporting to USD with Instancing enabled: Ensuring the mesh prototype prim exists before referencing it to avoid the "Unresolved reference prim path" error messages in the console. Adding the Root Prim path prefix to the prototype reference path. ### To Reproduce Errors Open the attached `instanced_plane.blend` and export the scene to USDA with `Instancing` enabled. Note the errors about "Unresolve reference prim path" in the console. Next, import the USDA back into Blender and note that one of the meshes is empty. Open the USDA in a text editor to see that the mesh reference path is missing the Root Prim prefix `/root`: ``` prepend references = </Plane/Plane> ```
Michael Kowalski added the
Module
Pipeline & IO
Interest
USD
labels 2024-08-12 01:30:41 +02:00
Michael Kowalski added 1 commit 2024-08-12 01:30:53 +02:00
Fixed two errors when exporting to USD with Instancing enabled:

Ensuring the mesh prototype prim exists before referencing it to
avoid the "Unresolved reference prim path" error messages in the
console.

Adding the Root Prim path prefix to the prototype reference path.
Michael Kowalski added this to the USD project 2024-08-12 01:30:58 +02:00
Michael Kowalski requested review from Jesse Yurkovich 2024-08-12 01:32:54 +02:00
Jesse Yurkovich approved these changes 2024-08-12 02:18:19 +02:00
Jesse Yurkovich left a comment
Member

Looks good and works well. One question: I looked for an API on SdfPath that would append 2 absolute paths like /root and /Plane/Plane into the form we need here but it looks like that doesn't exist. Should we assert that original_export_path at least contains a leading / character so the path gets formed correctly?

Looks good and works well. One question: I looked for an API on SdfPath that would append 2 absolute paths like `/root` and `/Plane/Plane` into the form we need here but it looks like that doesn't exist. Should we assert that `original_export_path` at least contains a leading `/` character so the path gets formed correctly?
Michael Kowalski added 1 commit 2024-08-12 16:08:02 +02:00
Asserting valid original_export_path
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
bb3e06bfae
Author
Member

Looks good and works well. One question: I looked for an API on SdfPath that would append 2 absolute paths like /root and /Plane/Plane into the form we need here but it looks like that doesn't exist. Should we assert that original_export_path at least contains a leading / character so the path gets formed correctly?

Thanks for the quick review and the suggestion! I added the assertion..

> Looks good and works well. One question: I looked for an API on SdfPath that would append 2 absolute paths like `/root` and `/Plane/Plane` into the form we need here but it looks like that doesn't exist. Should we assert that `original_export_path` at least contains a leading `/` character so the path gets formed correctly? Thanks for the quick review and the suggestion! I added the assertion..
Author
Member

@blender-bot build

@blender-bot build
Michael Kowalski merged commit f30689e12c into main 2024-08-12 16:36:13 +02:00
Michael Kowalski deleted branch usd-instancing-export-ref-path-fix 2024-08-12 16:36:17 +02:00
Sign in to join this conversation.
No reviewers
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
2 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#126210
No description provided.