fix: reload object after mesh loading to prevent it from loosing vertex_group and shape_keys
This commit is contained in:
parent
0a96643a9f
commit
a91bae3506
@ -54,7 +54,7 @@ class BlMesh(BlDatablock):
|
||||
bl_class = bpy.types.Mesh
|
||||
bl_check_common = False
|
||||
bl_icon = 'MESH_DATA'
|
||||
bl_reload_parent = False
|
||||
bl_reload_parent = True
|
||||
|
||||
def _construct(self, data):
|
||||
instance = bpy.data.meshes.new(data["name"])
|
||||
|
@ -600,9 +600,14 @@ class SessionApply(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
logging.debug(f"Running apply on {self.target}")
|
||||
try:
|
||||
node_ref = session.get(uuid=self.target)
|
||||
session.apply(self.target,
|
||||
force=True,
|
||||
force_dependencies=self.reset_dependencies)
|
||||
if node_ref.bl_reload_parent:
|
||||
for parent in session._graph.find_parents(self.target):
|
||||
logging.debug(f"Refresh parent {parent}")
|
||||
session.apply(parent, force=True)
|
||||
except Exception as e:
|
||||
self.report({'ERROR'}, repr(e))
|
||||
return {"CANCELED"}
|
||||
|
Loading…
Reference in New Issue
Block a user