Home / Xpresso / Xpresso Anonymous / Goodies


Xpresso goodies


This part isn't a tutorial on a specific problem and it's solution, but an introduction to several smaller goodies. Single nodes that are realy usefull and smaller setups that make your life easier.

Range Mapper

Let's start with the Range Mapper node. This is maybe the single most usefull node in Xpresso and used very often. The basic purpose is to convert a value from one range to another, either linear or by using a function curve represented by a spline gadget.
Does not sound very fancy, but the possibilities are unlimited. From simple conversion (percent to degree, radians to length, etc.) to a defined falloff for functions.
Let's have a short look at the properties:
  • Data Type: Only Real and Vector values can be used. Vector is especialy usefull to smoothly move between two positions or rotations
  • Input/Output Range: Several common ranges are available as presets
  • Clamp Lower/Upper: If the input value goes below or above the defined input range the output value will not exceed it's defined range. For example you have defined 0-1 as input range and 0-100 as output range. With clamping on an input value of 1.5 will give you 100, with clamping off it will be interpolated linear to 150
  • Modulo: If the input range is exceeded the output range will start anew. Lets use the same ranges as before. With Modulo on a value of 1.5 will give you 50 and so will 2.5, -1.5 etc.
  • Reverse: Will invert the output range
  • Use Spline: Instead of interpolating linear the spline will be used to calculate the output value. The spline can only be used inside the set range, if the input value exceeds the range and clamping as well as modulo are off the output value will be interpolated linear
  • Spline Resolution: This defines the precision with which the spline is calculated. The better the slower the calculation will be
You will find a rather simple but usefull example on how to use the Rangemapper to automate a setup here. The range mapper is used to combine several, partly non linear, animations into one simple to use parameter. Instead of animating two values with different function curves you only need to animate one value in a linear way. movie

Object List iterator

The ObjectList operator is realy usefull if you want to perform an action on a number of objects that are otherwise independent from another. ObjectList is completely independent from any hierarchy, the objects are assigned via an include list. As you can see the main part of the setup only consists two nodes, the ObjectList node and an object node to adress the objects. All the other nodes are only there to calculate a rotational value for our example.
In the example all objects in the list of the ObjectList node are rotated around there local y axis (heading). scene movie

Ray Collision

The Ray Collision node works very much like a rytracer. A ray is cast from one point to another and a collision with a surface that is inbetween these points is detected. We are using this node to create a small tool that can help us placing objects on surfaces.
Of course this can be used for animation too.
The idea is to use two Null objects as points between which the ray is cast to place an object at the point where the ray is colliding with another object.

Most of the setup consists of things we already know. The parameters are provided as Properties of the Xpresso tag (Info) and we know the Alignment to Rotation conversion from the coordinates example. scene
What is left is a brief explanation on the data we get from Ray Collision.
There are several more values we get, have a look in the manual on what they do and how you can improve this setup by using one or more of them too.
Ray Collision will always give you the first polygon of the collision object that it intersects and it only works with polygon objects.
One way to improve this setup is by using the Object List iterator to check several objects on collision. Keep in mind though that if there is more then one object colliding with the ray only the last one that is checked will be used to place the object.
Another improvement is to place the object at a defined distance above the collision surface by moving the object along the face normal. This can be done by simply multiplying the normal by a given length and adding this to the position. scene movie
Back to Xpresso Anonymous