I'm improving my AC3D exporter. Right now, a linked group (displayed and treated as an empty) will not have any children (unless I parent a local object to them) despite holding many objects (from the linked file). Is there a way to get a list of children from a linked group?
$\begingroup$
$\endgroup$
You need to create a dupli-list. eg:
def object_derived_get(ob, scene):
if ob.dupli_type != 'NONE'
ob.dupli_list_create(scene)
ob_matrix_pairs = [(dob.object, dob.matrix.copy()) for dob in ob.dupli_list]
ob.dupli_list_clear()
else:
ob_matrix_pairs = [(ob, ob.matrix_world.copy())]
return ob_matrix_pairs
# example
import bpy
from bpy import context
for ob, matrix in dupli_list_create(context.object, context.scene):
print(ob, matrix)
Seealso: