Move Anim_Setup
module into Blender_Kitsu
#5
@ -12,9 +12,11 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def save_shot_builder_file(file_path):
|
def save_shot_builder_file(file_path: str):
|
||||||
file_path = pathlib.Path(file_path)
|
"""Save Shot File within Folder of matching name.
|
||||||
file_path.mkdir(parents=True, exist_ok=True)
|
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)
|
bpy.ops.wm.save_mainfile(filepath=file_path, relative_remap=True)
|
||||||
|
|
||||||
class SaveFileStep(BuildStep):
|
class SaveFileStep(BuildStep):
|
||||||
|
@ -130,10 +130,10 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
|
|||||||
|
|
||||||
if self._built_shot and self._add_vse_area:
|
if self._built_shot and self._add_vse_area:
|
||||||
if self.auto_save:
|
if self.auto_save:
|
||||||
file_path = pathlib.Path(self._file_path)
|
file_path = pathlib.Path()
|
||||||
try:
|
try:
|
||||||
save_shot_builder_file(file_path)
|
save_shot_builder_file(self._file_path)
|
||||||
self.report({"INFO"}, f"Saved Shot{self.shot_id} at {file_path}")
|
self.report({"INFO"}, f"Saved Shot{self.shot_id} at {self._file_path}")
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
self.report({"ERROR"}, f"Cannot create a file/folder when that file/folder already exists {file_path}")
|
self.report({"ERROR"}, f"Cannot create a file/folder when that file/folder already exists {file_path}")
|
||||||
|
Loading…
Reference in New Issue
Block a user