Пример #1
0
    def set_video_endoding(self, clip):
        current_profile_index = mltprofiles.get_profile_index_for_profile(
            current_sequence().profile)
        # These need to re-initialized always when using this module.
        toolsencoding.create_widgets(current_profile_index, True, True)
        toolsencoding.widgets.file_panel.enable_file_selections(False)

        # Create default render data if not available, we need to know profile to do this.
        if self.container_data.render_data == None:
            self.container_data.render_data = toolsencoding.create_container_clip_default_render_data_object(
                current_sequence().profile)

        encoding_panel = toolsencoding.get_encoding_panel(
            self.container_data.render_data, True)

        #if self.container_data.render_data == None and toolsencoding.widgets.file_panel.movie_name.get_text() == "movie":
        #    toolsencoding.widgets.file_panel.movie_name.set_text("_gmic")

        align = dialogutils.get_default_alignment(encoding_panel)

        dialog = Gtk.Dialog(
            _("Container Clip Render Settings"), gui.editor_window.window,
            Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
            (_("Cancel"), Gtk.ResponseType.REJECT, _("Set Encoding"),
             Gtk.ResponseType.ACCEPT))
        dialog.vbox.pack_start(align, True, True, 0)
        dialogutils.set_outer_margins(dialog.vbox)
        dialog.set_resizable(False)

        dialog.connect('response', self.encode_settings_callback)
        dialog.show_all()
Пример #2
0
def show_blender_container_clip_program_editor(callback, program_info_json):
    # Create panels for objects
    editors = []
    blender_objects = program_info_json["objects"]
    materials = program_info_json["materials"]
    objs_panel = _get_panel_and_create_editors(blender_objects, _("Objects"),
                                               editors)
    materials_panel = _get_panel_and_create_editors(materials, _("Materials"),
                                                    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)

    # Create and show dialog
    dialog = Gtk.Dialog(
        _("Blender Project Edit"), gui.editor_window.window,
        Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
        (_("Cancel"), Gtk.ResponseType.REJECT, _("Save Changes"),
         Gtk.ResponseType.ACCEPT))

    alignment = dialogutils.get_default_alignment(pane)
    dialogutils.set_outer_margins(dialog.vbox)
    dialog.vbox.pack_start(alignment, True, True, 0)

    dialog.set_default_response(Gtk.ResponseType.REJECT)
    dialog.set_resizable(False)
    dialog.connect('response', callback, editors)
    dialog.show_all()
Пример #3
0
    def _load_program_edit_info_callback(self, dialog, response_id):
        if response_id != Gtk.ResponseType.ACCEPT:
            dialog.destroy()
        else:
            load_file_path = dialog.get_filename()
            dialog.destroy()
            if load_file_path == None:
                return

            load_file = open(load_file_path, "r")
            loaded_project_edit_info = json.load(load_file)

            primary_txt = _("Container Program Edit Data is Executable!")
            secondary_txt = _(
                "Only accept Container Program Edit Data from similar trustwothy sources\nyou would accept applications!\n\nContainer Program Edit Data will be used to call Python <b>exec()</b> function and\ncan maybe used as an attack vector against your system."
            )
            warning_panel = dialogutils.get_warning_message_dialog_panel(
                primary_txt, secondary_txt)

            sw = guicomponents.get_scroll_widget((300, 200),
                                                 str(loaded_project_edit_info))

            content = Gtk.VBox(False, 2)
            content.pack_start(warning_panel, False, False, 0)
            content.pack_start(
                guiutils.bold_label("Loaded Container Program Edit Data"),
                False, False, 0)
            content.pack_start(sw, False, False, 0)

            align = dialogutils.get_default_alignment(content)

            dialog = Gtk.Dialog(
                "", gui.editor_window.window,
                Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
                (_("Cancel"), Gtk.ResponseType.REJECT,
                 _("Load Program Edit Data"), Gtk.ResponseType.ACCEPT))
            dialog.vbox.pack_start(align, True, True, 0)
            dialogutils.set_outer_margins(dialog.vbox)
            dialog.set_resizable(False)
            dialog.connect('response', self._load_warning_callback,
                           loaded_project_edit_info)

            dialog.show_all()
