예제 #1
0
    def __init__(self):
        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e: _shutdown())

        app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladetoolicon.png")
        self.set_icon(app_icon)

        # Script area
        self.program_label = Gtk.Label()
        self.program_event_box = Gtk.EventBox()
        self.program_event_box.add(self.program_label)
        self.program_event_box.connect("button-press-event", programs_menu_lauched)

        self.programs_menu = toolguicomponents.PressLaunch(programs_menu_lauched)

        programs_row = Gtk.HBox()
        programs_row.pack_start(self.programs_menu.widget, False, False, 0)
        programs_row.pack_start(self.program_event_box, False, False, 0)
        programs_row.pack_start(Gtk.Label(), True, True, 0)

        self.editors_box = Gtk.VBox(False, 2)
        self.editors_box.pack_start(Gtk.Label(), False, False, 0)
        self.editors_container = Gtk.VBox(False, 2)
        self.editors_container.pack_start(self.editors_box, False, False, 0)

        self.close_button = guiutils.get_sized_button(_("Close"), 150, 32)
        self.close_button.connect("clicked", lambda w: _shutdown())

        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(self.close_button, False, False, 0)

        # Build window
        pane = Gtk.VBox(False, 2)
        pane.pack_start(programs_row, False, False, 0)
        pane.pack_start(self.editors_container, False, False, 0)
        pane.pack_start(editor_buttons_row, False, False, 0)

        align = guiutils.set_margins(pane, 12, 12, 12, 12)

        # Set pane and show window
        self.add(align)
        self.set_title(_("Node Compositor Programs"))
        self.set_position(Gtk.WindowPosition.CENTER)
        self.show_all()
예제 #2
0
    def __init__(self):
        GObject.GObject.__init__(self)
        self.set_title(_("Titler"))
        self.connect("delete-event", lambda w, e:close_titler())
        
        if editorstate.screen_size_small_height() == True:
            global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT
            TEXT_LAYER_LIST_HEIGHT = 150
            TEXT_VIEW_HEIGHT = 180
            VIEW_EDITOR_HEIGHT = 450

        if editorstate.screen_size_small_height() == True:
            global VIEW_EDITOR_WIDTH
            VIEW_EDITOR_WIDTH = 680
            
        self.block_updates = False
        
        self.view_editor = vieweditor.ViewEditor(PLAYER().profile, VIEW_EDITOR_WIDTH, VIEW_EDITOR_HEIGHT)
        self.view_editor.active_layer_changed_listener = self.active_layer_changed
        
        self.guides_toggle = vieweditor.GuidesViewToggle(self.view_editor)
        
        add_b = Gtk.Button(_("Add"))
        del_b = Gtk.Button(_("Delete"))
        add_b.connect("clicked", lambda w:self._add_layer_pressed())
        del_b.connect("clicked", lambda w:self._del_layer_pressed())
        add_del_box = Gtk.HBox()
        add_del_box = Gtk.HBox(True,1)
        add_del_box.pack_start(add_b, True, True, 0)
        add_del_box.pack_start(del_b, True, True, 0)

        center_h_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "center_horizontal.png")
        center_v_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "center_vertical.png")
        center_h = Gtk.Button()
        center_h.set_image(center_h_icon)
        center_h.connect("clicked", lambda w:self._center_h_pressed())
        center_v = Gtk.Button()
        center_v.set_image(center_v_icon)
        center_v.connect("clicked", lambda w:self._center_v_pressed())

        self.layer_list = TextLayerListView(self._layer_selection_changed, self._layer_visibility_toggled)
        self.layer_list.set_size_request(TEXT_LAYER_LIST_WIDTH, TEXT_LAYER_LIST_HEIGHT)
    
        self.text_view = Gtk.TextView()
        self.text_view.set_pixels_above_lines(2)
        self.text_view.set_left_margin(2)
        self.text_view.get_buffer().connect("changed", self._text_changed)

        self.sw = Gtk.ScrolledWindow()
        self.sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS)
        self.sw.add(self.text_view)
        self.sw.set_size_request(TEXT_VIEW_WIDTH, TEXT_VIEW_HEIGHT)

        scroll_frame = Gtk.Frame()
        scroll_frame.add(self.sw)
        
        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)
        
        self.pos_bar = positionbar.PositionBar()
        self.pos_bar.set_listener(self.position_listener)
        self.pos_bar.update_display_from_producer(PLAYER().producer)
        self.pos_bar.mouse_release_listener = self.pos_bar_mouse_released

        pos_bar_frame = Gtk.Frame()
        pos_bar_frame.add(self.pos_bar.widget)
        pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        pos_bar_frame.set_valign(Gtk.Align.CENTER)
                
        font_map = PangoCairo.font_map_get_default()
        unsorted_families = font_map.list_families()
        if len(unsorted_families) == 0:
            print "No font families found in system! Titler will not work."
        self.font_families = sorted(unsorted_families, key=lambda family: family.get_name())
        self.font_family_indexes_for_name = {}
        combo = Gtk.ComboBoxText()
        indx = 0
        for family in self.font_families:
            combo.append_text(family.get_name())
            self.font_family_indexes_for_name[family.get_name()] = indx
            indx += 1
        combo.set_active(0)
        self.font_select = combo
        self.font_select.connect("changed", self._edit_value_changed)
    
        adj = Gtk.Adjustment(float(DEFAULT_FONT_SIZE), float(1), float(300), float(1))
        self.size_spin = Gtk.SpinButton()
        self.size_spin.set_adjustment(adj)
        self.size_spin.connect("changed", self._edit_value_changed)
        self.size_spin.connect("key-press-event", self._key_pressed_on_widget)

        font_main_row = Gtk.HBox()
        font_main_row.pack_start(self.font_select, True, True, 0)
        font_main_row.pack_start(guiutils.pad_label(5, 5), False, False, 0)
        font_main_row.pack_start(self.size_spin, False, False, 0)

        self.bold_font = Gtk.ToggleButton()
        self.italic_font = Gtk.ToggleButton()
        bold_icon = Gtk.Image.new_from_stock(Gtk.STOCK_BOLD, 
                                       Gtk.IconSize.BUTTON)
        italic_icon = Gtk.Image.new_from_stock(Gtk.STOCK_ITALIC, 
                                       Gtk.IconSize.BUTTON)
        self.bold_font.set_image(bold_icon)
        self.italic_font.set_image(italic_icon)
        self.bold_font.connect("clicked", self._edit_value_changed)
        self.italic_font.connect("clicked", self._edit_value_changed)
        
        self.left_align = Gtk.RadioButton(None)
        self.center_align = Gtk.RadioButton.new_from_widget(self.left_align)
        self.right_align = Gtk.RadioButton.new_from_widget(self.left_align)
        left_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_LEFT, 
                                       Gtk.IconSize.BUTTON)
        center_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_CENTER, 
                                       Gtk.IconSize.BUTTON)
        right_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_RIGHT, 
                                       Gtk.IconSize.BUTTON)
        self.left_align.set_image(left_icon)
        self.center_align.set_image(center_icon)
        self.right_align.set_image(right_icon)
        self.left_align.set_mode(False)
        self.center_align.set_mode(False)
        self.right_align.set_mode(False)
        self.left_align.connect("clicked", self._edit_value_changed)
        self.center_align.connect("clicked", self._edit_value_changed)
        self.right_align.connect("clicked", self._edit_value_changed)
        
        self.color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(red=1.0, green=1.0, blue=1.0, alpha=1.0))
        self.color_button.connect("color-set", self._edit_value_changed)

        buttons_box = Gtk.HBox()
        buttons_box.pack_start(Gtk.Label(), True, True, 0)
        buttons_box.pack_start(self.bold_font, False, False, 0)
        buttons_box.pack_start(self.italic_font, False, False, 0)
        buttons_box.pack_start(guiutils.pad_label(5, 5), False, False, 0)
        buttons_box.pack_start(self.left_align, False, False, 0)
        buttons_box.pack_start(self.center_align, False, False, 0)
        buttons_box.pack_start(self.right_align, False, False, 0)
        buttons_box.pack_start(guiutils.pad_label(5, 5), False, False, 0)
        buttons_box.pack_start(self.color_button, False, False, 0)
        buttons_box.pack_start(Gtk.Label(), True, True, 0)

        load_layers = Gtk.Button(_("Load Layers"))
        load_layers.connect("clicked", lambda w:self._load_layers_pressed())
        save_layers = Gtk.Button(_("Save Layers"))
        save_layers.connect("clicked", lambda w:self._save_layers_pressed())
        clear_layers = Gtk.Button(_("Clear All"))
        clear_layers.connect("clicked", lambda w:self._clear_layers_pressed())

        layers_save_buttons_row = Gtk.HBox()
        layers_save_buttons_row.pack_start(save_layers, False, False, 0)
        layers_save_buttons_row.pack_start(load_layers, False, False, 0)
        layers_save_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        
        adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1))
        self.x_pos_spin = Gtk.SpinButton()
        self.x_pos_spin.set_adjustment(adj)
        self.x_pos_spin.connect("changed", self._position_value_changed)
        self.x_pos_spin.connect("key-press-event", self._key_pressed_on_widget)
        adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1))
        self.y_pos_spin = Gtk.SpinButton()
        self.y_pos_spin.set_adjustment(adj)
        self.y_pos_spin.connect("changed", self._position_value_changed)
        self.y_pos_spin.connect("key-press-event", self._key_pressed_on_widget)
        adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1))
        self.rotation_spin = Gtk.SpinButton()
        self.rotation_spin.set_adjustment(adj)
        self.rotation_spin.connect("changed", self._position_value_changed)
        self.rotation_spin.connect("key-press-event", self._key_pressed_on_widget)
        
        undo_pos = Gtk.Button()
        undo_icon = Gtk.Image.new_from_stock(Gtk.STOCK_UNDO, 
                                       Gtk.IconSize.BUTTON)
        undo_pos.set_image(undo_icon)

        next_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "next_frame_s.png")
        prev_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "prev_frame_s.png")
        prev_frame = Gtk.Button()
        prev_frame.set_image(prev_icon)
        prev_frame.connect("clicked", lambda w:self._prev_frame_pressed())
        next_frame = Gtk.Button()
        next_frame.set_image(next_icon)
        next_frame.connect("clicked", lambda w:self._next_frame_pressed())

        self.scale_selector = vieweditor.ScaleSelector(self)

        timeline_box = Gtk.HBox()
        timeline_box.pack_start(self.tc_display.widget, False, False, 0)
        timeline_box.pack_start(guiutils.pad_label(12, 12), False, False, 0)
        timeline_box.pack_start(pos_bar_frame, True, True, 0)
        timeline_box.pack_start(guiutils.pad_label(12, 12), False, False, 0)
        timeline_box.pack_start(prev_frame, False, False, 0)
        timeline_box.pack_start(next_frame, False, False, 0)
        timeline_box.pack_start(self.guides_toggle, False, False, 0)
        timeline_box.pack_start(self.scale_selector, False, False, 0)
        timeline_box.set_margin_top(6)
        timeline_box.set_margin_bottom(6)
        
        positions_box = Gtk.HBox()
        positions_box.pack_start(Gtk.Label(), True, True, 0)
        positions_box.pack_start(Gtk.Label(label="X:"), False, False, 0)
        positions_box.pack_start(self.x_pos_spin, False, False, 0)
        positions_box.pack_start(guiutils.pad_label(40, 5), False, False, 0)
        positions_box.pack_start(Gtk.Label(label="Y:"), False, False, 0)
        positions_box.pack_start(self.y_pos_spin, False, False, 0)
        #positions_box.pack_start(Gtk.Label(label=_("Angle")), False, False, 0)
        #positions_box.pack_start(self.rotation_spin, False, False, 0)
        positions_box.pack_start(guiutils.pad_label(40, 5), False, False, 0)
        positions_box.pack_start(center_h, False, False, 0)
        positions_box.pack_start(center_v, False, False, 0)
        positions_box.pack_start(Gtk.Label(), True, True, 0)

        controls_panel_1 = Gtk.VBox()
        controls_panel_1.pack_start(add_del_box, False, False, 0)
        controls_panel_1.pack_start(self.layer_list, False, False, 0)
        controls_panel_1.pack_start(layers_save_buttons_row, False, False, 0)

        controls_panel_2 = Gtk.VBox()
        controls_panel_2.pack_start(scroll_frame, True, True, 0)
        controls_panel_2.pack_start(font_main_row, False, False, 0)
        controls_panel_2.pack_start(buttons_box, False, False, 0)
        
        controls_panel = Gtk.VBox()
        controls_panel.pack_start(guiutils.get_named_frame(_("Active Layer"),controls_panel_2), True, True, 0)
        controls_panel.pack_start(guiutils.get_named_frame(_("Layers"),controls_panel_1), False, False, 0)
 
        view_editor_editor_buttons_row = Gtk.HBox()
        view_editor_editor_buttons_row.pack_start(positions_box, False, False, 0)
        view_editor_editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)

        keep_label = Gtk.Label(label=_("Keep Layers When Closed"))
        self.keep_layers_check = Gtk.CheckButton()
        self.keep_layers_check.set_active(_keep_titler_data)
        self.keep_layers_check.connect("toggled", self._keep_layers_toggled)
        
        open_label = Gtk.Label(label=_("Open Saved Title In Bin"))
        self.open_in_current_check = Gtk.CheckButton()
        self.open_in_current_check.set_active(_open_saved_in_bin)
        self.open_in_current_check.connect("toggled", self._open_saved_in_bin)

        exit_b = guiutils.get_sized_button(_("Close"), 150, 32)
        exit_b.connect("clicked", lambda w:close_titler())
        save_titles_b = guiutils.get_sized_button(_("Save Title Graphic"), 150, 32)
        save_titles_b.connect("clicked", lambda w:self._save_title_pressed())
        
        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(keep_label, False, False, 0)
        editor_buttons_row.pack_start(self.keep_layers_check, False, False, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False, 0)
        editor_buttons_row.pack_start(open_label, False, False, 0)
        editor_buttons_row.pack_start(self.open_in_current_check, False, False, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False, 0)
        editor_buttons_row.pack_start(exit_b, False, False, 0)
        editor_buttons_row.pack_start(save_titles_b, False, False, 0)
        
        editor_panel = Gtk.VBox()
        editor_panel.pack_start(self.view_editor, True, True, 0)
        editor_panel.pack_start(timeline_box, False, False, 0)
        editor_panel.pack_start(guiutils.get_in_centering_alignment(view_editor_editor_buttons_row), False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 24), True, True, 0)
        editor_panel.pack_start(editor_buttons_row, False, False, 0)

        editor_row = Gtk.HBox()
        editor_row.pack_start(controls_panel, False, False, 0)
        editor_row.pack_start(editor_panel, True, True, 0)

        alignment = guiutils.set_margins(editor_row, 8,8,8,8)

        self.add(alignment)

        self.layer_list.fill_data_model()
        self._update_gui_with_active_layer_data()
        self.show_all()

        self.connect("size-allocate", lambda w, e:self.window_resized())
        self.connect("window-state-event", lambda w, e:self.window_resized())
