0
$\begingroup$

Wondering how I could switch a collection to "Indirect Only" in Blender 2.8 with Python.

So far I have found this:

bpy.ops.outliner.collection_indirect_only_set()

And this:

bpy.context.scene.indirect_only = True

As you can see none of these will work. As far as I understand it I need some kind of bpy.data function that would effectively allow me to choose which collection (using it's name, or "keys()") to set as Indirect Only.

$\endgroup$
1
$\begingroup$

You can enable Indirect Only for the currently active collection (as indicated in the outliner) by using:

bpy.context.view_layer.active_layer_collection.indirect_only = True
$\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.