simulation: refresh the stepper latch only when a moving body is added or removed

Keeps the stationary add/remove path unchanged (test_surface_actuation builds
a Simulation without a stepper).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-10-30 06:53:35 +00:00
co-authored by Claude Opus 5.5
parent e682d16c3a
commit 36eac713f4
+5 -2
View File
@@ -172,7 +172,8 @@ class Simulation:
self.bodies.stage_add(obj)
return -1
body_id = self.bodies.add(obj)
self._refresh_stepper_block()
if translation is not None:
self._refresh_stepper_block()
return body_id
def add_jet(self, jet) -> int:
@@ -273,8 +274,10 @@ class Simulation:
if self._initialized:
self.bodies.stage_remove(id)
else:
moving = self.bodies.get(id).motion is not None
self.bodies.remove(id)
self._refresh_stepper_block()
if moving:
self._refresh_stepper_block()
# -- Legacy convenience (keep for backward compat) -----------------------
def add_cylinder(self, center: Tuple[float, ...],