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 8 additions and 6 deletions
Showing only changes of commit 6e32f66e8b - Show all commits

View File

@ -12,9 +12,11 @@ logger = logging.getLogger(__name__)
def save_shot_builder_file(file_path):
file_path = pathlib.Path(file_path)
file_path.mkdir(parents=True, exist_ok=True)
def save_shot_builder_file(file_path: str):
"""Save Shot File within Folder of matching name.
Set Shot File to relative Paths."""
dir_path = pathlib.Path(file_path)
dir_path.mkdir(parents=True, exist_ok=True)
bpy.ops.wm.save_mainfile(filepath=file_path, relative_remap=True)
class SaveFileStep(BuildStep):

View File

@ -130,10 +130,10 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
if self._built_shot and self._add_vse_area:
if self.auto_save:
file_path = pathlib.Path(self._file_path)
file_path = pathlib.Path()
try:
save_shot_builder_file(file_path)
self.report({"INFO"}, f"Saved Shot{self.shot_id} at {file_path}")
save_shot_builder_file(self._file_path)
self.report({"INFO"}, f"Saved Shot{self.shot_id} at {self._file_path}")
return {'FINISHED'}
except FileExistsError:
self.report({"ERROR"}, f"Cannot create a file/folder when that file/folder already exists {file_path}")