feat: reset scene

This commit is contained in:
Radionic
2023-10-03 12:36:50 +08:00
parent 788596525e
commit e4cfb86114
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -70,6 +70,6 @@ class AvatarMainOutput(blender_node.ObjectOps):
)
import global_bpy
global_bpy.reset_bpy()
global_bpy.set_should_reset_scene(True)
return {"ui": {"gltfFilename": {filepath.replace(f"{self.output_dir}/", "")}, "SHAPE_FLOW": {SHAPE_FLOW}, "auto_save": {'true' if auto_save else 'false'},}}
+11 -1
View File
@@ -1,9 +1,19 @@
import bpy
global_bpy = bpy
should_reset_scene = True
def set_should_reset_scene(value):
global should_reset_scene
should_reset_scene = value
def get_bpy():
global global_bpy
global global_bpy, should_reset_scene
if should_reset_scene:
reset_bpy()
should_reset_scene = False
return global_bpy