def save_state(self, path: Union[(pathlib.Path, str)], filename: str='scene.blend', pack_textures: bool=True):
    path = pathlib.Path(path)
    path.mkdir(parents=True, exist_ok=True)
    if pack_textures:
        bpy.ops.file.pack_all()
    bpy.ops.wm.save_mainfile(filepath=str((path / filename)))
def save_state(self, path: Union[(pathlib.Path, str)], filename: str='scene.blend', pack_textures: bool=True):
    path = pathlib.Path(path)
    path.mkdir(parents=True, exist_ok=True)
    if pack_textures:
        bpy.ops.file.pack_all()
    bpy.ops.wm.save_mainfile(filepath=str((path / filename)))