feat: support empty id_root in actions

This commit is contained in:
Swann
2020-11-03 16:15:34 +01:00
parent 66e55a7eec
commit 664f7635cc
3 changed files with 11 additions and 11 deletions

View File

@ -44,7 +44,7 @@ from . import environment
DEPENDENCIES = {
("replication", '0.1.6'),
("replication", '0.1.7'),
}

View File

@ -92,7 +92,8 @@ def load_fcurve(fcurve_data, fcurve):
if use_numpy:
keyframe_points.add(fcurve_data['keyframes_count'])
np_load_collection(fcurve_data["keyframe_points"], keyframe_points, KEYFRAME)
np_load_collection(
fcurve_data["keyframe_points"], keyframe_points, KEYFRAME)
else:
# paste dumped keyframes
@ -153,7 +154,11 @@ class BlAction(BlDatablock):
dumped_data_path, index=dumped_array_index)
load_fcurve(dumped_fcurve, fcurve)
target.id_root = data['id_root']
id_root = data.get('id_root')
if id_root:
target.id_root = id_root
def _dump_implementation(self, data, instance=None):
dumper = Dumper()

View File

@ -172,12 +172,7 @@ class BlMesh(BlDatablock):
data['vertex_colors'][color_map.name]['data'] = np_dump_collection_primitive(color_map.data, 'color')
# Fix material index
m_list = []
for material in instance.materials:
if material:
m_list.append((material.uuid,material.name))
data['material_list'] = m_list
data['material_list'] = [(m.uuid, m.name) for m in instance.materials if m]
return data