예제 #3
0
    def __init__(self, kf_editor, property_editor_widgets_create_func,
                 value_labels
                 ):  # kf_editor is keyframeeditor.RotoMaskKeyFrameEditor
        GObject.GObject.__init__(self)
        self.set_modal(True)
        self.set_transient_for(gui.editor_window.window)
        self.set_title(_("RotoMaskEditor"))
        self.connect("delete-event", lambda w, e: close_rotomask())

        if editorstate.screen_size_small_height() == True:
            global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT
            TEXT_LAYER_LIST_HEIGHT = 150
            TEXT_VIEW_HEIGHT = 180
            VIEW_EDITOR_HEIGHT = 450

        if editorstate.screen_size_small_height() == True:
            global VIEW_EDITOR_WIDTH
            VIEW_EDITOR_WIDTH = 680

        editor_widgets = property_editor_widgets_create_func()

        self.block_updates = False
        self.mask_create_freeze = False  # We are not allowing user to change acrive kf when creating mask

        self.kf_editor = kf_editor
        self.kf_editor.set_parent_editor(self)

        # mask type param was added later, we need handle it not existing.
        if self.get_mask_type() == -1:
            self.set_mask_type(vieweditorshape.LINE_MASK)
            self.set_mask_type_on_init = False  # but we don't want to destroy user's curve masks. THis is not complety back wards compatible stuff can get destroyed on second load.
        else:
            self.set_mask_type_on_init = True

        self.value_labels = value_labels

        self.view_editor = vieweditor.ViewEditor(PLAYER().profile,
                                                 VIEW_EDITOR_WIDTH,
                                                 VIEW_EDITOR_HEIGHT)
        self.view_editor.draw_safe_area = False

        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)

        kf_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                              "roto_kf_edit_mode.png")
        move_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                                "roto_move_mode.png")
        self.kf_mode_button = Gtk.ToggleButton()
        self.kf_mode_button.set_image(kf_mode_img)
        self.kf_mode_button.set_active(
            True)  # we start with vieweditorlayer.ROTO_POINT_MODE edit mode
        self.kf_mode_button.connect("clicked", self._kf_mode_clicked)
        self.move_mode_button = Gtk.ToggleButton()
        self.move_mode_button.set_image(move_mode_img)
        self.move_mode_button.connect("clicked", self._move_mode_clicked)

        self.scale_selector = vieweditor.ScaleSelector(self)
        self.view_editor.scale_select = self.scale_selector

        timeline_box = Gtk.HBox()
        timeline_box.pack_start(self.tc_display.widget, False, False, 0)
        timeline_box.pack_start(Gtk.Label(), True, True, 0)
        timeline_box.pack_start(self.kf_mode_button, False, False, 0)
        timeline_box.pack_start(self.move_mode_button, False, False, 0)
        timeline_box.pack_start(Gtk.Label(), True, True, 0)
        timeline_box.pack_start(self.scale_selector, False, False, 0)
        timeline_box.set_margin_top(6)
        timeline_box.set_margin_bottom(6)

        mask_type_label = Gtk.Label(_("Mask Type:"))
        mask_type_combo_box = Gtk.ComboBoxText()
        mask_type_combo_box.append_text(_("Curve Mask"))
        mask_type_combo_box.append_text(_("Line Mask"))
        mask_type_combo_box.set_active(0)
        mask_type_combo_box.connect("changed",
                                    self.mask_type_selection_changed)
        self.mask_type_combo_box = mask_type_combo_box

        allow_adding_check = Gtk.CheckButton()
        allow_adding_check.set_active(
            False
        )  # This shows value of self.roto_mask_layer.allow_adding_points, False is default
        allow_adding_check.connect("toggled", self.allow_adding_toggled)
        allow_adding_label = Gtk.Label(
            _("Allow to add / delete points in closed masks"))

        save_rotodata_b = guiutils.get_sized_button(_("Close Tool"), 150, 32)
        save_rotodata_b.connect("clicked",
                                lambda w: self._save_rotodata_pressed())

        prop_editor_row1 = Gtk.HBox()
        prop_editor_row1.pack_start(Gtk.Label(), True, True, 0)
        prop_editor_row1.pack_start(mask_type_label, False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(4, 4), False, False, 0)
        prop_editor_row1.pack_start(mask_type_combo_box, False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row1.pack_start(editor_widgets[0], False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row1.pack_start(editor_widgets[3], False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row1.pack_start(editor_widgets[4], False, False, 0)
        prop_editor_row1.pack_start(Gtk.Label(), True, True, 0)

        prop_editor_row2 = Gtk.HBox()
        prop_editor_row2.pack_start(Gtk.Label(), True, True, 0)
        prop_editor_row2.pack_start(editor_widgets[1], False, False, 0)
        prop_editor_row2.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row2.pack_start(editor_widgets[2], False, False, 0)
        prop_editor_row2.pack_start(Gtk.Label(), True, True, 0)

        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(allow_adding_check, False, False, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(4, 2), False, False,
                                      0)
        editor_buttons_row.pack_start(allow_adding_label, False, False, 0)
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(save_rotodata_b, False, False, 0)

        editor_panel = Gtk.VBox()
        editor_panel.pack_start(self.view_editor, True, True, 0)
        editor_panel.pack_start(timeline_box, False, False, 0)
        editor_panel.pack_start(kf_editor, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(prop_editor_row1, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(prop_editor_row2, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(editor_buttons_row, False, False, 0)

        editor_row = Gtk.HBox()
        editor_row.pack_start(editor_panel, True, True, 0)

        alignment = guiutils.set_margins(editor_row, 8, 8, 8, 8)

        self.add(alignment)

        self.view_editor.clear_layers()
        # NOTE: we start with vieweditorlayer.ROTO_POINT_MODE edit mode, see __init()__
        self.roto_mask_layer = vieweditorlayer.RotoMaskEditLayer(
            self.view_editor, self.kf_editor.clip_editor,
            kf_editor.editable_property, self)
        self.view_editor.add_layer(self.roto_mask_layer)
        self.view_editor.activate_layer(0)

        self.show_all()

        self.kf_editor.active_keyframe_changed()

        self.connect("size-allocate", lambda w, e: self.window_resized())
        self.connect("window-state-event", lambda w, e: self.window_resized())
        self.connect("key-press-event", self.key_down)
        self.window_resized()

        self.kf_editor.clip_editor.maybe_set_first_kf_in_clip_area_active()

        self.update_mask_create_freeze_gui()
예제 #4
0
    def __init__(self):
        GObject.GObject.__init__(self)
        #self.connect("delete-event", lambda w, e:_shutdown())

        app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH +
                                                  "flowbladetoolicon.png")
        self.set_icon(app_icon)

        # Animation selector menu launcher row
        self.animation_label = Gtk.Label(_animation_instance.info.name)
        self.present_event_box = Gtk.EventBox()
        self.present_event_box.add(self.animation_label)
        self.present_event_box.connect("button-press-event",
                                       animations_menu_launched)
        self.script_menu = toolguicomponents.PressLaunch(
            animations_menu_launched)

        selector_row = Gtk.HBox(False, 2)
        selector_row.pack_start(self.present_event_box, False, False, 0)
        selector_row.pack_start(self.script_menu.widget, False, False, 0)

        # Edit area
        self.value_edit_frame = Gtk.Frame()
        self.value_edit_frame.set_shadow_type(Gtk.ShadowType.IN)
        self.value_edit_frame.set_size_request(EDIT_PANEL_WIDTH + 10,
                                               EDIT_PANEL_HEIGHT + 10)
        self.value_edit_box = None

        # Monitor
        self.preview_monitor = cairoarea.CairoDrawableArea2(
            MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview)

        # Render panel
        self.out_folder = Gtk.FileChooserButton(_("Select Folder"))
        self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
        self.out_folder.connect("selection-changed",
                                self.folder_selection_changed)
        self.out_label = Gtk.Label(label=_("Frames Folder:"))

        self.frame_name = Gtk.Entry()
        self.frame_name.set_text("frame")
        self.extension_label = Gtk.Label()
        self.extension_label.set_markup("<small>XXXX.png</small>")

        out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \
                            self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \
                            guiutils.pad_label(2, 2), self.extension_label])

        self.encode_check_label = Gtk.Label(_("Encode Video"))
        self.encode_check = Gtk.CheckButton()
        self.encode_check.set_active(False)
        self.encode_check.connect("toggled",
                                  lambda w: self.update_encode_sensitive())

        self.encode_settings_button = Gtk.Button(_("Encoding settings"))
        self.encode_settings_button.connect(
            "clicked", lambda w: _encode_settings_clicked())
        self.encode_desc = Gtk.Label()
        self.encode_desc.set_markup("<small>" + _("not set") + "</small>")
        self.encode_desc.set_ellipsize(Pango.EllipsizeMode.END)
        self.encode_desc.set_max_width_chars(32)

        encode_row = Gtk.HBox(False, 2)
        encode_row.pack_start(self.encode_check, False, False, 0)
        encode_row.pack_start(self.encode_check_label, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0)
        encode_row.pack_start(self.encode_settings_button, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0)
        encode_row.pack_start(self.encode_desc, False, False, 0)
        encode_row.pack_start(Gtk.Label(), True, True, 0)
        encode_row.set_margin_bottom(6)

        self.render_percentage = Gtk.Label("")

        self.status_no_render = _("Set Frames Folder for valid render")

        self.render_status_info = Gtk.Label()
        self.render_status_info.set_markup("<small>" + self.status_no_render +
                                           "</small>")

        render_status_row = Gtk.HBox(False, 2)
        render_status_row.pack_start(self.render_percentage, False, False, 0)
        render_status_row.pack_start(Gtk.Label(), True, True, 0)
        render_status_row.pack_start(self.render_status_info, False, False, 0)

        render_status_row.set_margin_bottom(6)

        self.render_progress_bar = Gtk.ProgressBar()
        self.render_progress_bar.set_valign(Gtk.Align.CENTER)

        self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32)
        self.stop_button.connect("clicked", lambda w: abort_render())
        self.render_button = guiutils.get_sized_button(_("Render"), 100, 32)
        self.render_button.connect("clicked", lambda w: render_output())

        render_row = Gtk.HBox(False, 2)
        render_row.pack_start(self.render_progress_bar, True, True, 0)
        render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        render_row.pack_start(self.stop_button, False, False, 0)
        render_row.pack_start(self.render_button, False, False, 0)

        render_vbox = Gtk.VBox(False, 2)
        render_vbox.pack_start(encode_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(out_folder_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(render_status_row, False, False, 0)
        render_vbox.pack_start(render_row, False, False, 0)
        render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0)

        # Build window
        left_panel = Gtk.VBox(False, 2)
        left_panel.pack_start(selector_row, False, False, 0)
        left_panel.pack_start(self.value_edit_frame, True, True, 0)

        right_panel = Gtk.VBox(False, 2)
        right_panel.pack_start(self.preview_monitor, False, False, 0)
        right_panel.pack_start(render_vbox, True, True, 0)
        #right_panel.pack_start(self.edit_panel, False, False, 0)

        pane = Gtk.HBox(False, 2)
        pane.pack_start(left_panel, False, False, 0)
        pane.pack_start(right_panel, False, False, 0)

        align = guiutils.set_margins(pane, 12, 12, 12, 12)

        # Connect global key listener
        #self.connect("key-press-event", _global_key_down_listener)

        # Set pane and show window
        self.add(align)
        self.set_title(_("Natron Animations"))
        self.set_position(Gtk.WindowPosition.CENTER)
        #self.set_widgets_sensitive(False)
        self.show_all()
        self.set_resizable(False)
        #self.set_active_state(False)

        self.update_render_status_info()
        self.change_animation()
예제 #5
0
    def __init__(self, args_panel):
        GObject.GObject.__init__(self)
        #self.connect("delete-event", lambda w, e:close_audio_monitor())
        
        self.args_panel = args_panel

        self.opts_view = Gtk.TextView()
        self.opts_view.set_sensitive(True)
        self.opts_view.set_pixels_above_lines(2)
        self.opts_view.set_left_margin(2)
        self.opts_view.set_buffer(self.args_panel.text_buffer)

        sw = Gtk.ScrolledWindow()
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        sw.add(self.opts_view)
        sw.set_size_request(*FFMPEG_VIEW_SIZE)

        scroll_frame = Gtk.Frame()
        scroll_frame.add(sw)
        scroll_frame.set_size_request(400, 300)

        self.load_selection_button = Gtk.Button(_("Load Selection"))
        self.load_selection_button.connect("clicked", lambda w: self.args_panel.display_selection_callback())

        self.ext_label = Gtk.Label(label=_("Ext.:"))
        self.ext_label.set_sensitive(False)

        self.ext_entry = Gtk.Entry()
        self.ext_entry.set_width_chars(5)
        self.ext_entry.set_text(self.args_panel.ext)   
        
        self.load_selection_button.set_tooltip_text(_("Load render options from currently selected encoding"))
        self.opts_view.set_tooltip_text(_("Edit render options"))
        
        opts_buttons_row = Gtk.HBox(False)
        opts_buttons_row.pack_start(self.load_selection_button, False, False, 0)
        opts_buttons_row.pack_start(guiutils.get_pad_label(4, 2), False, False, 0)
        opts_buttons_row.pack_start(self.ext_label, False, False, 0)
        opts_buttons_row.pack_start(guiutils.get_pad_label(4, 2), False, False, 0)
        opts_buttons_row.pack_start(self.ext_entry, False, False, 0)

        cancel_b = guiutils.get_sized_button(_("Cancel"), 150, 32)
        cancel_b.connect("clicked", lambda w: self.args_panel.cancel_args_edit())
        set_args_b = guiutils.get_sized_button(_("Set Args"), 150, 32)
        set_args_b.connect("clicked", lambda w:self.args_panel.do_args_edit())
        
        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(cancel_b, False, False, 0)
        editor_buttons_row.pack_start(set_args_b, False, False, 0)
        
        pane = Gtk.VBox(False, 1)
        pane.pack_start(scroll_frame, True, True, 0)
        pane.pack_start(opts_buttons_row, False, True, 0)
        pane.pack_start(guiutils.get_pad_label(4, 12), False, True, 0)
        pane.pack_start(editor_buttons_row, False, True, 0)

        align = guiutils.set_margins(pane, 12, 12, 12, 12)
        # Set pane and show window
        self.add(align)
        self.set_title(_("Render Args"))
        self.show_all()
        self.set_resizable(False)
        self.set_keep_above(True) # Perhaps configurable later
예제 #6
0
파일: titler.py 프로젝트: raj347/flowblade
    def __init__(self):
        GObject.GObject.__init__(self)
        self.set_title(_("Titler"))
        self.connect("delete-event", lambda w, e: close_titler())

        if editorstate.screen_size_small_height() == True:
            global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT
            TEXT_LAYER_LIST_HEIGHT = 150
            TEXT_VIEW_HEIGHT = 180
            VIEW_EDITOR_HEIGHT = 450

        if editorstate.screen_size_small_height() == True:
            global VIEW_EDITOR_WIDTH
            VIEW_EDITOR_WIDTH = 680

        self.block_updates = False

        self.view_editor = vieweditor.ViewEditor(PLAYER().profile,
                                                 VIEW_EDITOR_WIDTH,
                                                 VIEW_EDITOR_HEIGHT)
        self.view_editor.active_layer_changed_listener = self.active_layer_changed

        self.guides_toggle = vieweditor.GuidesViewToggle(self.view_editor)

        add_b = Gtk.Button(_("Add"))
        del_b = Gtk.Button(_("Delete"))
        add_b.connect("clicked", lambda w: self._add_layer_pressed())
        del_b.connect("clicked", lambda w: self._del_layer_pressed())
        add_del_box = Gtk.HBox()
        add_del_box = Gtk.HBox(True, 1)
        add_del_box.pack_start(add_b, True, True, 0)
        add_del_box.pack_start(del_b, True, True, 0)

        center_h_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                                "center_horizontal.png")
        center_v_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                                "center_vertical.png")
        center_h = Gtk.Button()
        center_h.set_image(center_h_icon)
        center_h.connect("clicked", lambda w: self._center_h_pressed())
        center_v = Gtk.Button()
        center_v.set_image(center_v_icon)
        center_v.connect("clicked", lambda w: self._center_v_pressed())

        self.layer_list = TextLayerListView(self._layer_selection_changed,
                                            self._layer_visibility_toggled)
        self.layer_list.set_size_request(TEXT_LAYER_LIST_WIDTH,
                                         TEXT_LAYER_LIST_HEIGHT)

        self.text_view = Gtk.TextView()
        self.text_view.set_pixels_above_lines(2)
        self.text_view.set_left_margin(2)
        self.text_view.get_buffer().connect("changed", self._text_changed)

        self.sw = Gtk.ScrolledWindow()
        self.sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS)
        self.sw.add(self.text_view)
        self.sw.set_size_request(TEXT_VIEW_WIDTH, TEXT_VIEW_HEIGHT)

        scroll_frame = Gtk.Frame()
        scroll_frame.add(self.sw)

        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)

        self.pos_bar = positionbar.PositionBar()
        self.pos_bar.set_listener(self.position_listener)
        self.pos_bar.update_display_from_producer(PLAYER().producer)
        self.pos_bar.mouse_release_listener = self.pos_bar_mouse_released

        pos_bar_frame = Gtk.Frame()
        pos_bar_frame.add(self.pos_bar.widget)
        pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        pos_bar_frame.set_valign(Gtk.Align.CENTER)

        font_map = PangoCairo.font_map_get_default()
        unsorted_families = font_map.list_families()
        if len(unsorted_families) == 0:
            print "No font families found in system! Titler will not work."
        self.font_families = sorted(unsorted_families,
                                    key=lambda family: family.get_name())
        self.font_family_indexes_for_name = {}
        combo = Gtk.ComboBoxText()
        indx = 0
        for family in self.font_families:
            combo.append_text(family.get_name())
            self.font_family_indexes_for_name[family.get_name()] = indx
            indx += 1
        combo.set_active(0)
        self.font_select = combo
        self.font_select.connect("changed", self._edit_value_changed)

        adj = Gtk.Adjustment(float(DEFAULT_FONT_SIZE), float(1), float(300),
                             float(1))
        self.size_spin = Gtk.SpinButton()
        self.size_spin.set_adjustment(adj)
        self.size_spin.connect("changed", self._edit_value_changed)
        self.size_spin.connect("key-press-event", self._key_pressed_on_widget)

        font_main_row = Gtk.HBox()
        font_main_row.pack_start(self.font_select, True, True, 0)
        font_main_row.pack_start(guiutils.pad_label(5, 5), False, False, 0)
        font_main_row.pack_start(self.size_spin, False, False, 0)

        self.bold_font = Gtk.ToggleButton()
        self.italic_font = Gtk.ToggleButton()
        bold_icon = Gtk.Image.new_from_stock(Gtk.STOCK_BOLD,
                                             Gtk.IconSize.BUTTON)
        italic_icon = Gtk.Image.new_from_stock(Gtk.STOCK_ITALIC,
                                               Gtk.IconSize.BUTTON)
        self.bold_font.set_image(bold_icon)
        self.italic_font.set_image(italic_icon)
        self.bold_font.connect("clicked", self._edit_value_changed)
        self.italic_font.connect("clicked", self._edit_value_changed)

        self.left_align = Gtk.RadioButton(None)
        self.center_align = Gtk.RadioButton.new_from_widget(self.left_align)
        self.right_align = Gtk.RadioButton.new_from_widget(self.left_align)
        left_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_LEFT,
                                             Gtk.IconSize.BUTTON)
        center_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_CENTER,
                                               Gtk.IconSize.BUTTON)
        right_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_RIGHT,
                                              Gtk.IconSize.BUTTON)
        self.left_align.set_image(left_icon)
        self.center_align.set_image(center_icon)
        self.right_align.set_image(right_icon)
        self.left_align.set_mode(False)
        self.center_align.set_mode(False)
        self.right_align.set_mode(False)
        self.left_align.connect("clicked", self._edit_value_changed)
        self.center_align.connect("clicked", self._edit_value_changed)
        self.right_align.connect("clicked", self._edit_value_changed)

        self.color_button = Gtk.ColorButton.new_with_rgba(
            Gdk.RGBA(red=1.0, green=1.0, blue=1.0, alpha=1.0))
        self.color_button.connect("color-set", self._edit_value_changed)

        buttons_box = Gtk.HBox()
        buttons_box.pack_start(Gtk.Label(), True, True, 0)
        buttons_box.pack_start(self.bold_font, False, False, 0)
        buttons_box.pack_start(self.italic_font, False, False, 0)
        buttons_box.pack_start(guiutils.pad_label(5, 5), False, False, 0)
        buttons_box.pack_start(self.left_align, False, False, 0)
        buttons_box.pack_start(self.center_align, False, False, 0)
        buttons_box.pack_start(self.right_align, False, False, 0)
        buttons_box.pack_start(guiutils.pad_label(5, 5), False, False, 0)
        buttons_box.pack_start(self.color_button, False, False, 0)
        buttons_box.pack_start(Gtk.Label(), True, True, 0)

        load_layers = Gtk.Button(_("Load Layers"))
        load_layers.connect("clicked", lambda w: self._load_layers_pressed())
        save_layers = Gtk.Button(_("Save Layers"))
        save_layers.connect("clicked", lambda w: self._save_layers_pressed())
        clear_layers = Gtk.Button(_("Clear All"))
        clear_layers.connect("clicked", lambda w: self._clear_layers_pressed())

        layers_save_buttons_row = Gtk.HBox()
        layers_save_buttons_row.pack_start(save_layers, False, False, 0)
        layers_save_buttons_row.pack_start(load_layers, False, False, 0)
        layers_save_buttons_row.pack_start(Gtk.Label(), True, True, 0)

        adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1))
        self.x_pos_spin = Gtk.SpinButton()
        self.x_pos_spin.set_adjustment(adj)
        self.x_pos_spin.connect("changed", self._position_value_changed)
        self.x_pos_spin.connect("key-press-event", self._key_pressed_on_widget)
        adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1))
        self.y_pos_spin = Gtk.SpinButton()
        self.y_pos_spin.set_adjustment(adj)
        self.y_pos_spin.connect("changed", self._position_value_changed)
        self.y_pos_spin.connect("key-press-event", self._key_pressed_on_widget)
        adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1))
        self.rotation_spin = Gtk.SpinButton()
        self.rotation_spin.set_adjustment(adj)
        self.rotation_spin.connect("changed", self._position_value_changed)
        self.rotation_spin.connect("key-press-event",
                                   self._key_pressed_on_widget)

        undo_pos = Gtk.Button()
        undo_icon = Gtk.Image.new_from_stock(Gtk.STOCK_UNDO,
                                             Gtk.IconSize.BUTTON)
        undo_pos.set_image(undo_icon)

        next_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                            "next_frame_s.png")
        prev_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                            "prev_frame_s.png")
        prev_frame = Gtk.Button()
        prev_frame.set_image(prev_icon)
        prev_frame.connect("clicked", lambda w: self._prev_frame_pressed())
        next_frame = Gtk.Button()
        next_frame.set_image(next_icon)
        next_frame.connect("clicked", lambda w: self._next_frame_pressed())

        self.scale_selector = vieweditor.ScaleSelector(self)

        timeline_box = Gtk.HBox()
        timeline_box.pack_start(self.tc_display.widget, False, False, 0)
        timeline_box.pack_start(guiutils.pad_label(12, 12), False, False, 0)
        timeline_box.pack_start(pos_bar_frame, True, True, 0)
        timeline_box.pack_start(guiutils.pad_label(12, 12), False, False, 0)
        timeline_box.pack_start(prev_frame, False, False, 0)
        timeline_box.pack_start(next_frame, False, False, 0)
        timeline_box.pack_start(self.guides_toggle, False, False, 0)
        timeline_box.pack_start(self.scale_selector, False, False, 0)
        timeline_box.set_margin_top(6)
        timeline_box.set_margin_bottom(6)

        positions_box = Gtk.HBox()
        positions_box.pack_start(Gtk.Label(), True, True, 0)
        positions_box.pack_start(Gtk.Label(label="X:"), False, False, 0)
        positions_box.pack_start(self.x_pos_spin, False, False, 0)
        positions_box.pack_start(guiutils.pad_label(40, 5), False, False, 0)
        positions_box.pack_start(Gtk.Label(label="Y:"), False, False, 0)
        positions_box.pack_start(self.y_pos_spin, False, False, 0)
        #positions_box.pack_start(Gtk.Label(label=_("Angle")), False, False, 0)
        #positions_box.pack_start(self.rotation_spin, False, False, 0)
        positions_box.pack_start(guiutils.pad_label(40, 5), False, False, 0)
        positions_box.pack_start(center_h, False, False, 0)
        positions_box.pack_start(center_v, False, False, 0)
        positions_box.pack_start(Gtk.Label(), True, True, 0)

        controls_panel_1 = Gtk.VBox()
        controls_panel_1.pack_start(add_del_box, False, False, 0)
        controls_panel_1.pack_start(self.layer_list, False, False, 0)
        controls_panel_1.pack_start(layers_save_buttons_row, False, False, 0)

        controls_panel_2 = Gtk.VBox()
        controls_panel_2.pack_start(scroll_frame, True, True, 0)
        controls_panel_2.pack_start(font_main_row, False, False, 0)
        controls_panel_2.pack_start(buttons_box, False, False, 0)

        controls_panel = Gtk.VBox()
        controls_panel.pack_start(
            guiutils.get_named_frame(_("Active Layer"), controls_panel_2),
            True, True, 0)
        controls_panel.pack_start(
            guiutils.get_named_frame(_("Layers"), controls_panel_1), False,
            False, 0)

        view_editor_editor_buttons_row = Gtk.HBox()
        view_editor_editor_buttons_row.pack_start(positions_box, False, False,
                                                  0)
        view_editor_editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)

        keep_label = Gtk.Label(label=_("Keep Layers When Closed"))
        self.keep_layers_check = Gtk.CheckButton()
        self.keep_layers_check.set_active(_keep_titler_data)
        self.keep_layers_check.connect("toggled", self._keep_layers_toggled)

        open_label = Gtk.Label(label=_("Open Saved Title In Bin"))
        self.open_in_current_check = Gtk.CheckButton()
        self.open_in_current_check.set_active(_open_saved_in_bin)
        self.open_in_current_check.connect("toggled", self._open_saved_in_bin)

        exit_b = guiutils.get_sized_button(_("Close"), 150, 32)
        exit_b.connect("clicked", lambda w: close_titler())
        save_titles_b = guiutils.get_sized_button(_("Save Title Graphic"), 150,
                                                  32)
        save_titles_b.connect("clicked", lambda w: self._save_title_pressed())

        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(keep_label, False, False, 0)
        editor_buttons_row.pack_start(self.keep_layers_check, False, False, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False,
                                      0)
        editor_buttons_row.pack_start(open_label, False, False, 0)
        editor_buttons_row.pack_start(self.open_in_current_check, False, False,
                                      0)
        editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False,
                                      0)
        editor_buttons_row.pack_start(exit_b, False, False, 0)
        editor_buttons_row.pack_start(save_titles_b, False, False, 0)

        editor_panel = Gtk.VBox()
        editor_panel.pack_start(self.view_editor, True, True, 0)
        editor_panel.pack_start(timeline_box, False, False, 0)
        editor_panel.pack_start(
            guiutils.get_in_centering_alignment(
                view_editor_editor_buttons_row), False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 24), True, True, 0)
        editor_panel.pack_start(editor_buttons_row, False, False, 0)

        editor_row = Gtk.HBox()
        editor_row.pack_start(controls_panel, False, False, 0)
        editor_row.pack_start(editor_panel, True, True, 0)

        alignment = guiutils.set_margins(editor_row, 8, 8, 8, 8)

        self.add(alignment)

        self.layer_list.fill_data_model()
        self._update_gui_with_active_layer_data()
        self.show_all()

        self.connect("size-allocate", lambda w, e: self.window_resized())
        self.connect("window-state-event", lambda w, e: self.window_resized())
