feat: collection children relations

This commit is contained in:
Swann Martinez 2019-08-12 14:46:48 +02:00
parent 91940837ee
commit 75bbdf8248
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1
2 changed files with 14 additions and 3 deletions

@ -1 +1 @@
Subproject commit e10c375e3139e0d390de236d8f78cb55d14eed81
Subproject commit 769cf1f52415192689ffb8cf0f3dc36fa4ed1a1f

View File

@ -66,8 +66,19 @@ def add_datablock(datablock):
if hasattr(datablock, "data"):
child.append(add_datablock(datablock.data))
if datablock.uuid and client.exist(datablock.uuid):
if hasattr(datablock, "materials"):
for mat in datablock.materials:
child.append(add_datablock(mat))
if hasattr(datablock, "collection") and hasattr(datablock.collection, "children"):
for coll in datablock.collection.children:
child.append(add_datablock(coll))
if hasattr(datablock, "children"):
for coll in datablock.children:
child.append(add_datablock(coll))
if hasattr(datablock, "objects"):
for obj in datablock.objects:
child.append(add_datablock(obj))
if hasattr(datablock,'uuid') and datablock.uuid and client.exist(datablock.uuid):
return datablock.uuid
else:
new_uuid = client.add(datablock, childs=child)