@@ -55,7 +55,10 @@ def test_stage_in_memory_with_shapes(sim):
5555 # define parameters
5656 num_clones = 10
5757
58- # grab stage in memory and set as current stage via the with statement
58+ # verify stage is attached to USD context (happens automatically now with create_stage_in_memory)
59+ assert not sim_utils .is_current_stage_in_memory ()
60+
61+ # grab stage and set as current stage via the with statement
5962 stage_in_memory = sim .stage
6063 with sim_utils .use_stage (stage_in_memory ):
6164 # create cloned cone stage
@@ -108,27 +111,11 @@ def test_stage_in_memory_with_shapes(sim):
108111 prim_path_regex = "/World/env_.*/Cone"
109112 cfg .func (prim_path_regex , cfg )
110113
111- # verify stage is in memory
112- assert sim_utils .is_current_stage_in_memory ()
113-
114- # verify prims exist in stage in memory
114+ # verify prims exist in stage
115115 prims = sim_utils .find_matching_prim_paths (prim_path_regex )
116116 assert len (prims ) == num_clones
117117
118- # verify prims do not exist in context stage (if one exists)
119- context_stage = sim_utils .get_context_stage ()
120- if context_stage is not None :
121- with sim_utils .use_stage (context_stage ):
122- prims = sim_utils .find_matching_prim_paths (prim_path_regex )
123- assert len (prims ) != num_clones
124-
125- # attach stage to context
126- sim_utils .attach_stage_to_usd_context ()
127-
128- # verify stage is no longer in memory
129- assert not sim_utils .is_current_stage_in_memory ()
130-
131- # verify prims now exist in context stage
118+ # verify prims exist in context stage
132119 prims = sim_utils .find_matching_prim_paths (prim_path_regex )
133120 assert len (prims ) == num_clones
134121
@@ -147,7 +134,10 @@ def test_stage_in_memory_with_usds(sim):
147134 f"{ ISAACLAB_NUCLEUS_DIR } /Robots/ANYbotics/ANYmal-D/anymal_d.usd" ,
148135 ]
149136
150- # grab stage in memory and set as current stage via the with statement
137+ # verify stage is attached to USD context (happens automatically now with create_stage_in_memory)
138+ assert not sim_utils .is_current_stage_in_memory ()
139+
140+ # grab stage and set as current stage via the with statement
151141 stage_in_memory = sim .stage
152142 with sim_utils .use_stage (stage_in_memory ):
153143 # create cloned robot stage
@@ -174,27 +164,11 @@ def test_stage_in_memory_with_usds(sim):
174164 prim_path_regex = "/World/env_.*/Robot"
175165 cfg .func (prim_path_regex , cfg )
176166
177- # verify stage is in memory
178- assert sim_utils .is_current_stage_in_memory ()
179-
180- # verify prims exist in stage in memory
167+ # verify prims exist in stage
181168 prims = sim_utils .find_matching_prim_paths (prim_path_regex )
182169 assert len (prims ) == num_clones
183170
184- # verify prims do not exist in context stage (if one exists)
185- context_stage = sim_utils .get_context_stage ()
186- if context_stage is not None :
187- with sim_utils .use_stage (context_stage ):
188- prims = sim_utils .find_matching_prim_paths (prim_path_regex )
189- assert len (prims ) != num_clones
190-
191- # attach stage to context
192- sim_utils .attach_stage_to_usd_context ()
193-
194- # verify stage is no longer in memory
195- assert not sim_utils .is_current_stage_in_memory ()
196-
197- # verify prims now exist in context stage
171+ # verify prims exist in context stage
198172 prims = sim_utils .find_matching_prim_paths (prim_path_regex )
199173 assert len (prims ) == num_clones
200174
@@ -210,7 +184,10 @@ def test_stage_in_memory_with_clone_in_fabric(sim):
210184 usd_path = f"{ ISAACLAB_NUCLEUS_DIR } /Robots/ANYbotics/ANYmal-C/anymal_c.usd"
211185 num_clones = 100
212186
213- # grab stage in memory and set as current stage via the with statement
187+ # verify stage is attached to USD context (happens automatically now with create_stage_in_memory)
188+ assert not sim_utils .is_current_stage_in_memory ()
189+
190+ # grab stage and set as current stage via the with statement
214191 stage_in_memory = sim .stage
215192 with sim_utils .use_stage (stage_in_memory ):
216193 # set up paths
@@ -235,22 +212,8 @@ def test_stage_in_memory_with_clone_in_fabric(sim):
235212 replicate_physics = True ,
236213 clone_in_fabric = True ,
237214 )
238- prim_path_regex = "/World/envs/env_.*"
239-
240- # verify prims do not exist in context stage (if one exists)
241- context_stage = sim_utils .get_context_stage ()
242- if context_stage is not None :
243- with sim_utils .use_stage (context_stage ):
244- prims = sim_utils .find_matching_prim_paths (prim_path_regex )
245- assert len (prims ) != num_clones
246-
247- # attach stage to context
248- sim_utils .attach_stage_to_usd_context ()
249-
250- # verify stage is no longer in memory
251- assert not sim_utils .is_current_stage_in_memory ()
252215
253- # verify prims now exist in fabric stage using usdrt apis
216+ # verify prims exist in fabric stage using usdrt apis
254217 stage_id = sim_utils .get_current_stage_id ()
255218 usdrt_stage = usdrt .Usd .Stage .Attach (stage_id )
256219 for i in range (num_clones ):
0 commit comments