Skip to content

Commit

Permalink
update for update_entity compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBaGar committed Feb 4, 2025
1 parent fc2ffad commit 2840a9b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions molecularnodes/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,19 @@ def update_entities(scene):
for entity in session.entities.values():
# use the updated method if it exists but otherwise fallback on the old method
# of updating the trajectories

if hasattr(entity, "update_with_scene"):
if entity.update_with_scene:
frame_to_set = scene.frame_current
else:
frame_to_set = entity.frame

# do the entity setting, if the method isn't implemented, just pass
try:
entity.set_frame(frame_to_set)
except NotImplementedError:
pass

else:
traj._update_positions(scene.frame_current)
traj._update_selections()
traj._update_calculations()

for entity in session.entities.values():
if hasattr(entity, "update_with_scene"):
if entity.update_with_scene:
Expand All @@ -65,9 +60,3 @@ def update_entities(scene):

if entity._entity_type.value == "interaction":
entity.set_frame(scene.frame_current)

Check warning on line 62 in molecularnodes/handlers.py

View check run for this annotation

Codecov / codecov/patch

molecularnodes/handlers.py#L62

Added line #L62 was not covered by tests

# except NotImplementedError:
# pass
# except Exception as e:
# # print(f"Error updating {traj}: {e}")
# raise e

0 comments on commit 2840a9b

Please sign in to comment.