...
getNodeType()
has to be substituted through a node-specific command, e.g.get_DY_Domain("DY_"), getObject("Sphere01"), getDaemon("Drag_Force01")
, etc.parameter_name
is the name of the parameter as shown in the node's "Node Params" panel, for example"Strength", "Resolution", "Visibility", "Dynamics", "Velocity"
, and so on.value
depends on the node's parameter type. Values can vectors, integers, strings, floats, or Booleans (True
orFalse
). Strings have to be written in quotes, e.g."Active rigid body"
Examples:
Code Block |
---|
gravityDaemon = scene.getDaemon("Gravity01") capsuleObject = scene.getObject("Capsule01") hybridoEmitter = scene.get_HY_Emitter("HY_Emitter01") sceneCamera = scene.getCamera("SceneCamera01") gravityDaemon.setParameter("Strength", 3.6) # Float capsuleObject.setParameter("Dynamics", "Soft body") # String hybridoEmitter.setParameter("Visibility", False) # Boolean sceneCamera.setParameter("Width", 1280) # Integer |
With loops it is possible to perform changes on parameters for several nodes at once:
Code Block |
---|
sceneObjects = scene.getObjects()
for singleObject in sceneObjects:
singleObject.setParameter("Color", Vector.new(255, 0, 0))
singleObject.setParameter("Dynamics", "Active rigid body")
singleObject.setParameter("Mass", 10.75)
singleObject.setParameter("Cell size", 0.25) |