Tutorials

Parametric table layouts with RailClone

We recently released a 10-Second Tip featuring a parametric table style to illustrate how to render using the materials applied to the source geometry. This is particularly handy when you're constructing style using several assets from stock libraries and you don't want to have to manually create a multi-sub object material and remap all the IDs.

To use this feature. there's a simple checkbox in the style rollout, but following the tutorial, we did get some additional questions asking for more information about how to create the actual style itself. In this tutorial, we'll explain how it was done. 

First of all, you'll need to source your assets. For this demonstration, we used a table, a chair and several other related accessories from the Chaos Cosmos library.

Next, we need to prepare our geometry for RailClone. The only thing we need to adapt is the table, which we'll cut into two segments using Slice modifiers. To do this:

  1. Select a table and add a Slice modifier. Enable X Axis, change the mode to Remove Positive and then move the slice plane gizmo so only one end is remaining.
  2. Now we need to create the middle of the table. To that, duplicate the table object as a copy.
  3. Select the existing Slice modifier and change the mode to Remove Negative
  4. Copy and paste the existing Slice modifier, change the mode to Remove Positive,  and move the slice plane so that it's at the other end leaving just the middle section.

With that do you'll have two sections a Start (which will also be used for the end), and the middle section. Now let's create the RailClone object.

  1. Create a new RailClone object and open the Style Editor
  2. Add a new L1S Generator.
  3. Add a Spline node and then pick a spline from the scene. Wire it to the Generator's Spline input
  4. Add a Segment node and pick the table start geometry. Wire it's the Generator's Start input.
  5. To reuse the same segment for the end, wire a Mirror operator to the end input and attach the existing Segment.
  6. Add a new segment node, pick the Middle table section as a source, and wire it to the Default input. Change Z Alignment to Pivot.
  7. To enable the materials applied to the source geometry to be used when rendering, enable the Use Segment Material option found in the Style rollout.
  8. When you render you might still see an issue. Where the end segments meet the middle, there's a cut where the UVs no longer line up. We can get around this by re UV mapping inside of RailClone using the Apply Box Mapping options. Just set a Length, Width and Height and if necessary, rotate the map so the woodgrain orientates correctly. 

That takes care of the table, which can now be any length just by adjusting the spline. Now we want to add the other items such as the chairs, place settings and other accessories.

We'll start with the chairs.

  1. Copy and past the existing generator
  2. Add another Segment node and pick the chair from the scene. Wire the node to the Evenly input.
  3. To change the spacing between the chairs go to the Generator's Rules tab and change the Evenly Distance value.
  4. The chairs will be centred on the spline. To move them to one side use the Generator's Y Offset parameter.
  5. The chairs are very tidy looking. That's not really how things look in real life. So let's mess it up a little bit by going to the Transform settings for the Segment and enabling Translation Randomization using small values for Min and Max X and Y parameters.
  6. Enable and randomize the Rotation a bit too
  7. One side of the table is now done. To do the other side, just enable the Mirror option in the Generator's General settings. You can also flip the geometry itself using the Flip A and Flip B checkboxes.

To create the place settings: 

  1. Clone the chair Generator and Segment.
  2. Select the new Segment, and swap the geometry for the place settings.
  3. You'll see that they're on the ground. To fix that, export the Generator's Z Offset property.
  4. The value I need to input here is the height of the table. Rather than enter it manually. you can export the Z Size of one of the table pieces by right-clicking on a segment and selecting Export Attributes.
  5. Wire the Segment's Z Sizeoutput to the Generator's Z Offset input. The placemats move up to the height of the table automatically.
  6. Adjust Flip A and Flip B so that the place settings are facing the right way. 
  7. Change the Segment's transform randomisation if necessary and adjust the Generator's Y Offset so that they are correctly placed on the table

Finally, we'll add some additional accessories down the centre of the table using another generator:

  1. Create a 4th Generator and wire it to the same spline node
  2. Add a new Segment node and pick an accessory from the scene.
  3. Wire it to the Evenly input.
  4. Once again it's on the floor, so we'll go through the same procedure as we did for the place settings and export the Generator's Z Offset input. Wire it to the Table's Z Size output
  5. You will now have an accessory in the middle of the table. To add a few more, change the Generator's Evenly Distance.
  6. Add some variety using the Segment's Transform Randomisation settings if desired. 
  7. To add additional accessories to the table, wire a Randomize node between the existing segment and the generator. 
  8. Copy and paste the Segment, PIck a new accessory from the scene and wire it to the Randomise node. Repeat for as many accessories as you want to add to the style. 
  9. Finally, you can add occasional gaps instead of populating every Evenly segment with an object. To do this, just add a Segment to the Randomise node but don't select any geometry

We now have a finished style with one Generator used for the table, another for the chairs, a third for the place settings, and finally, a fourth for adding accessories. If we close the Style Editor now, we can assign this easily to multiple splines just by going to the base objects rollout.

We hope you found this quick tip useful. Stay tuned for more videos to help you get the most from RailClone coming soon.

FOREST PACK 7 OUT NOW - SEE THE LIGHT!
FOREST PACK 7 OUT NOW - SEE THE LIGHT!