Some fixes

This commit is contained in:
Cem Gökmen 2024-01-09 23:24:32 -08:00
parent 7c4f6fe5ae
commit bf288b7479
2 changed files with 11 additions and 6 deletions

View File

@ -162,12 +162,14 @@ class EntityPrim(XFormPrim):
def remove(self):
# First remove all joints
for joint in self._joints.values():
joint.remove()
if self._joints is not None:
for joint in self._joints.values():
joint.remove()
# Then links
for link in self._links.values():
link.remove()
if self._links is not None:
for link in self._links.values():
link.remove()
# Finally, remove this prim
super().remove()

View File

@ -44,6 +44,9 @@ def test_removal_and_readdition():
)
og.sim.import_object(apple2)
# Clear the stuff we added
og.sim.remove_object(apple2)
@og_test
def test_readdition():
# Make a copy of NAMES
@ -79,5 +82,5 @@ def test_readdition():
# Check that NAMES has not changed
assert NAMES == new_names
if __name__ == "__main__":
test_removal_and_readdition()
# Clear the stuff we added
og.sim.remove_object(apple)