Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beta1] Blender Collection instances are not exported #32

Open
emanuelegissi opened this issue May 29, 2022 · 0 comments
Open

[beta1] Blender Collection instances are not exported #32

emanuelegissi opened this issue May 29, 2022 · 0 comments

Comments

@emanuelegissi
Copy link
Member

Currently Blender Collection instances are not exported to the FDS case.
This is rather easy to fix.

Here is a basic demo on how to append all object names in selection as well as the object names of the selected collection instances to one list and and count the items:

import bpy
C = bpy.context
objs = []
for ob in C.selected_objects:    
    if ob.instance_type == 'COLLECTION':
        for ob_col in ob.instance_collection.objects:
            objs.append(ob_col.name)
    else:
        objs.append(ob.name)
print ("{} objects in selection".format(len(objs)))

I am also wondering if collection.children_recursive gets Collection instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant