fix: prevent matrix_parent_inverse from being reset by loading parents only if its necessary
This commit is contained in:
parent
19c56e590b
commit
cc5a87adb8
@ -300,8 +300,14 @@ class BlObject(BlDatablock):
|
||||
if 'display' in data:
|
||||
loader.load(target.display, data['display'])
|
||||
|
||||
# Parent
|
||||
if 'parent' not in data and target.parent:
|
||||
# Parenting
|
||||
parent_id = data.get('parent_id')
|
||||
if parent_id:
|
||||
parent = bpy.data.objects[parent_id]
|
||||
# Avoid reloading
|
||||
if target.parent != parent and parent is not None:
|
||||
target.parent = parent
|
||||
elif target.parent:
|
||||
target.parent = None
|
||||
|
||||
# Pose
|
||||
@ -371,10 +377,6 @@ class BlObject(BlDatablock):
|
||||
dumper.include_filter = [
|
||||
"name",
|
||||
"rotation_mode",
|
||||
"parent",
|
||||
"parent_type",
|
||||
"track_axis",
|
||||
"up_axis",
|
||||
"data",
|
||||
"library",
|
||||
"empty_display_type",
|
||||
@ -419,6 +421,10 @@ class BlObject(BlDatablock):
|
||||
if self.is_library:
|
||||
return data
|
||||
|
||||
# PARENTING
|
||||
if instance.parent:
|
||||
data['parent_id'] = instance.parent.name
|
||||
|
||||
# MODIFIERS
|
||||
if hasattr(instance, 'modifiers'):
|
||||
data["modifiers"] = {}
|
||||
@ -561,6 +567,9 @@ class BlObject(BlDatablock):
|
||||
if self.is_library:
|
||||
deps.append(self.instance.library)
|
||||
|
||||
if self.instance.parent :
|
||||
deps.append(self.instance.parent)
|
||||
|
||||
if self.instance.instance_type == 'COLLECTION':
|
||||
# TODO: uuid based
|
||||
deps.append(self.instance.instance_collection)
|
||||
|
Loading…
x
Reference in New Issue
Block a user