Select Page
Using velocity to scale MASH points

MASH measures the velocity of all the points travelling in a network. To see the speed of your objects you can add a Points node and set the mode to Velocity, you will then see each point’s velocity printed in the viewport:

 

So how about a practical use for this, well, the Colour node has a build in ‘Use Velocity’ checkbox, which will use an object’s velocity as a multiplier for the colour, so slow objects are dark, and fast objects are bright.

But if you want to move on to something more complex, you need to add the Python node, rest assured, this couldn’t be easier.
The following script will scale objects according to their speed, it was used to produce the above animation.

  1. Add a Python node
  2. Copy and paste the script into it.
 

The available channels are:

  • md.velocity: A list of translational magnitudes (the speed of the point’s movement)
  • md.angularVelocity: The same thing but for rotation.
  • md.velocityVec: A tuple containing the magnitudes for each axis (x, y, z)
  • md.angularVelocityVec: The same thing but for rotation.

Their corresponding output arrays (though I don’t know why you’d want to set these!) are:

  • md.outVelocity
  • md.outAngularVelocity
  • md.outVelocityVec
  • md.outAngularVelocityVec