2
$\begingroup$

I want to setup basic node tree using Python operator and I cannot use compositor context. Hint over node values pointed to this data path:

bpy.data.node_groups["Compositing Nodetree"].nodes["Alpha Over"].premul

but this collection: bpy.data.node_groups includes only custom node groups.

$\endgroup$

1 Answer 1

3
$\begingroup$

This bug report: https://developer.blender.org/T35720 pointed me to the right data path. When you want to modify the node tree in compositor, then you have to use the following path:

bpy.data.scenes['Scene'].node_tree.nodes['Alpha Over'].premul

or you can use the following syntax to avoid the hard-coded name of the scene (the current scene will be used):

bpy.context.scene.node_tree.nodes['Alpha Over'].premul

and it just works. :-)

$\endgroup$
2
  • $\begingroup$ You can also use bpy.context.scene.node_tree.nodes to avoid hardcoding the name for the scene. $\endgroup$
    – JakeD
    Sep 9, 2016 at 14:58
  • $\begingroup$ @pycoder you are right. Thanks for reminder. I will update answer. $\endgroup$
    – JiriHnidek
    Sep 12, 2016 at 7:45

You must log in to answer this question.

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