[Blender_Kitsu] Shot_Builder fix lighting task type #9

Merged
Nick Alberelli merged 2 commits from :fix/lighting-task-type into master 2023-04-17 19:09:07 +02:00
Showing only changes of commit 037577588d - Show all commits

View File

@ -165,10 +165,7 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
{'ERROR'}, "Operator is not able to determine the project root directory. \nCheck project root directiory is configured in 'Blender Kitsu' addon preferences.")
return {'CANCELLED'}
if not addon_prefs.is_editorial_dir_valid:
self.report(
{'ERROR'}, "Shot builder is dependant on a valid editorial export path and file pattern. \nCheck Preferences, errors appear in console")
return {'CANCELLED'}
self.production_root = addon_prefs.project_root_dir
self.production_name = project.name
@ -194,6 +191,11 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
return cast(Set[str], context.window_manager.invoke_props_dialog(self, width=400))
def execute(self, context: bpy.types.Context) -> Set[str]:
addon_prefs = bpy.context.preferences.addons["blender_kitsu"].preferences
if self.task_type == 'anim' and not addon_prefs.is_editorial_dir_valid:
self.report(
{'ERROR'}, "Shot builder is dependant on a valid editorial export path and file pattern. \nCheck Preferences, errors appear in console")
return {'CANCELLED'}
wm = context.window_manager
self._timer = wm.event_timer_add(0.1, window=context.window)
wm.modal_handler_add(self)
@ -201,9 +203,9 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
self.report(
{'ERROR'}, "Shot builder can only be started from the File menu. Shortcuts like CTRL-N don't work")
return {'CANCELLED'}
if self._built_shot:
return {'RUNNING_MODAL'}
addon_prefs = bpy.context.preferences.addons["blender_kitsu"].preferences
ensure_loaded_production(context)
production = get_active_production()
shot_builder = ShotBuilder(