Scenario 3 - Floor plates are RailClone objects

In some cases it may be possible to use RailClone to create floor plates. When using RailClone you will have to use the UV mode as described in the previous section, but using RailClone has advantages because it allows you to parametrise the randomisation of the floor plate's UVWs to create distribution variations on each floor. This means there is no need to use the UVW unwrap modifier to manually assign each floor plate to a unique UV space.

Randomising UVWs using the XForm Operator (works with RailClone lite)

In this exercise we'll use RailClone to create a vertical array of floors. To do this:

Create a new RailClone object. Go to the Style rollout and click to open the Style Editor Add a new L1S generator. Right click on the generator and go to Export Parameters > Geometry > X Size. Create a new Numeric node, change Properties > Type to Scene Units and wire it to the exported X Size property of the generator. Create a new Segment node, go to its properties and pick Rectangular Floor Plate from the scene. Wire the Segment to the Default or Evenly input of the Generator. If you use the Evenly input you can adjust the spacing between floors using the generator's Properties > Rules > Evenly > Distance value. Rotate the whole RailClone object 90 degrees on the Y Axis so that the building is vertical. To use RailClone as a surface in Forest Pack, it's necessary to turn off the instancing engine and be sure that the full mesh displays in the viewports. To do this go to the Display rollout and turn Off Use Instancing Engine and set the Display > Viewport mode to Mesh. Now let's apply the furniture to this. Select the Forest Object and open the Surfaces rollout. Delete the existing surface. Click to add a new surface and select the RailClone object. The mode is already set to UV so we don't need to change anything here. You'll notice that the distribution is the same for each floor, as in Scenario 2, this is because each floor shares the same UVW space. Let's fix this in RailClone. Select the RailClone object and open the Style Editor. Add a new UVW XForm node and wire it between the existing segment and the generator. Go to the UVW XForm node's Properties and turn on Random > Offset. Enter a value of -1cm for the U and VMin and 1cm for the Max. As with the UVW modifier, 1 scene unit equals 1 UV unit. By using these values we're ensuring that the randomisation keeps the UVs within the white area of the map that we created earlier in the tutorial. You should now see that the distribution is randomised on each floor! If you change the X Size parameter of the RailClone object you can add additional floors and the Forest object will update automatically.

Preventing interpenetration with the façade

We're using UV mode, so the best way to control the scatter is still using the distribution map as described earlier. The only real difference is that we only need to edit a single floor mesh, because RailClone will duplicate the geometry on every level. This also explains why we make the white area of the distribution map extend slightly beyond 0 -1 UV space. If we didn't the UVW XForm randomisation effect could cause unwanted black areas to appear in the distribution map.

Use UVWs to control the rotation of objects

If you look closely at the alignment of the desks in relation to the building perimeter, you'll notice that they are all facing the same way, irrespective of which side of the building they are on. Ideally we'd like the desks to rotate to remain in the same alignment in relation to the building's footprint. We can't use the transform by map settings for this because the desk, chairs and computer are grouped, so they'll only rotate around their ownlocal axis. Luckily though, we can achieve this effect by aligning the scattered objects using the surfaces UVs. Here's how:

UV Align can be found in the surfaces rollout. It's on by default but you can change it from here if you want to turn it on or off. Select the floor plate source geometry called Rectangular Floor Plate. Select the existing Unwrap UVW modifier in the stack and open the UV Editor. We need to make the outside face of the building align with the U axis. To do this detach each side and rotate it so that it look like this. If you look at the desks now you'll notice that they remain aligned with the exterior face of the building. if you swap the rectilinear floor for the circular one, you can see this effect more clearly.

Creating the RailClone interior, an alternative approach (Compatible with RailClone Lite)

In this example, instead of using RailClone to create a stack of surfaces, we can use it to add a 2 dimensional array of rooms around the perimeter of the building. This style uses two room models -one with and one without a wall - and 4 corner segments with different internal wall configurations. The more of these you add the greater variation you can achieve inside the building.

