Move Anim_Setup module into Blender_Kitsu #5

Merged
Nick Alberelli merged 27 commits from :feature/merge_anim_setup_into_blender_kitsu into master 2023-04-05 17:38:41 +02:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit b23172c9c2 - Show all commits

View File

@ -334,6 +334,12 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences):
default="ANI-", default="ANI-",
) )
user_exec_code: bpy.props.StringProperty(# type: ignore
name="Post Execution Command",
description="Run this command after shot_builder is complete, but before the file is saved.",
default="",
)
session: Session = Session() session: Session = Session()
tasks: bpy.props.CollectionProperty(type=KITSU_task) tasks: bpy.props.CollectionProperty(type=KITSU_task)
@ -425,6 +431,7 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences):
start_frame_row.prop(self, "shot_builder_frame_offset", text="") start_frame_row.prop(self, "shot_builder_frame_offset", text="")
box.row().prop(self, "shot_builder_armature_prefix") box.row().prop(self, "shot_builder_armature_prefix")
box.row().prop(self, "shot_builder_action_prefix") box.row().prop(self, "shot_builder_action_prefix")
box.row().prop(self, "user_exec_code")
# Misc settings. # Misc settings.
box = layout.box() box = layout.box()

View File

@ -229,6 +229,9 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
context.scene.frame_start = addon_prefs.shot_builder_frame_offset context.scene.frame_start = addon_prefs.shot_builder_frame_offset
context.scene.frame_end = frame_length + addon_prefs.shot_builder_frame_offset context.scene.frame_end = frame_length + addon_prefs.shot_builder_frame_offset
# Run User Script
exec(addon_prefs.user_exec_code)
self._file_path = shot_builder.build_context.shot.file_path self._file_path = shot_builder.build_context.shot.file_path
self._built_shot = True self._built_shot = True
return {'RUNNING_MODAL'} return {'RUNNING_MODAL'}