Skip to content

Commit f63d64b

Browse files
ooctipuscursoragent
andcommitted
Restore direct rigid collection spawning
Allow rigid object collections to fall back to prim_path when they are constructed outside InteractiveScene, while still honoring clone-planned spawn_path values. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ea2b715 commit f63d64b

4 files changed

Lines changed: 8 additions & 13 deletions

File tree

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Changed
22
^^^^^^^
33

4-
* Changed rigid object collection spawning to require an explicit
5-
``spawn.spawn_path`` when a member has a spawner. Use ``spawn=None`` for
6-
pre-authored prims that should only construct a view.
4+
* Changed rigid object collection spawning to honor planned ``spawn_path``
5+
values while falling back to ``prim_path`` for direct construction.

source/isaaclab_newton/isaaclab_newton/assets/rigid_object_collection/rigid_object_collection.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ def __init__(self, cfg: RigidObjectCollectionCfg):
7878
for rigid_body_cfg in self.cfg.rigid_objects.values():
7979
# spawn the asset
8080
if rigid_body_cfg.spawn is not None:
81-
# ``spawn=None`` means the prim already exists; otherwise the authoring path is explicit.
82-
if rigid_body_cfg.spawn.spawn_path is None:
83-
raise RuntimeError(f"Missing spawn_path for rigid object '{rigid_body_cfg.prim_path}'.")
81+
spawn_path = rigid_body_cfg.spawn.spawn_path or rigid_body_cfg.prim_path
8482
rigid_body_cfg.spawn.func(
85-
rigid_body_cfg.spawn.spawn_path,
83+
spawn_path,
8684
rigid_body_cfg.spawn,
8785
translation=rigid_body_cfg.init_state.pos,
8886
orientation=rigid_body_cfg.init_state.rot,
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Changed
22
^^^^^^^
33

4-
* Changed rigid object collection spawning to require an explicit
5-
``spawn.spawn_path`` when a member has a spawner. Use ``spawn=None`` for
6-
pre-authored prims that should only construct a view.
4+
* Changed rigid object collection spawning to honor planned ``spawn_path``
5+
values while falling back to ``prim_path`` for direct construction.

source/isaaclab_physx/isaaclab_physx/assets/rigid_object_collection/rigid_object_collection.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ def __init__(self, cfg: RigidObjectCollectionCfg):
8181
for rigid_body_cfg in self.cfg.rigid_objects.values():
8282
# spawn the asset
8383
if rigid_body_cfg.spawn is not None:
84-
if rigid_body_cfg.spawn.spawn_path is None:
85-
raise RuntimeError(f"Missing spawn_path for rigid object '{rigid_body_cfg.prim_path}'.")
84+
spawn_path = rigid_body_cfg.spawn.spawn_path or rigid_body_cfg.prim_path
8685
rigid_body_cfg.spawn.func(
87-
rigid_body_cfg.spawn.spawn_path,
86+
spawn_path,
8887
rigid_body_cfg.spawn,
8988
translation=rigid_body_cfg.init_state.pos,
9089
orientation=rigid_body_cfg.init_state.rot,

0 commit comments

Comments
 (0)