Skip to main content

Migrating to 4.x

RailClone 4 involved several changes to the core that might affect styles created in RailClone 3 or below. Below are some explanations, tips and tricks to help you migrate your workflows and existing styles to RailClone 4.

Chained Transform Operators

In RailClone 3 if you chained together multiple Transform nodes, the order would not make any difference. To illustrate, in the following examples, two transform operators are used: one for translate and another to Rotate. In the top chain we are using Translate then Rotate in the bottom chain it's the reverse, Rotate then Translate.

Notice that changing the order in RailClone 3 makes absolutely no difference to the outcome.

But in RailClone 4 the order makes a difference. In the first chain the segment is rotated then translated on the X axis. notice that the rotation did not affect the axis orientation as used by the translation operation. The result is the same as RailClone 3.

However, in the second chain the segment is translated first, and the rotation then occurs using the segment's original pivot position. It's important to understand that the pivot does not move with the segment.

tip

If you find it more intuitive to imagine that the pivots move and rotate with the object instead of remaining at their original position, all you need to do it imagine the order of transform nodes is backwards instead of forwards. Looking at it this way, in the top row and reading backwards, the segment is translated first and then rotated using its modified pivot position. In the second row, the segment is rotated, then translated along the local axis of its modified pivot.

In a single Transform node, Scale operations now occur before Rotation

In RailClone 3. when rotating and scaling in a single Transform node, the rotate operation would be carried out first, followed by scale. This resulted in skewed geometry as shown below. In RailClone 4 the scale operation occurs before rotation resulting in geometry that scales along the local axes as expected.

In older styles, users may have used two Transform operators to fix the skewing issue. This is no longer necessary.

Changes to the Compose operator

The Compose operator allows you to assemble two or more segments in a group. In RailClone 3 the bounding box of geometry grouped in this way was calculated based on the first segment in the Compose operator. For the purposes of determining the position of adjacent segments, the others were ignored.

For example, imagine that you have five segments attached to a Compose node in Group mode. It would appear as follows (all the pivots are aligned to the centre of Segment 1):

In RailClone 3 only segment 1's bounding box is used to calculate how the items are assembled along the spline, causing the adjacent segments to overlap.

To fix this in RailClone 3 you would edit the Right Padding of Segment 1.

As you can see, this is not terribly intuitive. so in RailClone 4 it now works more like 3ds Max's Groups. All segments are forced to use Pivot Alignment node and the bounding box is calculated based on the extents of all the segments wired to the Compose operator. There is no longer any need to adjust the padding for the first segment. If you do still want to adjust the padding, the recommended approach is to add a Transform operator after the Compose node and adjust it from there, just as though the composed geometry was a regular Segment.

You can also use this transform operator to change the Alignment. Setting all 3 axes to Pivot will give you the same behaviour as RailClone 3. Therefore, if you have RailClone 3 styles to update to RailClone 4, do the following:

  1. Add a Transform operator after the existing Compose node.

  2. Enable Alignment.

  3. Change the X. Y and Z axis to Pivot

  4. If necessary, enable Padding and adjust the spacing.

Reset Created Version to use updated features

To retain compatibility with older scenes, some features use RailClone 3's algorithms even when opened in RailClone 4. If you would like to update an old style to use RailClone 4's changes just select the object and run the following Maxscript:

$.railclone.resetCreatedVersion()