Skip to content

Commit

Permalink
Quality of Life improvements with events
Browse files Browse the repository at this point in the history
Initialize events will no longer add empty events if there are already events for that type.
Disable Lipsync events now accept the duration of how long the jaw can be animated in frames.
  • Loading branch information
thepancake1 committed Feb 14, 2022
1 parent dd2b366 commit 8d27679
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,12 @@ def setup_events(self, context, current_clip, start_frame, frame_count, addition
start_time)
current_clip.add_event(
event(timeshifted_timestamp, timeshifted_end_timestamp, *parameters[2:]))
elif event == SuppressLipsyncEvent:
if frame_time >= timeshifted_timestamp >= 0:
_, timeshifted_end_timestamp = self.create_timeshifted_timestamp(parameters[1].strip(),
start_time)
current_clip.add_event(
event(timeshifted_timestamp, timeshifted_end_timestamp, *parameters[2:]))
else:
if frame_time >= timeshifted_timestamp >= 0:
current_clip.add_event(event(timeshifted_timestamp, *parameters[1:]))
Expand Down Expand Up @@ -1305,25 +1311,25 @@ class InitializeEvents(bpy.types.Operator):
bl_options = {"REGISTER", "UNDO"}

def execute(self, context):
if len(context.object.parent_events_list == 0):
if len(context.object.parent_events_list) == 0:
context.object.parent_events_list.add()
if len(context.object.sound_events_list == 0):
if len(context.object.sound_events_list) == 0:
context.object.sound_events_list.add()
if len(context.object.script_events_list == 0):
if len(context.object.script_events_list) == 0:
context.object.script_events_list.add()
if len(context.object.play_effect_events_list == 0):
if len(context.object.play_effect_events_list) == 0:
context.object.play_effect_events_list.add()
if len(context.object.stop_effect_events_list == 0):
if len(context.object.stop_effect_events_list) == 0:
context.object.stop_effect_events_list.add()
if len(context.object.disable_lipsync_events_list == 0):
if len(context.object.disable_lipsync_events_list) == 0:
context.object.disable_lipsync_events_list.add()
if len(context.object.snap_events_list == 0):
if len(context.object.snap_events_list) == 0:
context.object.snap_events_list.add()
if len(context.object.reaction_events_list == 0):
if len(context.object.reaction_events_list) == 0:
context.object.reaction_events_list.add()
if len(context.object.visibility_events_list == 0):
if len(context.object.visibility_events_list) == 0:
context.object.visibility_events_list.add()
if len(context.object.focus_compatibility_events_list == 0):
if len(context.object.focus_compatibility_events_list) == 0:
context.object.focus_compatibility_events_list.add()
return {"FINISHED"}

Expand Down

0 comments on commit 8d27679

Please sign in to comment.