Пример #4
0
def _display_single_instance_window():
    GObject.source_remove(timeout_id)
    primary_txt = _("Batch Render Queue already running!")

    msg = _("Batch Render Queue application was detected in session dbus.")

    content = dialogutils.get_warning_message_dialog_panel(primary_txt, msg, True)
    align = dialogutils.get_default_alignment(content)

    dialog = Gtk.Dialog("",
                        None,
                        Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
                        (_("OK").encode('utf-8'), Gtk.ResponseType.OK))

    dialog.vbox.pack_start(align, True, True, 0)
    dialogutils.set_outer_margins(dialog.vbox)
    dialogutils.default_behaviour(dialog)
    dialog.connect('response', _early_exit)
    dialog.show_all()
Пример #5
0
def show_blender_container_clip_program_editor(callback, blender_objects):
    # Create panels for objects
    panels = []
    editors = []
    for obj in blender_objects:
        # object is [name, type, editors_list] see blenderprojectinit.py
        editors_data_list = obj[2]
        editors_panel = Gtk.VBox(True, 2)
        for editor_data in editors_data_list:
            prop_path, label_text, tooltip, editor_type, value = editor_data
            editor_type = int(editor_type)
            editor = get_editor(editor_type, (obj[0], prop_path), label_text, value, tooltip)
            editor.blender_editor_data = editor_data # We need this the later to apply the changes.
            editors.append(editor)
            
            editors_panel.pack_start(editor, False, False, 0)

        if len(editors_data_list) > 0:
            panel = guiutils.get_named_frame(obj[0] + " - " + obj[1], editors_panel)
            panels.append(panel)
        
    # Create and show dialog
    dialog = Gtk.Dialog(_("Blender Project Edit"), gui.editor_window.window,
                        Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
                        (_("Cancel"), Gtk.ResponseType.REJECT,
                         _("Save Changes"), Gtk.ResponseType.ACCEPT))

    pane = Gtk.VBox(False, 2)
    for panel in panels:
        pane.pack_start(panel, False, False, 0)

    alignment = dialogutils.get_default_alignment(pane)
    dialogutils.set_outer_margins(dialog.vbox)
    dialog.vbox.pack_start(alignment, True, True, 0)

    dialog.set_default_response(Gtk.ResponseType.REJECT)
    dialog.set_resizable(False)
    dialog.connect('response', callback, editors)
    dialog.show_all()
Пример #6
0
def _encode_settings_clicked():
    toolsencoding.create_widgets(_current_profile_index, True)
        
    global _encoding_panel
    _encoding_panel = toolsencoding.get_enconding_panel(_render_data)

    if _render_data == None and toolsencoding.widgets.file_panel.movie_name.get_text() == "movie":
        toolsencoding.widgets.file_panel.movie_name.set_text(os.path.basename(_current_path).split(".")[0] + "_gmic")

    align = dialogutils.get_default_alignment(_encoding_panel)
    
    dialog = Gtk.Dialog(_("Video Encoding Settings"),
                        _window,
                        Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
                        (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT,
                         _("Set Encoding").encode('utf-8'), Gtk.ResponseType.ACCEPT))
    dialog.vbox.pack_start(align, True, True, 0)
    dialogutils.set_outer_margins(dialog.vbox)
    dialog.set_resizable(False)

    dialog.connect('response', _encode_settings_callback)
    dialog.show_all()
Пример #7
0
def show_blender_container_clip_program_editor(callback, program_info_json):
    # Create panels for objects
    editors = []
    blender_objects = program_info_json["objects"]
    materials = program_info_json["materials"]
    curves = program_info_json["curves"]

    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(blender_objects) + len(materials) + len(curves)
    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 editorste.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)

    # Create and show dialog
    dialog = Gtk.Dialog(
        _("Blender Project Edit"), gui.editor_window.window,
        Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
        (_("Cancel"), Gtk.ResponseType.REJECT, _("Save Changes"),
         Gtk.ResponseType.ACCEPT))

    if add_scroll == True:
        alignment = dialogutils.get_default_alignment(sw)
    else:
        alignment = dialogutils.get_default_alignment(pane)

    dialogutils.set_outer_margins(dialog.vbox)
    dialog.vbox.pack_start(alignment, True, True, 0)

    dialog.set_default_response(Gtk.ResponseType.REJECT)
    dialog.set_resizable(False)
    dialog.connect('response', callback, editors)
    dialog.show_all()