# How can i enable composite node in python?

though with the codes i have searched in google , it still doesn't solve the problem, i want to enable one specific composite node like this :

and this is the inactive state:

From inactive state to active state , there is only such script indicated in Google

scene = bpy.context.scene
compositing_node_tree = scene.node_tree
compositing_node_tree.nodes['os_composite'].select = True


But it just functions select node rather than enable node :

How can i enable this specific composite node in python? Thanks if you have any ideas!

• What do you mean by "enabling the node"? Feb 27 '20 at 2:59
• @Pastrokkio after render , Blender will automatically composite the image using the enabled composite node Feb 27 '20 at 4:00
• Just to be sure, you've tried with bpy.context.scene.use_nodes = True ? Feb 27 '20 at 4:03
• @Pastrokkio yes Feb 27 '20 at 5:39

Set active node

Similarly to Set active image node with python

In the python console

C = bpy.context
D = bpy.data

>>> node = C.scene.node_tree.nodes['Composite']
>>> node.select = True
>>> C.scene.node_tree.nodes.active = node
>>>

• Sorry , it doesn't count , set it to active start is still left "select state" rather than active state ,only difference is this time it is white border rather than red bother (which shows in question part image) around that node. Feb 28 '20 at 1:12
• The active state should be a red bar in the top of node rather than red or white border around node, you can refer that in my question image. Feb 28 '20 at 1:14
• Besides , could you please explain what is "C" in your code demo?Thanks Feb 28 '20 at 1:15