예제 #7
0
    def __init__(self, kf_editor, editor_widgets, value_labels
                 ):  # kf_editor is keyframeeditor.RotoMaskKeyFrameEditor
        GObject.GObject.__init__(self)
        self.set_title(_("RotoMaskEditor"))
        self.connect("delete-event", lambda w, e: close_rotomask())

        if editorstate.screen_size_small_height() == True:
            global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT
            TEXT_LAYER_LIST_HEIGHT = 150
            TEXT_VIEW_HEIGHT = 180
            VIEW_EDITOR_HEIGHT = 450

        if editorstate.screen_size_small_height() == True:
            global VIEW_EDITOR_WIDTH
            VIEW_EDITOR_WIDTH = 680

        self.block_updates = False

        self.kf_editor = kf_editor
        self.kf_editor.set_parent_editor(self)

        self.value_labels = value_labels

        self.view_editor = vieweditor.ViewEditor(PLAYER().profile,
                                                 VIEW_EDITOR_WIDTH,
                                                 VIEW_EDITOR_HEIGHT)

        self.guides_toggle = vieweditor.GuidesViewToggle(self.view_editor)
        """
        add_b = Gtk.Button(_("Add"))
        del_b = Gtk.Button(_("Delete"))
        add_b.connect("clicked", lambda w:self._add_layer_pressed())
        del_b.connect("clicked", lambda w:self._del_layer_pressed())
        add_del_box = Gtk.HBox()
        add_del_box = Gtk.HBox(True,1)
        add_del_box.pack_start(add_b, True, True, 0)
        add_del_box.pack_start(del_b, True, True, 0)
        """

        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)

        kf_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                              "roto_kf_edit_mode.png")
        move_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH +
                                                "roto_move_mode.png")
        self.kf_mode_button = Gtk.ToggleButton()
        self.kf_mode_button.set_image(kf_mode_img)
        self.kf_mode_button.set_active(
            True)  # we start with vieweditorlayer.ROTO_POINT_MODE edit mode
        self.kf_mode_button.connect("clicked", self._kf_mode_clicked)
        self.move_mode_button = Gtk.ToggleButton()
        self.move_mode_button.set_image(move_mode_img)
        self.move_mode_button.connect("clicked", self._move_mode_clicked)

        self.scale_selector = vieweditor.ScaleSelector(self)
        self.view_editor.scale_select = self.scale_selector

        timeline_box = Gtk.HBox()
        timeline_box.pack_start(self.tc_display.widget, False, False, 0)
        timeline_box.pack_start(Gtk.Label(), True, True, 0)
        timeline_box.pack_start(self.kf_mode_button, False, False, 0)
        timeline_box.pack_start(self.move_mode_button, False, False, 0)
        timeline_box.pack_start(Gtk.Label(), True, True, 0)
        timeline_box.pack_start(self.scale_selector, False, False, 0)
        timeline_box.set_margin_top(6)
        timeline_box.set_margin_bottom(6)

        mask_type_label = Gtk.Label(_("Mask Type:"))
        mask_type_combo_box = Gtk.ComboBoxText()
        mask_type_combo_box.append_text(_("Curve Mask"))
        mask_type_combo_box.append_text(_("Line Mask"))
        mask_type_combo_box.set_active(0)
        mask_type_combo_box.connect("changed",
                                    self.mask_type_selection_changed)

        #exit_b = guiutils.get_sized_button(_("Cancel Edit"), 150, 32)
        #exit_b.connect("clicked", lambda w:close_rotomask())
        save_rotodata_b = guiutils.get_sized_button(_("Close Tool"), 150, 32)
        save_rotodata_b.connect("clicked",
                                lambda w: self._save_rotodata_pressed())

        prop_editor_row1 = Gtk.HBox()
        prop_editor_row1.pack_start(Gtk.Label(), True, True, 0)
        prop_editor_row1.pack_start(mask_type_label, False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(4, 4), False, False, 0)
        prop_editor_row1.pack_start(mask_type_combo_box, False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row1.pack_start(editor_widgets[0], False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row1.pack_start(editor_widgets[3], False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row1.pack_start(editor_widgets[4], False, False, 0)
        prop_editor_row1.pack_start(Gtk.Label(), True, True, 0)

        prop_editor_row2 = Gtk.HBox()
        prop_editor_row2.pack_start(Gtk.Label(), True, True, 0)
        prop_editor_row2.pack_start(editor_widgets[1], False, False, 0)
        prop_editor_row2.pack_start(guiutils.pad_label(24, 20), False, False,
                                    0)
        prop_editor_row2.pack_start(editor_widgets[2], False, False, 0)
        prop_editor_row2.pack_start(Gtk.Label(), True, True, 0)

        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False,
                                      0)
        editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False,
                                      0)
        #editor_buttons_row.pack_start(exit_b, False, False, 0)
        editor_buttons_row.pack_start(save_rotodata_b, False, False, 0)

        editor_panel = Gtk.VBox()
        editor_panel.pack_start(self.view_editor, True, True, 0)
        editor_panel.pack_start(timeline_box, False, False, 0)
        editor_panel.pack_start(kf_editor, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(prop_editor_row1, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(prop_editor_row2, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(editor_buttons_row, False, False, 0)

        editor_row = Gtk.HBox()
        editor_row.pack_start(editor_panel, True, True, 0)

        alignment = guiutils.set_margins(editor_row, 8, 8, 8, 8)

        self.add(alignment)

        self.view_editor.clear_layers()
        # NOTE: we start with vieweditorlayer.ROTO_POINT_MODE edit mode, see __init()__
        self.roto_mask_layer = vieweditorlayer.RotoMaskEditLayer(
            self.view_editor, self.kf_editor.clip_editor,
            kf_editor.editable_property, self)
        self.view_editor.add_layer(self.roto_mask_layer)
        self.view_editor.activate_layer(0)

        self.show_all()

        self.kf_editor.active_keyframe_changed()

        #self.connect("size-allocate", lambda w, e:self.window_resized())
        self.connect("window-state-event", lambda w, e: self.window_resized())
        self.connect("key-press-event", self.key_down)
        self.window_resized()
예제 #8
0
    def __init__(self, callback, clip, container_action, program_info_json):

        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e: self.cancel())

        self.callback = callback
        self.clip = clip
        self.container_action = container_action
        self.orig_program_info_json = copy.deepcopy(
            program_info_json
        )  # We need to sabvre this for 'Cancel'because doing a preview updates edited values
        # in containeractions.BlenderContainerActions.render_blender_preview().

        self.preview_frame = -1  # -1 used as flag that no preview renders ongoing and new one can be started

        # Create panels for objects
        editors = []
        blender_objects = program_info_json["objects"]
        materials = program_info_json["materials"]
        curves = program_info_json["curves"]

        self.editors = editors

        objs_panel = _get_panel_and_create_editors(blender_objects,
                                                   _("Objects"), editors)
        materials_panel = _get_panel_and_create_editors(
            materials, _("Materials"), editors)
        curves_panel = _get_panel_and_create_editors(curves, _("Curves"),
                                                     editors)

        pane = Gtk.VBox(False, 2)
        if objs_panel != None:
            pane.pack_start(objs_panel, False, False, 0)
        if materials_panel != None:
            pane.pack_start(materials_panel, False, False, 0)
        if curves_panel != None:
            pane.pack_start(curves_panel, False, False, 0)

        # Put in scrollpane if too many editors for screensize.
        n_editors = len(editors)
        add_scroll = False
        if editorstate.screen_size_small_height() == True and n_editors > 4:
            add_scroll = True
            h = 500
        elif editorstate.screen_size_small_height(
        ) == True and editorstate.screen_size_large_height(
        ) == False and n_editors > 5:
            add_scroll = True
            h = 600
        elif editorstate.screen_size_large_height() == True and n_editors > 6:
            add_scroll = True
            h = 700

        if add_scroll == True:
            sw = Gtk.ScrolledWindow()
            sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
            sw.add(pane)
            sw.set_size_request(400, h)

        if add_scroll == True:
            editors_panel = sw
        else:
            editors_panel = pane

        cancel_b = guiutils.get_sized_button(_("Cancel"), 150, 32)
        cancel_b.connect("clicked", lambda w: self.cancel())
        save_b = guiutils.get_sized_button(_("Save Changes"), 150, 32)
        save_b.connect("clicked", lambda w: self.save())

        buttons_box = Gtk.HBox(False, 2)
        buttons_box.pack_start(Gtk.Label(), True, True, 0)
        buttons_box.pack_start(cancel_b, False, False, 0)
        buttons_box.pack_start(save_b, False, False, 0)

        self.preview_panel = PreviewPanel(self, clip)

        preview_box = Gtk.VBox(False, 2)
        preview_box.pack_start(self.preview_panel, True, True, 0)
        preview_box.pack_start(guiutils.pad_label(2, 24), False, False, 0)
        preview_box.pack_start(buttons_box, False, False, 0)

        main_box = Gtk.HBox(False, 2)
        main_box.pack_start(
            guiutils.get_named_frame(_("Editors"), editors_panel), False,
            False, 0)
        main_box.pack_start(
            guiutils.get_named_frame(_("Preview"), preview_box), False, False,
            0)

        alignment = guiutils.set_margins(
            main_box, 8, 8, 8, 8)  #dialogutils.get_default_alignment(main_box)

        self.set_modal(True)
        self.set_transient_for(gui.editor_window.window)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_title(
            _("Blender Project Edit - ") +
            self.container_action.container_data.get_program_name() + ".blend")
        self.set_resizable(False)

        self.add(alignment)
        self.show_all()
예제 #9
0
    def __init__(self, callback, clip, container_action, script_data_object):

        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e: self.cancel())

        self.callback = callback
        self.clip = clip
        self.container_action = container_action
        self.script_data_object = copy.deepcopy(script_data_object)

        self.preview_frame = -1  # -1 used as flag that no preview renders ongoing and new one can be started

        # Create panels for objects
        self.editor_widgets = []
        editors_list = self.script_data_object["editors_list"]

        for editor_data in editors_list:
            name, type, value = editor_data
            editor_type = int(type)
            self.editor_widgets.append(
                _get_editor(editor_type, name, name, value, ""))

        editors_v_panel = Gtk.VBox(True, 2)
        for w in self.editor_widgets:
            editors_v_panel.pack_start(w, False, False, 0)

        pane = Gtk.VBox(False, 2)
        if len(self.editor_widgets) != 0:
            pane.pack_start(editors_v_panel, False, False, 0)
        else:
            pane.pack_start(Gtk.Label(_("No Editors for this script")), False,
                            False, 0)

        # Put in scrollpane if too many editors for screensize.
        n_editors = len(self.editor_widgets)
        add_scroll = False
        if editorstate.screen_size_small_height() == True and n_editors > 4:
            add_scroll = True
            h = 500
        elif editorstate.screen_size_small_height(
        ) == True and editorstate.screen_size_large_height(
        ) == False and n_editors > 5:
            add_scroll = True
            h = 600
        elif editorstate.screen_size_large_height() == True and n_editors > 6:
            add_scroll = True
            h = 700

        if add_scroll == True:
            sw = Gtk.ScrolledWindow()
            sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
            sw.add(pane)
            sw.set_size_request(400, h)

        if add_scroll == True:
            editors_panel = sw
        else:
            editors_panel = pane

        cancel_b = guiutils.get_sized_button(_("Cancel"), 150, 32)
        cancel_b.connect("clicked", lambda w: self.cancel())
        save_b = guiutils.get_sized_button(_("Save Changes"), 150, 32)
        save_b.connect("clicked", lambda w: self.save())

        buttons_box = Gtk.HBox(False, 2)
        buttons_box.pack_start(Gtk.Label(), True, True, 0)
        buttons_box.pack_start(cancel_b, False, False, 0)
        buttons_box.pack_start(save_b, False, False, 0)

        self.preview_panel = PreviewPanel(self, clip)

        preview_box = Gtk.VBox(False, 2)
        preview_box.pack_start(self.preview_panel, True, True, 0)
        preview_box.pack_start(guiutils.pad_label(2, 24), False, False, 0)
        preview_box.pack_start(buttons_box, False, False, 0)

        main_box = Gtk.HBox(False, 2)
        main_box.pack_start(
            guiutils.get_named_frame(_("Editors"), editors_panel), False,
            False, 0)
        main_box.pack_start(
            guiutils.get_named_frame(_("Preview"), preview_box), False, False,
            0)

        alignment = guiutils.set_margins(
            main_box, 8, 8, 8, 8)  #dialogutils.get_default_alignment(main_box)

        self.set_modal(True)
        self.set_transient_for(gui.editor_window.window)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_title(
            _("Media Plugin Values Edit - ") +
            self.container_action.container_data.get_program_name())
        self.set_resizable(False)

        self.add(alignment)
        self.show_all()
예제 #10
0
파일: gmic.py 프로젝트: admonkey/flowblade
    def __init__(self):
        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e:_shutdown())

        app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladetoolicon.png")
        self.set_icon(app_icon)

        hamburger_launcher_surface = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "hamburger.png")
        self.hamburger_launcher = guicomponents.PressLaunch(self.hamburger_launch_pressed, hamburger_launcher_surface)
        
        # Load media row
        self.load_button = Gtk.Button(_("Load Clip"))
        self.load_button.connect("clicked", lambda w: open_clip_dialog())

        self.media_info = Gtk.Label()
        self.media_info.set_markup("<small>" + _("no clip loaded") + "</small>")

        load_row = Gtk.HBox(False, 2)
        load_row.pack_start(self.hamburger_launcher.widget, False, False, 0)
        load_row.pack_start(guiutils.get_pad_label(6, 2), False, False, 0)
        load_row.pack_start(self.load_button, False, False, 0)
        load_row.pack_start(guiutils.get_pad_label(6, 2), False, False, 0)
        load_row.pack_start(self.media_info, False, False, 0)
        load_row.pack_start(Gtk.Label(), True, True, 0)
        load_row.set_margin_bottom(4)

        # Clip monitor
        black_box = Gtk.EventBox()
        black_box.add(Gtk.Label())
        bg_color = Gdk.Color(red=0.0, green=0.0, blue=0.0)
        black_box.modify_bg(Gtk.StateType.NORMAL, bg_color)
        self.monitor = black_box  # This could be any GTK+ widget (that is not "windowless"), only its XWindow draw rect 
                                  # is used to position and scale SDL overlay that actually displays video.
        self.monitor.set_size_request(MONITOR_WIDTH, MONITOR_HEIGHT)

        left_vbox = Gtk.VBox(False, 0)
        left_vbox.pack_start(load_row, False, False, 0)
        left_vbox.pack_start(self.monitor, True, True, 0)

        self.preview_info = Gtk.Label()
        self.preview_info.set_markup("<small>" + _("no preview") + "</small>" )
        preview_info_row = Gtk.HBox()
        preview_info_row.pack_start(self.preview_info, False, False, 0)
        preview_info_row.pack_start(Gtk.Label(), True, True, 0)
        preview_info_row.set_margin_top(6)
        preview_info_row.set_margin_bottom(8)

        self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview)

        self.no_preview_icon = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + NO_PREVIEW_FILE)

        right_vbox = Gtk.VBox(False, 2)
        right_vbox.pack_start(preview_info_row, False, False, 0)
        right_vbox.pack_start(self.preview_monitor, True, True, 0)

        # Monitors panel
        monitors_panel = Gtk.HBox(False, 2)
        monitors_panel.pack_start(left_vbox, False, False, 0)
        monitors_panel.pack_start(Gtk.Label(), True, True, 0)
        monitors_panel.pack_start(right_vbox, False, False, 0)

        # Control row
        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)
        self.tc_display.use_internal_fps = True
        
        self.pos_bar = positionbar.PositionBar(False)
        self.pos_bar.set_listener(self.position_listener)
        pos_bar_frame = Gtk.Frame()
        pos_bar_frame.add(self.pos_bar.widget)
        pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        pos_bar_frame.set_margin_top(5)
        pos_bar_frame.set_margin_bottom(4)
        pos_bar_frame.set_margin_left(6)
        pos_bar_frame.set_margin_right(2)
        
        self.control_buttons = glassbuttons.GmicButtons()
        pressed_callback_funcs = [prev_pressed,
                                  next_pressed,
                                  mark_in_pressed,
                                  mark_out_pressed,
                                  marks_clear_pressed,
                                  to_mark_in_pressed,
                                  to_mark_out_pressed]
        self.control_buttons.set_callbacks(pressed_callback_funcs)
        
        self.preview_button = Gtk.Button(_("Preview"))
        self.preview_button.connect("clicked", lambda w: render_preview_frame())
                            
        control_panel = Gtk.HBox(False, 2)
        control_panel.pack_start(self.tc_display.widget, False, False, 0)
        control_panel.pack_start(pos_bar_frame, True, True, 0)
        control_panel.pack_start(self.control_buttons.widget, False, False, 0)
        control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0)
        control_panel.pack_start(self.preview_button, False, False, 0)

        preview_panel = Gtk.VBox(False, 2)
        preview_panel.pack_start(monitors_panel, False, False, 0)
        preview_panel.pack_start(control_panel, False, False, 0)
        preview_panel.set_margin_bottom(8)

        # Script area
        self.preset_label = Gtk.Label()
        self.present_event_box = Gtk.EventBox()
        self.present_event_box.add(self.preset_label)
        self.present_event_box.connect("button-press-event",  script_menu_lauched)

        self.script_menu = toolguicomponents.PressLaunch(script_menu_lauched)
        
        self.action_select = Gtk.CheckButton()
        self.action_select.set_active(False)
                
        self.action_label = Gtk.Label(_("Add to Script"))

        preset_row = Gtk.HBox(False, 2)
        preset_row.pack_start(self.present_event_box, False, False, 0)
        preset_row.pack_start(self.script_menu.widget, False, False, 0)
        preset_row.pack_start(guiutils.pad_label(2, 30), False, False, 0)
        preset_row.pack_start(Gtk.Label(), True, True, 0)
        preset_row.pack_start(self.action_select, False, False, 0)
        preset_row.pack_start(self.action_label, False, False, 0)
                
        self.script_view = Gtk.TextView()
        self.script_view.set_sensitive(False)
        self.script_view.set_pixels_above_lines(2)
        self.script_view.set_left_margin(2)
        self.script_view.set_wrap_mode(Gtk.WrapMode.CHAR)
        
        script_sw = Gtk.ScrolledWindow()
        script_sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        script_sw.add(self.script_view)
        script_sw.set_size_request(MONITOR_WIDTH - 100, 125)

        self.out_view = Gtk.TextView()
        self.out_view.set_sensitive(False)
        self.out_view.set_pixels_above_lines(2)
        self.out_view.set_left_margin(2)
        self.out_view.set_wrap_mode(Gtk.WrapMode.WORD)
        fd = Pango.FontDescription.from_string("Sans 8")
        self.out_view.override_font(fd)

        out_sw = Gtk.ScrolledWindow()
        out_sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        out_sw.add(self.out_view)
        out_sw.set_size_request(MONITOR_WIDTH - 150, 100)
        
        script_vbox = Gtk.VBox(False, 2)
        script_vbox.pack_start(preset_row, False, False, 0)
        script_vbox.pack_start(script_sw, True, True, 0)
        script_vbox.pack_start(out_sw, True, True, 0)

        # Render panel
        self.mark_in_label = guiutils.bold_label(_("Mark In:"))
        self.mark_out_label = guiutils.bold_label(_("Mark Out:"))
        self.length_label = guiutils.bold_label(_("Length:"))
        
        self.mark_in_info = Gtk.Label("-")
        self.mark_out_info = Gtk.Label("-")
        self.length_info = Gtk.Label("-")

        in_row = guiutils.get_two_column_box(self.mark_in_label, self.mark_in_info, 150)
        out_row = guiutils.get_two_column_box(self.mark_out_label, self.mark_out_info, 150)
        length_row = guiutils.get_two_column_box(self.length_label, self.length_info, 150)
        
        marks_row = Gtk.VBox(False, 2)
        marks_row.pack_start(in_row, True, True, 0)
        marks_row.pack_start(out_row, True, True, 0)
        marks_row.pack_start(length_row, True, True, 0)

        self.out_folder = Gtk.FileChooserButton(_("Select Folder"))
        self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
        self.out_folder.connect("selection-changed", self.folder_selection_changed) 
        self.out_label = Gtk.Label(label=_("Frames Folder:"))
        
        self.frame_name = Gtk.Entry()
        self.frame_name.set_text("frame")
        self.extension_label = Gtk.Label()
        self.extension_label.set_markup("<small>XXXX.png</small>")

        out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \
                            self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \
                            guiutils.pad_label(2, 2), self.extension_label])

        self.encode_check_label = Gtk.Label(_("Encode Video"))
        self.encode_check = Gtk.CheckButton()
        self.encode_check.set_active(False)
        self.encode_check.connect("toggled", lambda w:self.update_encode_sensitive())
        
        self.encode_settings_button = Gtk.Button(_("Encoding settings"))
        self.encode_settings_button.connect("clicked", lambda w:_encode_settings_clicked())
        self.encode_desc = Gtk.Label()
        self.encode_desc.set_markup("<small>" + _("not set")  + "</small>")
        self.encode_desc.set_ellipsize(Pango.EllipsizeMode.END)
        self.encode_desc.set_max_width_chars(32)

        encode_row = Gtk.HBox(False, 2)
        encode_row.pack_start(self.encode_check, False, False, 0)
        encode_row.pack_start(self.encode_check_label, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0)
        encode_row.pack_start(self.encode_settings_button, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0)
        encode_row.pack_start(self.encode_desc, False, False, 0)
        encode_row.pack_start(Gtk.Label(), True, True, 0)
        encode_row.set_margin_bottom(6)

        self.render_percentage = Gtk.Label("")
        
        self.status_no_render = _("Set Mark In, Mark Out and Frames Folder for valid render")
         
        self.render_status_info = Gtk.Label()
        self.render_status_info.set_markup("<small>" + self.status_no_render  + "</small>") 

        render_status_row = Gtk.HBox(False, 2)
        render_status_row.pack_start(self.render_percentage, False, False, 0)
        render_status_row.pack_start(Gtk.Label(), True, True, 0)
        render_status_row.pack_start(self.render_status_info, False, False, 0)

        render_status_row.set_margin_bottom(6)

        self.render_progress_bar = Gtk.ProgressBar()
        self.render_progress_bar.set_valign(Gtk.Align.CENTER)

        self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32)
        self.stop_button.connect("clicked", lambda w:abort_render())
        self.render_button = guiutils.get_sized_button(_("Render"), 100, 32)
        self.render_button.connect("clicked", lambda w:render_output())

        render_row = Gtk.HBox(False, 2)
        render_row.pack_start(self.render_progress_bar, True, True, 0)
        render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        render_row.pack_start(self.stop_button, False, False, 0)
        render_row.pack_start(self.render_button, False, False, 0)

        render_vbox = Gtk.VBox(False, 2)
        render_vbox.pack_start(marks_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(encode_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(out_folder_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(render_status_row, False, False, 0)
        render_vbox.pack_start(render_row, False, False, 0)
        render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0)
        
        # Script work panel
        script_work_panel = Gtk.HBox(False, 2)
        script_work_panel.pack_start(script_vbox, False, False, 0)
        script_work_panel.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        script_work_panel.pack_start(render_vbox, True, True, 0)

        self.load_script = Gtk.Button(_("Load Script"))
        self.load_script.connect("clicked", lambda w:load_script_dialog(_load_script_dialog_callback))
        self.save_script = Gtk.Button(_("Save Script"))
        self.save_script.connect("clicked", lambda w:save_script_dialog(_save_script_dialog_callback))

        exit_b = guiutils.get_sized_button(_("Close"), 150, 32)
        exit_b.connect("clicked", lambda w:_shutdown())
        self.close_button = exit_b
        
        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(self.load_script, False, False, 0)
        editor_buttons_row.pack_start(self.save_script, False, False, 0)
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(exit_b, False, False, 0)

        # Build window
        pane = Gtk.VBox(False, 2)
        pane.pack_start(preview_panel, False, False, 0)
        pane.pack_start(script_work_panel, False, False, 0)
        pane.pack_start(editor_buttons_row, False, False, 0)

        align = guiutils.set_margins(pane, 12, 12, 12, 12)

        script = gmicscript.get_default_script()
        self.script_view.get_buffer().set_text(script.script)
        self.preset_label.set_text(script.name)

        self.update_encode_sensitive()

        # Connect global key listener
        self.connect("key-press-event", _global_key_down_listener)

        # Set pane and show window
        self.add(align)
        self.set_title(_("G'MIC Effects"))
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_widgets_sensitive(False)
        self.show_all()
        self.set_resizable(False)
        self.set_active_state(False)
예제 #11
0
    def __init__(self):
        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e:_shutdown())

        app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladetoolicon.png")
        self.set_icon(app_icon)

        #---- LEFT PANEL
        hamburger_launcher_surface = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "hamburger.png")
        self.hamburger_launcher = guicomponents.PressLaunch(_hamburger_launch_pressed, hamburger_launcher_surface)
        guiutils.set_margins(self.hamburger_launcher.widget, 0, 8, 0, 8)

        # Animation selector menu launcher row
        self.animation_label = Gtk.Label(_animation_instance.info.name)
        self.present_event_box = Gtk.EventBox()
        self.present_event_box.add(self.animation_label)
        self.present_event_box.connect("button-press-event", animations_menu_launched)
        self.script_menu = toolguicomponents.PressLaunch(animations_menu_launched)

        selector_row = Gtk.HBox(False, 2)
        selector_row.pack_start(self.hamburger_launcher.widget, False, False, 0)
        selector_row.pack_start(self.present_event_box, False, False, 0)
        selector_row.pack_start(self.script_menu.widget, False, False, 0)
        selector_row.set_margin_top(2)
        # Edit area
        self.value_edit_frame = Gtk.Frame()
        self.value_edit_frame.set_shadow_type(Gtk.ShadowType.IN)
        self.value_edit_frame.set_size_request(EDIT_PANEL_WIDTH+ 10, EDIT_PANEL_HEIGHT + 10)
        self.value_edit_box = None
        
        
        #---- RIGHT PANEL
        self.preview_info = Gtk.Label()
        self.preview_info.set_markup("<small>" + _("no preview") + "</small>" )
        preview_info_row = Gtk.HBox()
        preview_info_row.pack_start(self.preview_info, False, False, 0)
        preview_info_row.pack_start(Gtk.Label(), True, True, 0)
        preview_info_row.set_margin_top(6)
        preview_info_row.set_margin_bottom(8)
        preview_info_row.set_size_request(200, 10)
        
        # Monitor 
        self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview)

        # Position control panel
        self.pos_bar = positionbar.PositionBar(False)
        self.pos_bar.set_listener(self.position_listener)
        pos_bar_frame = Gtk.Frame()
        pos_bar_frame.add(self.pos_bar.widget)
        pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        pos_bar_frame.set_margin_top(5)
        pos_bar_frame.set_margin_bottom(4)
        pos_bar_frame.set_margin_left(6)
        pos_bar_frame.set_margin_right(2)
                
        self.preview_button = Gtk.Button(_("Preview Frame"))
        self.preview_button.connect("clicked", lambda w: render_preview_frame())
                            
        control_panel = Gtk.HBox(False, 2)
        control_panel.pack_start(pos_bar_frame, True, True, 0)
        control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0)
        control_panel.pack_start(self.preview_button, False, False, 0)
        
        # Range setting
        in_label = Gtk.Label(_("Start:"))
        self.range_in = Gtk.SpinButton.new_with_range(1, 249, 1)
        out_label = Gtk.Label(_("End:"))
        self.range_out = Gtk.SpinButton.new_with_range(2, 250, 1)
        self.range_in.set_value(1)
        self.range_out.set_value(250)
        self.range_in.connect("value-changed", self.range_changed)
        self.range_out.connect("value-changed", self.range_changed)
        pos_label = Gtk.Label(_("Frame:"))
        self.pos_info = Gtk.Label(_("1"))

        range_row = Gtk.HBox(False, 2)
        range_row.pack_start(in_label, False, False, 0)
        range_row.pack_start(self.range_in, False, False, 0)
        range_row.pack_start(Gtk.Label(), True, True, 0)
        range_row.pack_start(pos_label, False, False, 0)
        range_row.pack_start(self.pos_info, False, False, 0)
        range_row.pack_start(Gtk.Label(), True, True, 0)
        range_row.pack_start(out_label, False, False, 0)
        range_row.pack_start(self.range_out, False, False, 0)
        range_row.set_margin_bottom(24)
        range_row.set_margin_left(5)

        # Render panel
        self.out_folder = Gtk.FileChooserButton(_("Select Folder"))
        self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
        self.out_folder.connect("selection-changed", self.folder_selection_changed) 
        self.out_label = Gtk.Label(label=_("Frames Folder:"))
        
        self.frame_name = Gtk.Entry()
        self.frame_name.set_text("frame")
        self.extension_label = Gtk.Label()
        self.extension_label.set_markup("<small>XXXX.png</small>")

        out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \
                            self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \
                            guiutils.pad_label(2, 2), self.extension_label])

        self.encode_check_label = Gtk.Label(_("Encode Video"))
        self.encode_check = Gtk.CheckButton()
        self.encode_check.set_active(False)
        self.encode_check.connect("toggled", lambda w:self.update_encode_sensitive())
        
        self.encode_settings_button = Gtk.Button(_("Encoding settings"))
        self.encode_settings_button.connect("clicked", lambda w:_encode_settings_clicked())
        self.encode_desc = Gtk.Label()
        self.encode_desc.set_markup("<small>" + _("not set")  + "</small>")
        self.encode_desc.set_ellipsize(Pango.EllipsizeMode.END)
        self.encode_desc.set_max_width_chars(32)

        encode_row = Gtk.HBox(False, 2)
        encode_row.pack_start(self.encode_check, False, False, 0)
        encode_row.pack_start(self.encode_check_label, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0)
        encode_row.pack_start(self.encode_settings_button, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0)
        encode_row.pack_start(self.encode_desc, False, False, 0)
        encode_row.pack_start(Gtk.Label(), True, True, 0)
        encode_row.set_margin_bottom(6)

        format_label = Gtk.Label(_("Natron Render Format:"))
        self.format_selector = Gtk.ComboBoxText() # filled later when current sequence known
        for format_desc in NATRON_RENDER_FORMATS:
            self.format_selector.append_text(format_desc)
        self.format_selector.set_active(NATRON_DEFAULT_RENDER_FORMAT)

        format_select_row = Gtk.HBox(False, 2)
        format_select_row.pack_start(format_label, False, False, 0)
        format_select_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        format_select_row.pack_start(self.format_selector, False, False, 0)
        format_select_row.set_margin_top(24)

        self.render_percentage = Gtk.Label("")
        
        self.status_no_render = _("Set Frames Folder for valid render")
         
        self.render_status_info = Gtk.Label()
        self.render_status_info.set_markup("<small>" + self.status_no_render  + "</small>") 

        render_status_row = Gtk.HBox(False, 2)
        render_status_row.pack_start(self.render_percentage, False, False, 0)
        render_status_row.pack_start(Gtk.Label(), True, True, 0)
        render_status_row.pack_start(self.render_status_info, False, False, 0)

        render_status_row.set_margin_bottom(6)

        self.render_progress_bar = Gtk.ProgressBar()
        self.render_progress_bar.set_valign(Gtk.Align.CENTER)

        self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32)
        #self.stop_button.connect("clicked", lambda w:abort_render())
        self.render_button = guiutils.get_sized_button(_("Render"), 100, 32)
        self.render_button.connect("clicked", lambda w:render_output())

        render_row = Gtk.HBox(False, 2)
        render_row.pack_start(self.render_progress_bar, True, True, 0)
        render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        render_row.pack_start(self.stop_button, False, False, 0)
        render_row.pack_start(self.render_button, False, False, 0)

        render_vbox = Gtk.VBox(False, 2)
        render_vbox.pack_start(encode_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(out_folder_row, False, False, 0)
        render_vbox.pack_start(format_select_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(render_status_row, False, False, 0)
        render_vbox.pack_start(render_row, False, False, 0)
        render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0)
        render_vbox.set_margin_left(8)

        # Bottomrow
        self.load_anim = Gtk.Button(_("Load Animation"))
        self.load_anim.connect("clicked", lambda w:load_script_dialog(_load_script_dialog_callback))
        self.save_anim = Gtk.Button(_("Save Animation"))
        self.save_anim.connect("clicked", lambda w:save_script_dialog(_save_script_dialog_callback))

        exit_b = guiutils.get_sized_button(_("Close"), 150, 32)
        exit_b.connect("clicked", lambda w:_shutdown())
        
        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(self.load_anim, False, False, 0)
        editor_buttons_row.pack_start(self.save_anim, False, False, 0)
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(exit_b, False, False, 0)
        
        # Build window
        left_panel = Gtk.VBox(False, 2)
        left_panel.pack_start(selector_row, False, False, 0)
        left_panel.pack_start(self.value_edit_frame, True, True, 0)

        right_panel = Gtk.VBox(False, 0)
        right_panel.pack_start(preview_info_row, False, False, 0)
        right_panel.pack_start(self.preview_monitor, False, False, 0)
        right_panel.pack_start(control_panel, False, False, 0)
        right_panel.pack_start(range_row, False, False, 0)
        right_panel.pack_start(render_vbox, True, True, 0)
    
        right_panel.set_margin_left(4)
        
        sides_pane = Gtk.HBox(False, 2)
        sides_pane.pack_start(left_panel, False, False, 0)
        sides_pane.pack_start(right_panel, False, False, 0)

        pane = Gtk.VBox(False, 2)
        pane.pack_start(sides_pane, False, False, 0)
        pane.pack_start(editor_buttons_row, False, False, 0)
        
        align = guiutils.set_margins(pane, 2, 12, 12, 12)

        # Connect global key listener
        #self.connect("key-press-event", _global_key_down_listener)

        # Set pane and show window
        self.add(align)
        self.set_title(_("Natron Animations"))
        self.set_position(Gtk.WindowPosition.CENTER)
        #self.set_widgets_sensitive(False)
        self.show_all()
        self.set_resizable(False)
        #self.set_active_state(False)

        self.update_render_status_info()
        self.change_animation()
예제 #12
0
    def __init__(self):
        GObject.GObject.__init__(self)
        self.set_modal(True)
        self.set_transient_for(gui.editor_window.window)
        self.set_title(_("Add Media Plugin"))
        self.connect("delete-event", lambda w, e:_close_window())

        # categories_list is list of form [("category_name", [category_items]), ...]
        # with category_items list of form ["item_name", ...]
        self.plugin_select = guicomponents.CategoriesModelComboBoxWithData(_get_categories_list())
        self.plugin_select.set_changed_callback(self._plugin_selection_changed)

        plugin_label = Gtk.Label(label=_("Media Plugin:"))
        plugin_select_row = guiutils.get_two_column_box(plugin_label, self.plugin_select.widget, 220)

        global MONITOR_HEIGHT
        MONITOR_HEIGHT = int(MONITOR_WIDTH * float(current_sequence().profile.display_aspect_den()) / float(current_sequence().profile.display_aspect_num()))
        self.screenshot_canvas = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_screenshot)
        screenshot_row = guiutils.get_centered_box([self.screenshot_canvas ])
        guiutils.set_margins(screenshot_row, 12, 12, 0, 0)

        self.frame_display = Gtk.Label(_("Clip Frame"))
        self.frame_display.set_margin_right(2)
        
        self.frame_select = Gtk.SpinButton.new_with_range (0, 200, 1)
        self.frame_select.set_value(0)
        
        self.preview_button = Gtk.Button(_("Preview"))
        self.preview_button.connect("clicked", lambda w: self._show_preview())
                            
        control_panel = Gtk.HBox(False, 2)
        control_panel.pack_start(self.frame_display, False, False, 0)
        control_panel.pack_start(self.frame_select, False, False, 0)
        control_panel.pack_start(Gtk.Label(), True, True, 0)
        control_panel.pack_start(self.preview_button, False, False, 0)
        guiutils.set_margins(control_panel, 0, 24, 0, 0)
        
        self.editors_box = Gtk.HBox(False, 0)
        self.editors_box.set_size_request(270, 185)

        self.import_select = Gtk.ComboBoxText()
        self.import_select.append_text(_("Add as Container Clip"))
        self.import_select.append_text(_("Add as Rendered Media"))
        self.import_select.set_active(0)
        self.import_select.connect("changed", lambda w: self._export_action_changed(w))
        import_row = guiutils.get_left_justified_box([Gtk.Label(_("Import Action:")), guiutils.pad_label(12,12), self.import_select])
        guiutils.set_margins(import_row,8,0,0,0)
        self.length_spin = Gtk.SpinButton.new_with_range (25, 100000, 1)
        self.length_spin.set_value(200)
        length_row = guiutils.get_left_justified_box([Gtk.Label(_("Plugin Media Length:")), guiutils.pad_label(12,12), self.length_spin])

        self.encoding_button = Gtk.Button(_("Encode settings"))
        self.encoding_button.set_sensitive(False)
        self.encoding_button.connect("clicked", lambda w: self._set_encoding_button_pressed())
        self.encoding_info = Gtk.Label()
        self.encoding_info.set_markup("<small>" + "Not set" + "</small>")
        self.encoding_info.set_max_width_chars(32)
        self.encoding_info.set_sensitive(False)
        encoding_row = guiutils.get_left_justified_box([self.encoding_button, guiutils.pad_label(12,12), self.encoding_info])
                
        import_panel = Gtk.VBox(False, 2)
        import_panel.pack_start(length_row, False, False, 0)
        import_panel.pack_start(import_row, False, False, 0)
        import_panel.pack_start(encoding_row, False, False, 0)
        import_panel.pack_start(Gtk.Label(), True, True, 0)

        values_row = Gtk.HBox(True, 8)
        values_row.pack_start(self.editors_box, False, False, 0)
        values_row.pack_start(import_panel, False, False, 0)
        #values_row.
        
        close_button = guiutils.get_sized_button(_("Close"), 150, 32)
        close_button.connect("clicked", lambda w: _close_clicked())
        self.add_button = guiutils.get_sized_button(_("Add Media Plugin"), 150, 32)
        self.add_button.connect("clicked", lambda w: _add_media_plugin())
        #self.load_info_2 = Gtk.Label()
        
        buttons_row = Gtk.HBox(False, 0)
        #buttons_row.pack_start(self.load_info_2, False, False, 0)
        buttons_row.pack_start(Gtk.Label(), True, True, 0)
        buttons_row.pack_start(close_button, False, False, 0)
        buttons_row.pack_start(self.add_button, False, False, 0)
        guiutils.set_margins(buttons_row, 24, 0, 0, 0)

        vbox = Gtk.VBox(False, 2)
        vbox.pack_start(plugin_select_row, False, False, 0)
        vbox.pack_start(screenshot_row, False, False, 0)
        vbox.pack_start(control_panel, False, False, 0)
        vbox.pack_start(values_row, False, False, 0)
        vbox.pack_start(Gtk.Label(), True, True, 0)
        vbox.pack_start(buttons_row, False, False, 0)
        
        alignment = guiutils.set_margins(vbox, 8, 8, 12, 12)

        self.add(alignment)
        self.set_position(Gtk.WindowPosition.CENTER)  
        self.show_all()
    
        self.plugin_select.set_selected(_plugins[0].name)
        self._display_current_render_data()
예제 #13
0
    def __init__(self, kf_editor, property_editor_widgets_create_func, value_labels): # kf_editor is keyframeeditor.RotoMaskKeyFrameEditor
        GObject.GObject.__init__(self)
        self.set_modal(True)
        self.set_transient_for(gui.editor_window.window)
        self.set_title(_("RotoMaskEditor"))
        self.connect("delete-event", lambda w, e:close_rotomask())
        
        if editorstate.screen_size_small_height() == True:
            global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT
            TEXT_LAYER_LIST_HEIGHT = 150
            TEXT_VIEW_HEIGHT = 180
            VIEW_EDITOR_HEIGHT = 450

        if editorstate.screen_size_small_height() == True:
            global VIEW_EDITOR_WIDTH
            VIEW_EDITOR_WIDTH = 680
        
        editor_widgets = property_editor_widgets_create_func()
        
        self.block_updates = False

        self.kf_editor = kf_editor
        self.kf_editor.set_parent_editor(self)

        self.value_labels = value_labels
        
        self.view_editor = vieweditor.ViewEditor(PLAYER().profile, VIEW_EDITOR_WIDTH, VIEW_EDITOR_HEIGHT)
        self.view_editor.draw_safe_area = False

        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)

        kf_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "roto_kf_edit_mode.png")
        move_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "roto_move_mode.png")
        self.kf_mode_button = Gtk.ToggleButton()
        self.kf_mode_button.set_image(kf_mode_img)
        self.kf_mode_button.set_active(True) # we start with vieweditorlayer.ROTO_POINT_MODE edit mode
        self.kf_mode_button.connect("clicked", self._kf_mode_clicked)
        self.move_mode_button = Gtk.ToggleButton()
        self.move_mode_button.set_image(move_mode_img)
        self.move_mode_button.connect("clicked", self._move_mode_clicked)
        
        self.scale_selector = vieweditor.ScaleSelector(self)
        self.view_editor.scale_select = self.scale_selector

        timeline_box = Gtk.HBox()
        timeline_box.pack_start(self.tc_display.widget, False, False, 0)
        timeline_box.pack_start(Gtk.Label(), True, True, 0)
        timeline_box.pack_start(self.kf_mode_button, False, False, 0)
        timeline_box.pack_start(self.move_mode_button, False, False, 0)
        timeline_box.pack_start(Gtk.Label(), True, True, 0)
        timeline_box.pack_start(self.scale_selector, False, False, 0)
        timeline_box.set_margin_top(6)
        timeline_box.set_margin_bottom(6)

        mask_type_label = Gtk.Label(_("Mask Type:"))
        mask_type_combo_box = Gtk.ComboBoxText()
        mask_type_combo_box.append_text(_("Curve Mask"))
        mask_type_combo_box.append_text(_("Line Mask"))
        mask_type_combo_box.set_active(0)
        mask_type_combo_box.connect("changed", self.mask_type_selection_changed)  

        allow_adding_check = Gtk.CheckButton()
        allow_adding_check.set_active(False) # This shows value of self.roto_mask_layer.allow_adding_points, False is default
        allow_adding_check.connect("toggled", self.allow_adding_toggled)
        allow_adding_label = Gtk.Label(_("Allow to add points to closed masks"))
        
        save_rotodata_b = guiutils.get_sized_button(_("Close Tool"), 150, 32)
        save_rotodata_b.connect("clicked", lambda w:self._save_rotodata_pressed())
        
        prop_editor_row1 = Gtk.HBox()
        prop_editor_row1.pack_start(Gtk.Label(), True, True, 0)
        prop_editor_row1.pack_start(mask_type_label, False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(4, 4), False, False, 0)
        prop_editor_row1.pack_start(mask_type_combo_box, False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False, 0)
        prop_editor_row1.pack_start(editor_widgets[0], False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False, 0)
        prop_editor_row1.pack_start(editor_widgets[3], False, False, 0)
        prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False, 0)
        prop_editor_row1.pack_start(editor_widgets[4], False, False, 0)
        prop_editor_row1.pack_start(Gtk.Label(), True, True, 0)
        
        prop_editor_row2 = Gtk.HBox()
        prop_editor_row2.pack_start(Gtk.Label(), True, True, 0)
        prop_editor_row2.pack_start(editor_widgets[1], False, False, 0)
        prop_editor_row2.pack_start(guiutils.pad_label(24, 20), False, False, 0)
        prop_editor_row2.pack_start(editor_widgets[2], False, False, 0)
        prop_editor_row2.pack_start(Gtk.Label(), True, True, 0)

        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(allow_adding_check, False, False, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(4, 2), False, False, 0)
        editor_buttons_row.pack_start(allow_adding_label, False, False, 0)
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(save_rotodata_b, False, False, 0)
        
        editor_panel = Gtk.VBox()
        editor_panel.pack_start(self.view_editor, True, True, 0)
        editor_panel.pack_start(timeline_box, False, False, 0)
        editor_panel.pack_start(kf_editor, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(prop_editor_row1, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(prop_editor_row2, False, False, 0)
        editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0)
        editor_panel.pack_start(editor_buttons_row, False, False, 0)

        editor_row = Gtk.HBox()
        editor_row.pack_start(editor_panel, True, True, 0)

        alignment = guiutils.set_margins(editor_row, 8,8,8,8)

        self.add(alignment)

        self.view_editor.clear_layers()
        # NOTE: we start with vieweditorlayer.ROTO_POINT_MODE edit mode, see __init()__
        self.roto_mask_layer = vieweditorlayer.RotoMaskEditLayer(self.view_editor, self.kf_editor.clip_editor, kf_editor.editable_property, self)
        self.view_editor.add_layer(self.roto_mask_layer)
        self.view_editor.activate_layer(0)

        self.show_all()
        
        self.kf_editor.active_keyframe_changed()

        self.connect("size-allocate", lambda w, e:self.window_resized())
        self.connect("window-state-event", lambda w, e:self.window_resized())
        self.connect("key-press-event", self.key_down)
        self.window_resized()
예제 #14
0
    def __init__(self):
        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e:_shutdown())

        app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladetoolicon.png")
        self.set_icon(app_icon)

        #---- LEFT PANEL
        hamburger_launcher_surface = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "hamburger.png")
        self.hamburger_launcher = guicomponents.PressLaunch(_hamburger_launch_pressed, hamburger_launcher_surface)
        guiutils.set_margins(self.hamburger_launcher.widget, 0, 8, 0, 8)

        # Animation selector menu launcher row
        self.animation_label = Gtk.Label(_animation_instance.info.name)
        self.present_event_box = Gtk.EventBox()
        self.present_event_box.add(self.animation_label)
        self.present_event_box.connect("button-press-event", animations_menu_launched)
        self.script_menu = toolguicomponents.PressLaunch(animations_menu_launched)

        selector_row = Gtk.HBox(False, 2)
        selector_row.pack_start(self.hamburger_launcher.widget, False, False, 0)
        selector_row.pack_start(self.present_event_box, False, False, 0)
        selector_row.pack_start(self.script_menu.widget, False, False, 0)
        selector_row.set_margin_top(2)
        # Edit area
        self.value_edit_frame = Gtk.Frame()
        self.value_edit_frame.set_shadow_type(Gtk.ShadowType.IN)
        self.value_edit_frame.set_size_request(EDIT_PANEL_WIDTH+ 10, EDIT_PANEL_HEIGHT + 10)
        self.value_edit_box = None
        
        
        #---- RIGHT PANEL
        self.preview_info = Gtk.Label()
        self.preview_info.set_markup("<small>" + _("no preview") + "</small>" )
        preview_info_row = Gtk.HBox()
        preview_info_row.pack_start(self.preview_info, False, False, 0)
        preview_info_row.pack_start(Gtk.Label(), True, True, 0)
        preview_info_row.set_margin_top(6)
        preview_info_row.set_margin_bottom(8)
        preview_info_row.set_size_request(200, 10)
        
        # Monitor 
        self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview)

        # Position control panel
        self.pos_bar = positionbar.PositionBar(False)
        self.pos_bar.set_listener(self.position_listener)
        pos_bar_frame = Gtk.Frame()
        pos_bar_frame.add(self.pos_bar.widget)
        pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        pos_bar_frame.set_margin_top(5)
        pos_bar_frame.set_margin_bottom(4)
        pos_bar_frame.set_margin_left(6)
        pos_bar_frame.set_margin_right(2)
                
        self.preview_button = Gtk.Button(_("Preview Frame"))
        self.preview_button.connect("clicked", lambda w: render_preview_frame())
                            
        control_panel = Gtk.HBox(False, 2)
        control_panel.pack_start(pos_bar_frame, True, True, 0)
        control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0)
        control_panel.pack_start(self.preview_button, False, False, 0)
        
        # Range setting
        in_label = Gtk.Label(_("Start:"))
        self.range_in = Gtk.SpinButton.new_with_range(1, 249, 1)
        out_label = Gtk.Label(_("End:"))
        self.range_out = Gtk.SpinButton.new_with_range(2, 250, 1)
        self.range_in.set_value(1)
        self.range_out.set_value(250)
        self.range_in.connect("value-changed", self.range_changed)
        self.range_out.connect("value-changed", self.range_changed)
        pos_label = Gtk.Label(_("Frame:"))
        self.pos_info = Gtk.Label(_("1"))

        range_row = Gtk.HBox(False, 2)
        range_row.pack_start(in_label, False, False, 0)
        range_row.pack_start(self.range_in, False, False, 0)
        range_row.pack_start(Gtk.Label(), True, True, 0)
        range_row.pack_start(pos_label, False, False, 0)
        range_row.pack_start(self.pos_info, False, False, 0)
        range_row.pack_start(Gtk.Label(), True, True, 0)
        range_row.pack_start(out_label, False, False, 0)
        range_row.pack_start(self.range_out, False, False, 0)
        range_row.set_margin_bottom(24)
        range_row.set_margin_left(5)

        # Render panel
        self.out_folder = Gtk.FileChooserButton(_("Select Folder"))
        self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
        self.out_folder.connect("selection-changed", self.folder_selection_changed) 
        self.out_label = Gtk.Label(label=_("Frames Folder:"))
        
        self.frame_name = Gtk.Entry()
        self.frame_name.set_text("frame")
        self.extension_label = Gtk.Label()
        self.extension_label.set_markup("<small>XXXX.png</small>")

        out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \
                            self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \
                            guiutils.pad_label(2, 2), self.extension_label])

        self.encode_check_label = Gtk.Label(_("Encode Video"))
        self.encode_check = Gtk.CheckButton()
        self.encode_check.set_active(False)
        self.encode_check.connect("toggled", lambda w:self.update_encode_sensitive())
        
        self.encode_settings_button = Gtk.Button(_("Encoding settings"))
        self.encode_settings_button.connect("clicked", lambda w:_encode_settings_clicked())
        self.encode_desc = Gtk.Label()
        self.encode_desc.set_markup("<small>" + _("not set")  + "</small>")
        self.encode_desc.set_ellipsize(Pango.EllipsizeMode.END)
        self.encode_desc.set_max_width_chars(32)

        encode_row = Gtk.HBox(False, 2)
        encode_row.pack_start(self.encode_check, False, False, 0)
        encode_row.pack_start(self.encode_check_label, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0)
        encode_row.pack_start(self.encode_settings_button, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0)
        encode_row.pack_start(self.encode_desc, False, False, 0)
        encode_row.pack_start(Gtk.Label(), True, True, 0)
        encode_row.set_margin_bottom(6)

        format_label = Gtk.Label(_("Natron Render Format:"))
        self.format_selector = Gtk.ComboBoxText() # filled later when current sequence known
        for format_desc in NATRON_RENDER_FORMATS:
            self.format_selector.append_text(format_desc)
        self.format_selector.set_active(NATRON_DEFAULT_RENDER_FORMAT)

        format_select_row = Gtk.HBox(False, 2)
        format_select_row.pack_start(format_label, False, False, 0)
        format_select_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        format_select_row.pack_start(self.format_selector, False, False, 0)
        format_select_row.set_margin_top(24)

        self.render_percentage = Gtk.Label("")
        
        self.status_no_render = _("Set Frames Folder for valid render")
         
        self.render_status_info = Gtk.Label()
        self.render_status_info.set_markup("<small>" + self.status_no_render  + "</small>") 

        render_status_row = Gtk.HBox(False, 2)
        render_status_row.pack_start(self.render_percentage, False, False, 0)
        render_status_row.pack_start(Gtk.Label(), True, True, 0)
        render_status_row.pack_start(self.render_status_info, False, False, 0)

        render_status_row.set_margin_bottom(6)

        self.render_progress_bar = Gtk.ProgressBar()
        self.render_progress_bar.set_valign(Gtk.Align.CENTER)

        self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32)
        #self.stop_button.connect("clicked", lambda w:abort_render())
        self.render_button = guiutils.get_sized_button(_("Render"), 100, 32)
        self.render_button.connect("clicked", lambda w:render_output())

        render_row = Gtk.HBox(False, 2)
        render_row.pack_start(self.render_progress_bar, True, True, 0)
        render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        render_row.pack_start(self.stop_button, False, False, 0)
        render_row.pack_start(self.render_button, False, False, 0)

        render_vbox = Gtk.VBox(False, 2)
        render_vbox.pack_start(encode_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(out_folder_row, False, False, 0)
        render_vbox.pack_start(format_select_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(render_status_row, False, False, 0)
        render_vbox.pack_start(render_row, False, False, 0)
        render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0)
        render_vbox.set_margin_left(8)

        # Bottomrow
        self.load_anim = Gtk.Button(_("Load Animation"))
        self.load_anim.connect("clicked", lambda w:load_script_dialog(_load_script_dialog_callback))
        self.save_anim = Gtk.Button(_("Save Animation"))
        self.save_anim.connect("clicked", lambda w:save_script_dialog(_save_script_dialog_callback))

        exit_b = guiutils.get_sized_button(_("Close"), 150, 32)
        exit_b.connect("clicked", lambda w:_shutdown())
        
        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(self.load_anim, False, False, 0)
        editor_buttons_row.pack_start(self.save_anim, False, False, 0)
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(exit_b, False, False, 0)
        
        # Build window
        left_panel = Gtk.VBox(False, 2)
        left_panel.pack_start(selector_row, False, False, 0)
        left_panel.pack_start(self.value_edit_frame, True, True, 0)

        right_panel = Gtk.VBox(False, 0)
        right_panel.pack_start(preview_info_row, False, False, 0)
        right_panel.pack_start(self.preview_monitor, False, False, 0)
        right_panel.pack_start(control_panel, False, False, 0)
        right_panel.pack_start(range_row, False, False, 0)
        right_panel.pack_start(render_vbox, True, True, 0)
    
        right_panel.set_margin_left(4)
        
        sides_pane = Gtk.HBox(False, 2)
        sides_pane.pack_start(left_panel, False, False, 0)
        sides_pane.pack_start(right_panel, False, False, 0)

        pane = Gtk.VBox(False, 2)
        pane.pack_start(sides_pane, False, False, 0)
        pane.pack_start(editor_buttons_row, False, False, 0)
        
        align = guiutils.set_margins(pane, 2, 12, 12, 12)

        # Connect global key listener
        #self.connect("key-press-event", _global_key_down_listener)

        # Set pane and show window
        self.add(align)
        self.set_title(_("Natron Animations"))
        self.set_position(Gtk.WindowPosition.CENTER)
        #self.set_widgets_sensitive(False)
        self.show_all()
        self.set_resizable(False)
        #self.set_active_state(False)

        self.update_render_status_info()
        self.change_animation()
예제 #15
0
파일: gmic.py 프로젝트: iloveooz/flowblade
    def __init__(self):
        GObject.GObject.__init__(self)
        self.connect("delete-event", lambda w, e:_shutdown())

        app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowblademedialinker.png")
        self.set_icon(app_icon)

        # Load media row
        load_button = Gtk.Button(_("Load Clip"))
        load_button.connect("clicked",
                            lambda w: self.load_button_clicked())
        self.media_info = Gtk.Label()
        self.media_info.set_markup("<small>no clip loaded</small>")#"<small>" + "video_clip.mpg, 1920x1080,  25.0fps" + "</small>" )
        load_row = Gtk.HBox(False, 2)
        load_row.pack_start(load_button, False, False, 0)
        load_row.pack_start(guiutils.get_pad_label(6, 2), False, False, 0)
        load_row.pack_start(self.media_info, False, False, 0)
        load_row.pack_start(Gtk.Label(), True, True, 0)
        load_row.set_margin_bottom(4)

        # Clip monitor
        black_box = Gtk.EventBox()
        black_box.add(Gtk.Label())
        bg_color = Gdk.Color(red=0.0, green=0.0, blue=0.0)
        black_box.modify_bg(Gtk.StateType.NORMAL, bg_color)
        self.monitor = black_box  # This could be any GTK+ widget (that is not "windowless"), only its XWindow draw rect 
                                  # is used to position and scale SDL overlay that actually displays video.
        self.monitor.set_size_request(MONITOR_WIDTH, MONITOR_HEIGHT)

        left_vbox = Gtk.VBox(False, 0)
        left_vbox.pack_start(load_row, False, False, 0)
        left_vbox.pack_start(self.monitor, True, True, 0)

        self.preview_info = Gtk.Label()
        self.preview_info.set_markup("<small>" + _("no preview") + "</small>" )
        preview_info_row = Gtk.HBox()
        preview_info_row.pack_start(self.preview_info, False, False, 0)
        preview_info_row.pack_start(Gtk.Label(), True, True, 0)
        preview_info_row.set_margin_top(6)
        preview_info_row.set_margin_bottom(8)

        self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview)

        right_vbox = Gtk.VBox(False, 2)
        right_vbox.pack_start(preview_info_row, False, False, 0)
        right_vbox.pack_start(self.preview_monitor, True, True, 0)

        # Monitors panel
        monitors_panel = Gtk.HBox(False, 2)
        monitors_panel.pack_start(left_vbox, False, False, 0)
        monitors_panel.pack_start(Gtk.Label(), True, True, 0)
        monitors_panel.pack_start(right_vbox, False, False, 0)

        # Control row
        self.tc_display = guicomponents.MonitorTCDisplay()
        self.tc_display.use_internal_frame = True
        self.tc_display.widget.set_valign(Gtk.Align.CENTER)
        self.tc_display.use_internal_fps = True
        
        self.pos_bar = positionbar.PositionBar(False)
        self.pos_bar.set_listener(self.position_listener)
        pos_bar_frame = Gtk.Frame()
        pos_bar_frame.add(self.pos_bar.widget)
        pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        pos_bar_frame.set_margin_top(5)
        pos_bar_frame.set_margin_bottom(4)
        pos_bar_frame.set_margin_left(6)
        pos_bar_frame.set_margin_right(2)
        
        self.control_buttons = glassbuttons.GmicButtons()
        pressed_callback_funcs = [prev_pressed,
                                  next_pressed,
                                  mark_in_pressed,
                                  mark_out_pressed,
                                  marks_clear_pressed,
                                  to_mark_in_pressed,
                                  to_mark_out_pressed]
        self.control_buttons.set_callbacks(pressed_callback_funcs)
        
        self.preview_button = Gtk.Button(_("Preview"))
        self.preview_button.connect("clicked", lambda w: render_preview_frame())
                            
        control_panel = Gtk.HBox(False, 2)
        control_panel.pack_start(self.tc_display.widget, False, False, 0)
        control_panel.pack_start(pos_bar_frame, True, True, 0)
        control_panel.pack_start(self.control_buttons.widget, False, False, 0)
        control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0)
        control_panel.pack_start(self.preview_button, False, False, 0)

        preview_panel = Gtk.VBox(False, 2)
        preview_panel.pack_start(monitors_panel, False, False, 0)
        preview_panel.pack_start(control_panel, False, False, 0)
        preview_panel.set_margin_bottom(8)

        # Script area
        self.preset_label = Gtk.Label("Preset Script:")
        
        self.preset_select = Gtk.ComboBoxText()
        self.preset_select.set_tooltip_text(_("Select Preset G'Mic script"))
        for gmic_script in _scripts:
            self.preset_select.append_text(gmic_script.name)
            print gmic_script.script
        self.preset_select.set_active(0)
        self.preset_select.connect('changed', lambda w:  self.update_script_view())

        preset_row = Gtk.HBox(False, 2)
        preset_row.pack_start(self.preset_label, False, False, 0)
        preset_row.pack_start(guiutils.pad_label(6, 12), False, False, 0)
        preset_row.pack_start(self.preset_select, False, False, 0)
        preset_row.pack_start(Gtk.Label(), True, True, 0)

        self.script_view = Gtk.TextView()
        self.script_view.set_sensitive(False)
        self.script_view.set_pixels_above_lines(2)
        self.script_view.set_left_margin(2)

        script_sw = Gtk.ScrolledWindow()
        script_sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        script_sw.add(self.script_view)
        script_sw.set_size_request(MONITOR_WIDTH - 100, 125)

        self.out_view = Gtk.TextView()
        self.out_view.set_sensitive(False)
        self.out_view.set_pixels_above_lines(2)
        self.out_view.set_left_margin(2)
        fd = Pango.FontDescription.from_string("Sans 8")
        self.out_view.override_font(fd)

        out_sw = Gtk.ScrolledWindow()
        out_sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        out_sw.add(self.out_view)
        out_sw.set_size_request(MONITOR_WIDTH - 150, 100)
        
        script_vbox = Gtk.VBox(False, 2)
        script_vbox.pack_start(preset_row, False, False, 0)
        script_vbox.pack_start(script_sw, True, True, 0)
        script_vbox.pack_start(out_sw, True, True, 0)

        # Render panel
        self.mark_in_label = guiutils.bold_label("Mark In:")
        self.mark_out_label = guiutils.bold_label("Mark Out:")
        self.length_label = guiutils.bold_label("Length:")
        
        self.mark_in_info = Gtk.Label("-")
        self.mark_out_info = Gtk.Label("-")
        self.length_info = Gtk.Label("-")

        in_row = guiutils.get_two_column_box(self.mark_in_label, self.mark_in_info, 150)
        out_row = guiutils.get_two_column_box(self.mark_out_label, self.mark_out_info, 150)
        length_row = guiutils.get_two_column_box(self.length_label, self.length_info, 150)
        
        marks_row = Gtk.VBox(False, 2)
        marks_row.pack_start(in_row, True, True, 0)
        marks_row.pack_start(out_row, True, True, 0)
        marks_row.pack_start(length_row, True, True, 0)

        self.out_folder = Gtk.FileChooserButton(_("Select Folder"))
        self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
        self.out_folder.set_current_folder(os.path.expanduser("~") + "/")
        self.out_label = Gtk.Label(label=_("Frames Folder:"))
        
        self.frame_name = Gtk.Entry()
        self.frame_name.set_text("frame")
        self.extension_label = Gtk.Label()
        self.extension_label.set_markup("<small>XXXX.png</small>")

        out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \
                            self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \
                            guiutils.pad_label(2, 2), self.extension_label])

        self.encode_check_label = Gtk.Label("Encode Video")
        self.encode_check = Gtk.CheckButton()
        self.encode_check.set_active(False)
        
        self.encode_settings_button = Gtk.Button(_("Encoding settings"))
        self.encode_desc = Gtk.Label()
        self.encode_desc.set_markup("<small>"+ "MPEG-2, 3000kbps" + "</small>")
        
        encode_row = Gtk.HBox(False, 2)
        encode_row.pack_start(self.encode_check, False, False, 0)
        encode_row.pack_start(self.encode_check_label, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0)
        encode_row.pack_start(self.encode_settings_button, False, False, 0)
        encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0)
        encode_row.pack_start(self.encode_desc, False, False, 0)
        encode_row.pack_start(Gtk.Label(), True, True, 0)
        encode_row.set_margin_bottom(6)

        self.render_percentage = Gtk.Label("0%")
        
        self.render_status_info = Gtk.Label()
        self.render_status_info.set_markup("<small>"+ "52 frames, requiring 768MB dis space, video file: ../movie.mpg" + "</small>")

        render_status_row = Gtk.HBox(False, 2)
        render_status_row.pack_start(self.render_percentage, False, False, 0)
        render_status_row.pack_start(Gtk.Label(), True, True, 0)
        render_status_row.pack_start(self.render_status_info, False, False, 0)

        render_status_row.set_margin_bottom(6)

        self.render_progress_bar = Gtk.ProgressBar()
        self.render_progress_bar.set_valign(Gtk.Align.CENTER)

        self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32)
        self.render_button = guiutils.get_sized_button(_("Render"), 100, 32)
        self.render_button.connect("clicked", lambda w:render())

        render_row = Gtk.HBox(False, 2)
        render_row.pack_start(self.render_progress_bar, True, True, 0)
        render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        render_row.pack_start(self.stop_button, False, False, 0)
        render_row.pack_start(self.render_button, False, False, 0)

        render_vbox = Gtk.VBox(False, 2)
        render_vbox.pack_start(marks_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(encode_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(out_folder_row, False, False, 0)
        render_vbox.pack_start(Gtk.Label(), True, True, 0)
        render_vbox.pack_start(render_status_row, False, False, 0)
        render_vbox.pack_start(render_row, False, False, 0)
        render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0)
        
        # Script work panel
        script_work_panel = Gtk.HBox(False, 2)
        script_work_panel.pack_start(script_vbox, False, False, 0)
        script_work_panel.pack_start(guiutils.pad_label(12, 2), False, False, 0)
        script_work_panel.pack_start(render_vbox, True, True, 0)

        self.load_script = Gtk.Button(_("Load Script"))
        #load_layers.connect("clicked", lambda w:self._load_layers_pressed())
        self.save_script = Gtk.Button(_("Save Script"))
        #save_layers.connect("clicked", lambda w:self._save_layers_pressed())

        info_b = guiutils.get_sized_button(_("Info"), 150, 32)
        exit_b = guiutils.get_sized_button(_("Close"), 150, 32)
        
        editor_buttons_row = Gtk.HBox()
        editor_buttons_row.pack_start(self.load_script, False, False, 0)
        editor_buttons_row.pack_start(self.save_script, False, False, 0)
        editor_buttons_row.pack_start(Gtk.Label(), True, True, 0)
        editor_buttons_row.pack_start(info_b, False, False, 0)
        editor_buttons_row.pack_start(guiutils.pad_label(96, 2), False, False, 0)
        editor_buttons_row.pack_start(exit_b, False, False, 0)

        # Build window
        pane = Gtk.VBox(False, 2)
        pane.pack_start(preview_panel, False, False, 0)
        pane.pack_start(script_work_panel, False, False, 0)
        pane.pack_start(editor_buttons_row, False, False, 0)

        align = guiutils.set_margins(pane, 12, 12, 12, 12)

        # Set pane and show window
        self.add(align)
        self.set_title(_("G'MIC Effects"))
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_widgets_sensitive(False)
        self.show_all()
        self.set_resizable(False)
        self.set_active_state(False)