Skip to content

Ensure ObjectReferences are processed after their parent assets in Scene#532

Open
xyao-nv wants to merge 3 commits intomainfrom
xyao/fix_obj_ref_scene
Open

Ensure ObjectReferences are processed after their parent assets in Scene#532
xyao-nv wants to merge 3 commits intomainfrom
xyao/fix_obj_ref_scene

Conversation

@xyao-nv
Copy link
Copy Markdown
Collaborator

@xyao-nv xyao-nv commented Apr 1, 2026

Summary

The bug was discovered in DLI course that ObjectReference cannot be added before parent Object when concat them into Scene construction. This MR adds ordering guarantees and a validation check to prevent this bug.

Detailed description

  • Previously, the order in which assets were passed to Scene.add_assets() determined processing order, which could silently lead to incorrect behavior if an ObjectReference was listed before its parent.
  • Now it sorts assets so that ObjectReference instances are always processed last, regardless of input order.
  • Add an assertion that every ObjectReference in the list has its parent_asset included in the same add_assets() call. Raises a clear error message if not.
  • Add tests.

@xyao-nv xyao-nv marked this pull request as ready for review April 1, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant