コード例 #1
0
ファイル: containerclip.py プロジェクト: 5l1v3r1/flowblade
def _blender_clip_create_dialog_callback(dialog, response_id, data):
    dialog.destroy()

    if response_id != Gtk.ResponseType.ACCEPT:
        dialog.destroy()
    else:
        project_select = data[0]
        project_file = project_select.get_filename()
        
        dialog.destroy()
    
        if project_file == None:
            _show_not_all_data_info()
            return

        container_clip_data = ContainerClipData(appconsts.CONTAINER_CLIP_BLENDER, project_file, None)
        
        action_object = containeractions.get_action_object(container_clip_data)
        action_object.initialize_project(project_file) # blocks until info data written

        project_edit_info_path = userfolders.get_cache_dir() + "blender_container_projectinfo.json"
        info_file = open(project_edit_info_path, "r")
        project_edit_info = json.load(info_file)
        print(project_edit_info)
        
        length = int(project_edit_info["frame_end"]) - int(project_edit_info["frame_start"])
        container_clip_data.data_slots["project_edit_info"] = project_edit_info
        container_clip_data.editable = True
        container_clip_data.unrendered_length = length

        blender_unrendered_media_image = respaths.IMAGE_PATH + "unrendered_blender.png"

        window_text = _("<b>Creating Container for Blender Project:</b> ") + container_clip_data.get_program_name() + ".blend"
 
        containeractions.create_unrendered_clip(length, blender_unrendered_media_image, container_clip_data, _blender_unredered_media_creation_complete, window_text)
コード例 #2
0
def _blender_clip_create_dialog_callback(dialog, response_id, data):
    dialog.destroy()

    if response_id != Gtk.ResponseType.ACCEPT:
        dialog.destroy()
    else:
        project_select = data[0]
        project_file = project_select.get_filename()

        dialog.destroy()

        if project_file == None:
            _show_not_all_data_info()
            return

        container_clip_data = ContainerClipData(
            appconsts.CONTAINER_CLIP_BLENDER, project_file, None)

        action_object = containeractions.get_action_object(container_clip_data)

        is_valid, err_msg = action_object.validate_program()
        if is_valid == False:
            primary_txt = _("Blender Container Clip Validation Error")
            dialogutils.warning_message(primary_txt, err_msg,
                                        gui.editor_window.window)
            return

        action_object.initialize_project(
            project_file)  # blocks until info data written

        project_edit_info_path = userfolders.get_cache_dir(
        ) + "blender_container_projectinfo.json"
        if editorstate.app_running_from == editorstate.RUNNING_FROM_FLATPAK:
            project_edit_info_path = userfolders.get_user_home_cache_for_flatpak(
            ) + "blender_container_projectinfo.json"

        info_file = open(project_edit_info_path, "r")
        project_edit_info = json.load(info_file)

        length = int(project_edit_info["frame_end"]) - int(
            project_edit_info["frame_start"])
        container_clip_data.data_slots["project_edit_info"] = project_edit_info
        container_clip_data.editable = True
        container_clip_data.unrendered_length = length

        blender_unrendered_media_image = respaths.IMAGE_PATH + "unrendered_blender.png"

        window_text = _("Creating Container for Blender Project")

        containeractions.create_unrendered_clip(
            length, blender_unrendered_media_image, container_clip_data,
            _blender_unredered_media_creation_complete, window_text)
コード例 #3
0
    def run(self):
        action_object = containeractions.get_action_object(
            self.container_clip_data)
        is_valid, err_msg = action_object.validate_program()

        # Media plugins have plugin data created with user set values, scripts loaded from file system
        # do not and just had it created in 'action_object.validate_program()'
        if self.plugin_data != None:
            # For media plugins use provided user edited creation data.
            self.container_clip_data.data_slots[
                "fluxity_plugin_edit_data"] = self.plugin_data

        time.sleep(0.5)  # To make sure text is seen.

        if self.dialog != None:
            Gdk.threads_enter()
            self.dialog.destroy()

            if is_valid == False:
                primary_txt = _(
                    "Flowblade Media Plugin Container Clip Validation Error")
                dialogutils.warning_message(primary_txt, err_msg,
                                            gui.editor_window.window)

            Gdk.threads_leave()

        if is_valid == False:
            Gdk.threads_enter()
            primary_txt = _(
                "Flowblade Media Plugin Container Clip Validation Error")
            dialogutils.warning_message(primary_txt, err_msg,
                                        gui.editor_window.window)
            Gdk.threads_leave()
            return

        data_object = self.container_clip_data.data_slots[
            "fluxity_plugin_edit_data"]
        length = data_object["length"]
        fluxity_unrendered_media_image = respaths.IMAGE_PATH + "unrendered_fluxity.png"
        window_text = _("Creating Container for Flowblade Media Plugin...")
        containeractions.create_unrendered_clip(
            length, fluxity_unrendered_media_image, self.container_clip_data,
            _fluxity_unredered_media_creation_complete, window_text)
コード例 #4
0
def create_renderered_fluxity_media_item(container_data, length):
    fluxity_unrendered_media_image = respaths.IMAGE_PATH + "unrendered_fluxity.png"
    containeractions.create_unrendered_clip(
        length, fluxity_unrendered_media_image, container_data,
        _add_fluxity_rendered_help_media_complete, "Please wait")