...
An example:
You want to read out an item’s particle friction and increase it with each frame. The best idea is to first read out the initial value. Lets say you have added a vase here. The script you are using is a simulation events type and located under "FramesPost".
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
increment = 0.001 vase = scene.getObject("Vase01") particle_friction = vase.getParameter("Particle friction") new_particle_friction = particle_friction + increment vase.setParameter("Particle friction", new_particle_friction) scene.message(str(new_particle_friction)) |
...
As you can see it is not necessary to introduce any counters or loops for increasing the parameter. This is done automatically with each new frame. Another thing you will surely have noticed is a fundamental difference between the “get” and “set” statement:
...
In case you want to set the values with an appropriate attribute, you have to use the following syntax:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
node.setParameter("Position.X", 5.0) node.setParameter("Position.Y", 2.3) node.setParameter("Position.Z", 1.6) |
...