def _display_compositor_edit_box(): # This gets called on startup before edit_frame is filled try: widgets.value_edit_frame.remove(widgets.value_edit_box) except: pass global keyframe_editor_widgets keyframe_editor_widgets = [] vbox = Gtk.VBox() # Case: Empty edit frame global compositor if compositor == None: widgets.empty_label = Gtk.Label(label=_("No Compositor")) vbox.pack_start(widgets.empty_label, True, True, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() widgets.value_edit_box = vbox widgets.value_edit_frame.add(vbox) return # Case: Filled frame compositor_name_label = Gtk.Label(label="<b>" + compositor.name + "</b>") compositor_name_label.set_use_markup(True) vbox.pack_start(compositor_name_label, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Track editor target_combo = guicomponents.get_compositor_track_select_combo( current_sequence().tracks[compositor.transition.b_track], current_sequence().tracks[compositor.transition.a_track], _target_track_changed) target_row = Gtk.HBox() target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(Gtk.Label(label=_("Destination Track:")), False, False, 0) target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(target_combo, False, False, 0) target_row.pack_start(Gtk.Label(), True, True, 0) vbox.pack_start(target_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Transition editors t_editable_properties = propertyedit.get_transition_editable_properties( compositor) for ep in t_editable_properties: editor_row = propertyeditorbuilder.get_editor_row(ep) if editor_row != None: # Some properties don't have editors vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Add keyframe editor widget to be updated for frame changes if such is created. try: editor_type = ep.args[propertyeditorbuilder.EDITOR] except KeyError: editor_type = propertyeditorbuilder.SLIDER # this is the default value if ((editor_type == propertyeditorbuilder.KEYFRAME_EDITOR) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_RELEASE) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_CLIP) or (editor_type == propertyeditorbuilder.FADE_LENGTH) or (editor_type == propertyeditorbuilder.GEOMETRY_EDITOR)): keyframe_editor_widgets.append(editor_row) # Extra editors. Editable properties have already been created with "editor=no_editor" # and will be looked up by editors from clip editor_rows = propertyeditorbuilder.get_transition_extra_editor_rows( compositor, t_editable_properties) for editor_row in editor_rows: # These are added to keyframe editor based on editor type, not based on EditableProperty type as above # because one editor sets values for multiple EditableProperty objects if editor_row.__class__ == keyframeeditor.RotatingGeometryEditor: keyframe_editor_widgets.append(editor_row) vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) hamburger_launcher_surface = cairo.ImageSurface.create_from_png( respaths.IMAGE_PATH + "hamburger_big.png") hamburger_launcher = guicomponents.PressLaunch(_hamburger_launch_pressed, hamburger_launcher_surface, 24, 24) sl_row = guiutils.get_right_justified_box([hamburger_launcher.widget]) vbox.pack_start(sl_row, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window)
def _display_compositor_edit_box(): # This gets called on startup before edit_frame is filled try: widgets.value_edit_frame.remove(widgets.value_edit_box) except: pass global keyframe_editor_widgets keyframe_editor_widgets = [] vbox = Gtk.VBox() # Case: Empty edit frame global compositor if compositor == None: #widgets.empty_label = Gtk.Label(label=_("No Compositor")) filler = Gtk.EventBox() filler.add(Gtk.Label()) vbox.pack_start(filler, True, True, 0) info = Gtk.Label(label=_("No Compositor")) info.set_sensitive(False) filler = Gtk.EventBox() filler.add(info) vbox.pack_start(filler, False, False, 0) filler = Gtk.EventBox() filler.add(Gtk.Label()) vbox.pack_start(filler, True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window) return # Case: Filled frame compositor_name_label = Gtk.Label(label="<b>" + compositor.name + "</b>") compositor_name_label.set_use_markup(True) vbox.pack_start(compositor_name_label, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Track editor target_combo = guicomponents.get_compositor_track_select_combo( current_sequence().tracks[compositor.transition.b_track], current_sequence().tracks[compositor.transition.a_track], _target_track_changed) target_row = Gtk.HBox() target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(Gtk.Label(label=_("Destination Track:")), False, False, 0) target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(target_combo, False, False, 0) target_row.pack_start(Gtk.Label(), True, True, 0) vbox.pack_start(target_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Fade buttons compositor_info = guicomponents.CompositorInfoPanel() fade_in_b = Gtk.Button(_("Add Fade In")) fade_in_b.connect("clicked", lambda w, e: _add_fade_in_pressed(), None) fade_out_b = Gtk.Button(_("Add Fade Out")) fade_out_b.connect("clicked", lambda w, e: _add_fade_out_pressed(), None) widgets.fade_in_spin = Gtk.SpinButton.new_with_range(0, 150, 1) widgets.fade_in_spin.set_value(10) widgets.fade_out_spin = Gtk.SpinButton.new_with_range(0, 150, 1) widgets.fade_out_spin.set_value(10) fades_row = Gtk.HBox() fades_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) fades_row.pack_start(fade_in_b, False, False, 0) fades_row.pack_start(widgets.fade_in_spin, False, False, 0) fades_row.pack_start(fade_out_b, False, False, 0) fades_row.pack_start(widgets.fade_out_spin, False, False, 0) fades_row.pack_start(Gtk.Label(), True, True, 0) if _compositor_uses_fade_buttons(compositor) == True: vbox.pack_start(fades_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Transition editors t_editable_properties = propertyedit.get_transition_editable_properties( compositor) for ep in t_editable_properties: editor_row = propertyeditorbuilder.get_editor_row(ep) if editor_row != None: # Some properties don't have editors vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Add keyframe editor widget to be updated for frame changes if such is created. try: editor_type = ep.args[propertyeditorbuilder.EDITOR] except KeyError: editor_type = propertyeditorbuilder.SLIDER # this is the default value if ((editor_type == propertyeditorbuilder.KEYFRAME_EDITOR) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_RELEASE) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_CLIP) or (editor_type == propertyeditorbuilder.FADE_LENGTH) or (editor_type == propertyeditorbuilder.GEOMETRY_EDITOR)): keyframe_editor_widgets.append(editor_row) # Extra editors. Editable properties have already been created with "editor=no_editor" # and will be looked up by editors from clip editor_rows = propertyeditorbuilder.get_transition_extra_editor_rows( compositor, t_editable_properties) for editor_row in editor_rows: # These are added to keyframe editor based on editor type, not based on EditableProperty type as above # because one editor sets values for multiple EditableProperty objects if editor_row.__class__ == keyframeeditor.RotatingGeometryEditor: keyframe_editor_widgets.append(editor_row) vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window)
def _display_compositor_edit_box(): # This gets called on startup before edit_frame is filled try: widgets.value_edit_frame.remove(widgets.value_edit_box) except: pass global keyframe_editor_widgets keyframe_editor_widgets = [] vbox = Gtk.VBox() # case: Empty edit frame global compositor if compositor == None: widgets.empty_label = Gtk.Label(label=_("No Compositor")) vbox.pack_start(widgets.empty_label, True, True, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() widgets.value_edit_box = vbox widgets.value_edit_frame.add(vbox) return compositor_name_label = Gtk.Label(label="<b>" + compositor.name + "</b>") compositor_name_label.set_use_markup(True) vbox.pack_start(compositor_name_label, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Track editor target_combo = guicomponents.get_compositor_track_select_combo( current_sequence().tracks[compositor.transition.b_track], current_sequence().tracks[compositor.transition.a_track], _target_track_changed) target_row = Gtk.HBox() target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(Gtk.Label(label=_("Destination Track:")), False, False, 0) target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(target_combo, False, False, 0) target_row.pack_start(Gtk.Label(), True, True, 0) vbox.pack_start(target_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Transition editors t_editable_properties = propertyedit.get_transition_editable_properties( compositor) for ep in t_editable_properties: editor_row = propertyeditorbuilder.get_editor_row(ep) if editor_row != None: # Some properties don't have editors vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Add keyframe editor widget to be updated for frame changes if such is created. try: editor_type = ep.args[propertyeditorbuilder.EDITOR] except KeyError: editor_type = propertyeditorbuilder.SLIDER # this is the default value if ((editor_type == propertyeditorbuilder.KEYFRAME_EDITOR) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_RELEASE) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_CLIP) or (editor_type == propertyeditorbuilder.GEOMETRY_EDITOR)): keyframe_editor_widgets.append(editor_row) # Extra editors. Editable properties have already been created with "editor=no_editor" # and will be looked up by editors from clip editor_rows = propertyeditorbuilder.get_transition_extra_editor_rows( compositor, t_editable_properties) for editor_row in editor_rows: vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window)
def _display_compositor_edit_box(): # This gets called on startup before edit_frame is filled try: widgets.value_edit_frame.remove(widgets.value_edit_box) except: pass global keyframe_editor_widgets keyframe_editor_widgets = [] vbox = Gtk.VBox() # case: Empty edit frame global compositor if compositor == None: widgets.empty_label = Gtk.Label(label=_("No Compositor")) vbox.pack_start(widgets.empty_label, True, True, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() widgets.value_edit_box = vbox widgets.value_edit_frame.add(vbox) return compositor_name_label = Gtk.Label(label= "<b>" + compositor.name + "</b>") compositor_name_label.set_use_markup(True) vbox.pack_start(compositor_name_label, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Track editor target_combo = guicomponents.get_compositor_track_select_combo( current_sequence().tracks[compositor.transition.b_track], current_sequence().tracks[compositor.transition.a_track], _target_track_changed) target_row = Gtk.HBox() target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(Gtk.Label(label=_("Destination Track:")), False, False, 0) target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(target_combo, False, False, 0) target_row.pack_start(Gtk.Label(), True, True, 0) vbox.pack_start(target_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Transition editors t_editable_properties = propertyedit.get_transition_editable_properties(compositor) for ep in t_editable_properties: editor_row = propertyeditorbuilder.get_editor_row(ep) if editor_row != None: # Some properties don't have editors vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Add keyframe editor widget to be updated for frame changes if such is created. try: editor_type = ep.args[propertyeditorbuilder.EDITOR] except KeyError: editor_type = propertyeditorbuilder.SLIDER # this is the default value if ((editor_type == propertyeditorbuilder.KEYFRAME_EDITOR) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_RELEASE) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_CLIP) or (editor_type == propertyeditorbuilder.GEOMETRY_EDITOR)): keyframe_editor_widgets.append(editor_row) # Extra editors. Editable properties have already been created with "editor=no_editor" # and will be looked up by editors from clip editor_rows = propertyeditorbuilder.get_transition_extra_editor_rows(compositor, t_editable_properties) for editor_row in editor_rows: vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window)
def _display_compositor_edit_box(): # This gets called on startup before edit_frame is filled try: widgets.value_edit_frame.remove(widgets.value_edit_box) except: pass global keyframe_editor_widgets keyframe_editor_widgets = [] vbox = Gtk.VBox() # Case: Empty edit frame global compositor if compositor == None: filler = Gtk.EventBox() filler.add(Gtk.Label()) vbox.pack_start(filler, True, True, 0) if current_sequence().compositing_mode != appconsts.COMPOSITING_MODE_STANDARD_FULL_TRACK: info = Gtk.Label(label=_("No Compositor")) info.set_sensitive(False) else: info = Gtk.Label(label=_("This panel not used in\n Compositing Mode Standard Full Track.")) info.set_justify(Gtk.Justification.CENTER) info.set_sensitive(False) filler = Gtk.EventBox() filler.add(info) vbox.pack_start(filler, False, False, 0) filler = Gtk.EventBox() filler.add(Gtk.Label()) vbox.pack_start(filler, True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window) return # Case: Filled frame compositor_name_label = Gtk.Label(label= "<b>" + compositor.name + "</b>") compositor_name_label.set_use_markup(True) vbox.pack_start(compositor_name_label, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Track editor if editorstate.get_compositing_mode() != appconsts.COMPOSITING_MODE_STANDARD_AUTO_FOLLOW: target_combo = guicomponents.get_compositor_track_select_combo( current_sequence().tracks[compositor.transition.b_track], current_sequence().tracks[compositor.transition.a_track], _target_track_changed) target_row = Gtk.HBox() target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(Gtk.Label(label=_("Destination Track:")), False, False, 0) target_row.pack_start(guiutils.get_pad_label(5, 3), False, False, 0) target_row.pack_start(target_combo, False, False, 0) target_row.pack_start(Gtk.Label(), True, True, 0) vbox.pack_start(target_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Transition editors t_editable_properties = propertyedit.get_transition_editable_properties(compositor) for ep in t_editable_properties: editor_row = propertyeditorbuilder.get_editor_row(ep) if editor_row != None: # Some properties don't have editors vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) # Add keyframe editor widget to be updated for frame changes if such is created. try: editor_type = ep.args[propertyeditorbuilder.EDITOR] except KeyError: editor_type = propertyeditorbuilder.SLIDER # this is the default value if ((editor_type == propertyeditorbuilder.KEYFRAME_EDITOR) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_RELEASE) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_CLIP) or (editor_type == propertyeditorbuilder.KEYFRAME_EDITOR_CLIP_FADE) or (editor_type == propertyeditorbuilder.FADE_LENGTH) or (editor_type == propertyeditorbuilder.GEOMETRY_EDITOR)): keyframe_editor_widgets.append(editor_row) # Extra editors. Editable properties have already been created with "editor=no_editor" # and will be looked up by editors from clip editor_rows = propertyeditorbuilder.get_transition_extra_editor_rows(compositor, t_editable_properties) for editor_row in editor_rows: # These are added to keyframe editors list based on editor type, not based on EditableProperty type as above # because one editor sets values for multiple EditableProperty objects if editor_row.__class__ == keyframeeditor.RotatingGeometryEditor: keyframe_editor_widgets.append(editor_row) vbox.pack_start(editor_row, False, False, 0) vbox.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(vbox) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() widgets.value_edit_box = scroll_window widgets.value_edit_frame.add(scroll_window)