1

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?

janonespe
  • 81
  • 4
  • 1
    Are you looking for a solution using Animation Nodes? It seems you are asking about python but tagged AN. – Omar Emara Apr 05 '18 at 17:11

1 Answers1

3

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
sambler
  • 55,387
  • 3
  • 59
  • 192