The rooms have already been mapped so that the perimeter's UVW are moved to the black area of the existing distribution map using the technique described above. In addition there's a V-Ray light material on the ceiling that we can randomise in RailClone to turn lights on and off. Let's use these objects and create a new style:

Create a new RailClone object. Go to the Display rollout and set the Viewport Mode to Mesh and turn off Use Instancing Engine. Open the Style editor. We're going to create a new node graph with the following features: An A2S Generator allows us to create a 2D array. The building footprint defines the X axis and the building's height defines the Y Axis. A number of "room" Segments. This example only uses a few but you could add more for greater variety. Randomise operators select from the room segments at random. The Transform operator adds padding to the corner segments to make the corners work correctly. Material operators randomise the ceiling material to turn lights on and off UVW XForm operators randomise the UVs to create variation in the Forest Pack scatter for each segment. To create this, start with a new A2S Generator and set the X Rotation value to 90 degrees. This rotates the array's Y axis so that it is aligned with the world's Z axis. Go to the generator's Properties > Rules > X Corner group and set Bevel Mode to None. This will prevent the corner geometry from being sliced. Turn of Align to Path so that the corners align with the preceding spline segment. Add a new Spline node and select building_spline from the scene. Wire the node to the Generator's X Spline input. Export the generator's Y Size parameter and wire it to a new Numeric node. Change the numeric node type to Scene Units and enter a value of 12000.0cm. Now we'll add some segments. Create two new segment nodes and change the Properties > Alignment > Z value to Pivot. Select the segment nodes, open the Properties and pick the rooms named Default1 and Default2 from the scene. Wire the the segment nodes to a new Randomize operator. To add more variety you could also add a Mirror operator, wire it to the randomise operator, then to the default1 segment to created a flipped version of that room. Wire the Randomise operator to a new Material operator. Set the Material node's Properties as shown below.

For all the polygons with a Material ID of 6, this operator is randomising them between ID 5 which allocates a material with the lights switched off, and ID 6 which contains a material with the lights turned on. Wire the Material node to a new UVW XForm operator. To randomise distribution, set the XForm node's properties as in the image below. Now wire the UVW XForm operator to the Generator's default input. Next we'll add the corners. Create four new Segment nodes and change the Properties > Alignment > X & Z value to Pivot. (Lite users are restricted to using up to 3 segments per style so will only be able to add a single corner segment) Use these segments to pick Corner1, Corner2, Corner3, and Corner4 from the scene. Wire these to a new Randomise operator. Duplicate the existing Material and UVW XForm operators and wire them to the Randomise operator and the Generator's Corner input. If you look at the corner you'll see there is a problem with overlapping segments. To resolve this we need to add Right Padding to the Corner segments. Add a new Transform operator between the Randomise and the Material nodes. Right click on the node and export the parameter Padding > Right Padding. Right click on the corner's randomise node and export the attribute Size > X. Wire the X Size attribute to the Right Padding parameter. The Corner's right padding is now exactly the same size as it's dimension on the X axis! This completes the building interior. We can now apply the Forest Pack object to it. Select the furniture Forest Pack object and open the Surface rollout. Delete the existing surface and add the new RailClone object instead. You'll notice that objects are being scattered on the ceilings and walls. To prevent this we need to limit the scatter to only those polygons which are facing upwards. You can do this using the Limit to Slope controls in the Surface rollout. Turn on Slope Range > Limited and enter a Max value of 5.

You can now use the same technique to add some people. To do this;

Duplicate the existing Forest Pack, go to the Geometry rollout and delete all the items except Null. Click on Add Multiple and pick the Male and Female characters. Adjust their probability until you get the desired distribution. A low value of 2% or 3% works well. Because we duplicated the existing furniture Forest Pack object, they share the same distribution points. This results in characters stood in the middle of desks. To move the grid so that the characters stand between the furniture we can use the Transform > Translate feature. Open the Transform rollout, enable Translation and enter Min and Max value of -30 (or until the grid is adequately offset). You could also turn on Rotation randomisation to add a little more variety.

We've now populated the interior of this building with people and furniture. Moreover this entire set-up is fully parametric. If we change the size of the base spline, the rooms, furniture and people all update automatically!