fix: objects parenting error
This commit is contained in:
parent
790f145022
commit
2983195af4
@ -235,6 +235,9 @@ class BlObject(BlDatablock):
|
|||||||
and 'cycles_visibility' in data:
|
and 'cycles_visibility' in data:
|
||||||
loader.load(target.cycles_visibility, data['cycles_visibility'])
|
loader.load(target.cycles_visibility, data['cycles_visibility'])
|
||||||
|
|
||||||
|
if 'parent' in data:
|
||||||
|
target.parent = bpy.data.objects[data['parent']]
|
||||||
|
|
||||||
def _dump_implementation(self, data, instance=None):
|
def _dump_implementation(self, data, instance=None):
|
||||||
assert(instance)
|
assert(instance)
|
||||||
|
|
||||||
@ -251,7 +254,6 @@ class BlObject(BlDatablock):
|
|||||||
"rotation_mode",
|
"rotation_mode",
|
||||||
"parent",
|
"parent",
|
||||||
"data",
|
"data",
|
||||||
"children",
|
|
||||||
"library",
|
"library",
|
||||||
"empty_display_type",
|
"empty_display_type",
|
||||||
"empty_display_size",
|
"empty_display_size",
|
||||||
@ -370,13 +372,6 @@ class BlObject(BlDatablock):
|
|||||||
bone_groups[group.name] = dumper.dump(group)
|
bone_groups[group.name] = dumper.dump(group)
|
||||||
data['pose']['bone_groups'] = bone_groups
|
data['pose']['bone_groups'] = bone_groups
|
||||||
|
|
||||||
# CHILDS
|
|
||||||
if len(instance.children) > 0:
|
|
||||||
childs = []
|
|
||||||
for child in instance.children:
|
|
||||||
childs.append(child.name)
|
|
||||||
|
|
||||||
data["children"] = childs
|
|
||||||
|
|
||||||
# VERTEx GROUP
|
# VERTEx GROUP
|
||||||
if len(instance.vertex_groups) > 0:
|
if len(instance.vertex_groups) > 0:
|
||||||
@ -459,8 +454,8 @@ class BlObject(BlDatablock):
|
|||||||
# Avoid Empty case
|
# Avoid Empty case
|
||||||
if self.instance.data:
|
if self.instance.data:
|
||||||
deps.append(self.instance.data)
|
deps.append(self.instance.data)
|
||||||
if len(self.instance.children) > 0:
|
if self.instance.parent :
|
||||||
deps.extend(list(self.instance.children))
|
deps.append(self.instance.parent)
|
||||||
|
|
||||||
if self.is_library:
|
if self.is_library:
|
||||||
deps.append(self.instance.library)
|
deps.append(self.instance.library)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user