2
$\begingroup$

I need to create instance of collection in python and i cant find any way to do this.

Im stuck because i cant find a way to "set selected" anything in outliner via code and the console command seems to need that:

bpy.ops.outliner.collection_instance()

Is there a way to tell outliner what item to select?

$\endgroup$

1 Answer 1

1
$\begingroup$

Here is the code to create an instance from a collection named "monkeys":

bpy.ops.object.collection_instance_add(collection='monkeys', align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))

and the manual entry describes the arguments.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .