6
$\begingroup$

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?

$\endgroup$
5
$\begingroup$

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:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.