def create_icon(self): action_object = containeractions.get_action_object(self.container_data) surface, length = action_object.create_icon() self.icon = surface self.length = length self.container_data.unrendered_length = length - 1
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)
def run(self): action_object = containeractions.get_action_object( self.container_clip_data) is_valid, err_msg = action_object.validate_program() time.sleep(0.5) # To make sure text is seen. Gdk.threads_enter() self.dialog.destroy() if is_valid == True: container_clip = ContainerClipMediaItem( PROJECT().next_media_file_id, self.container_clip_data.get_unrendered_media_name(), self.container_clip_data) PROJECT().add_container_clip_media_object(container_clip) _update_gui_for_media_object_add() else: primary_txt = _("G'Mic Container Clip Validation Error") dialogutils.warning_message(primary_txt, err_msg, gui.editor_window.window) Gdk.threads_leave()
def create_icon(self): action_object = containeractions.get_action_object(self.container_data) if self.icon_path == None: surface, length, icon_path = action_object.create_icon() self.icon = surface self.icon_path = icon_path self.length = length self.container_data.unrendered_length = length - 1 else: self.icon = action_object.load_icon()
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)
def create_icon(self): try: action_object = containeractions.get_action_object( self.container_data) if self.icon_path == None: surface, length, icon_path = action_object.create_icon() self.icon = surface self.icon_path = icon_path self.length = length self.container_data.unrendered_length = length - 1 else: self.icon = action_object.load_icon() except: self.icon_path = respaths.IMAGE_PATH + FALLBACK_THUMB cr, scaled_icon = containeractions._create_image_surface( self.icon_path) self.icon = scaled_icon
def _add_fluxity_rendered_help_media_complete(created_unrendered_clip_path, container_data): rand_id_str = str(os.urandom(16)) clip_id_str = hashlib.md5(rand_id_str.encode('utf-8')).hexdigest() unrendered_clip_path = userfolders.get_data_dir( ) + appconsts.CONTAINER_CLIPS_UNRENDERED + "/" + clip_id_str + ".mp4" os.replace(created_unrendered_clip_path, unrendered_clip_path) container_data.unrendered_media = unrendered_clip_path container_data.unrendered_type = appconsts.VIDEO throw_away_clip = current_sequence().create_file_producer_clip( unrendered_clip_path, "dummy", False, None) throw_away_clip.container_data = container_data throw_away_clip.container_data.generate_clip_id() action_object = containeractions.get_action_object(container_data) action_object.plugin_create_render_complete_callback = _plugin_create_render_complete_callback action_object.render_full_media(throw_away_clip)
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)
def set_video_endoding(data): clip, track, item_id, item_data = data action_object = containeractions.get_action_object(clip.container_data) action_object.set_video_endoding(clip)
def render_full_media(data): clip, track, item_id, item_data = data action_object = containeractions.get_action_object(clip.container_data) action_object.render_full_media(clip)
def get_rendered_thumbnail(self): action_object = containeractions.get_action_object(self) return action_object.get_rendered_thumbnail()
def clone_clip(clip): action_object = containeractions.get_action_object(clip.container_data) return action_object.clone_clip(clip)
def edit_program(data): clip, track, item_id, item_data = data action_object = containeractions.get_action_object(clip.container_data) action_object.edit_program(clip)
def switch_to_unrendered_media(data): clip, track, item_id, item_data = data action_object = containeractions.get_action_object(clip.container_data) action_object.switch_to_unrendered_media(clip)
def set_render_settings_from_create_window(container_data, callback): action_object = containeractions.get_action_object(container_data) action_object.set_video_endoding(None, callback)