I have a custom node simulating a laser: enter image description here

The node itself is pretty complex with rotations and whatnot, but it's attached to a Lamp object. In short what it does is illuminate a pixel if some conditions are met (mostly boolean checking with some algebra). It's based on this. I have to create a demo to show the laser properties and how it can be tunned and changed. I would like to change the input values of this node (elevation,azimuth, turning around the laser beam axis and laser width/girth) from a python script.

How can I select and change the input values for this node and how can I set them depending on the frame number?

  • 1
    $\begingroup$ Are you looking for a solution using Animation Nodes? It seems you are asking about python but tagged AN. $\endgroup$ – Omar Emara Apr 5 '18 at 17:11

The group node in the material has input sockets and you can set the default_value of each socket. The default_value is used when there is no link to the socket to get a value from another node.

mat = bpy.data.materials['Material']
gr_node = mat.node_tree.nodes['Group']

gr_node.inputs['Elevation'].default_value = 15.3
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.