Skip to content

Commit

Permalink
fix: avoid calculation of mapping if the current frame has no active …
Browse files Browse the repository at this point in the history
…effects
  • Loading branch information
ntamas committed Apr 12, 2024
1 parent f59afd2 commit 98b85df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/modules/sbstudio/plugin/tasks/light_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def update_light_effects(scene: Scene, depsgraph: Depsgraph):
frame = scene.frame_current
drones = None

mapping = scene.skybrush.storyboard.get_mapping_at_frame(frame)

if _last_frame != frame:
# Frame changed, clear the base color cache
_last_frame = frame
Expand All @@ -76,6 +74,7 @@ def update_light_effects(scene: Scene, depsgraph: Depsgraph):
# The only allocations should be concentrated here
drones = Collections.find_drones().objects
positions = [get_position_of_object(drone) for drone in drones]
mapping = scene.skybrush.storyboard.get_mapping_at_frame(frame)
if not _base_color_cache:
# This is the first time we are evaluating this frame, so fill
# the base color cache in parallel to the colors list
Expand Down

0 comments on commit 98b85df

Please sign in to comment.