Skip to content

Instantly share code, notes, and snippets.

@tin2tin
Created April 26, 2024 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tin2tin/3f0afc8dede0b145a2553103a086ed32 to your computer and use it in GitHub Desktop.
Save tin2tin/3f0afc8dede0b145a2553103a086ed32 to your computer and use it in GitHub Desktop.
Retime UI
import bpy
class RETIMING_PT_panel(bpy.types.Panel):
bl_label = "Retiming"
bl_idname = "RETIMING_PT_panel"
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
bl_category = 'Strip'
def draw_header_preset(self, context):
layout = self.layout
layout.alignment = 'RIGHT'
strip = context.active_sequence_strip
icon = "HIDE_OFF" if strip.show_retiming_keys else "HIDE_ON"
layout.prop(strip, "show_retiming_keys", text="", icon_only=True, emboss=False, icon=icon)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
seq_editor = context.scene.sequence_editor
active_strip = seq_editor.active_strip
if active_strip and active_strip.type == 'MOVIE':
retiming_keys = active_strip.retiming_keys
col = layout.column(align=True)
for count, key in enumerate(retiming_keys):
col.prop(key, "timeline_frame", text="Keys" if not count else " ")
def register():
bpy.utils.register_class(RETIMING_PT_panel)
def unregister():
bpy.utils.unregister_class(RETIMING_PT_panel)
if __name__ == "__main__":
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment