Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: Rio on August 09, 2021, 12:47:55 PM

Title: Building generator with specific height and colour constraints.
Post by: Rio on August 09, 2021, 12:47:55 PM
I did this previously with a spline at each floor level and a 2SArray set to 1 floor height, these splines were segmented and given ID for specific facade units, the seperate colours were controlled by 3 seperate Railclone objects with different materials assigned. The different building height were controlled just by copying up the splines by the number of floors required for each block.

I'm sure there must be a neater way to do this, need to be able to control the heights to specific value, and the colours. Can someone give me a nudge as to a better way of doing it? Can the height of 2SArrays be controlled by some parameter on the base object? Either that or I think maybe I could at least link each RCobject to a master style, so I'm only editing one object?

Any thoughts on best practice appreciated.

Thanks.

Title: Re: Building generator with specific height and colour constraints.
Post by: Paul Roberts on August 09, 2021, 03:19:31 PM
Hi,
Thanks for the question. There are several ways of doing this. Attached is a technique that uses RailClone Spline Markers instead of Vertices to divide up the facade. It works using a few interesting techniques, including:

- Uses a Selector node set to X Spline Marker ID to choose facade elements. RC Spline Marker is added to the base spline and you can change the ID property to choose where to place new facade elements without having to add additional vertices to the base spline.
 - Also uses Markers to set colour In this example I've also used the first User Data property to set the colour. To change the material I'm using a Material node which allows you to change a segment's material IDs.
 - Height is set by multiplying the height of a facade element by the number of floors and wiring the result to the Generator's Y Size property. I've set the number of floors using the Spline's Material ID value.

I hope that helps,

Paul

Title: Re: Building generator with specific height and colour constraints.
Post by: Rio on August 10, 2021, 12:29:27 PM
Thanks so much for that, I knew there was probably a better way. I'll have a look later today. Building height by Spline ID sounds ideal.
Title: Re: Building generator with specific height and colour constraints.
Post by: Rio on August 11, 2021, 01:18:54 PM
Thanks again for your great file, I've transfered it across to my scene/ geo and it's working great so far. One question I still have: is there any way of just randomising the selection of the facade components on the X spline direction rather than using the markers to select them (I'm just being lazy here, I've a lot of splines to get around).

The closest I've got is plugging a random interger in to the selector index. However whilst it's possible to do in the Y Row, there isn't an option to generate the random index on the X row
Title: Re: Building generator with specific height and colour constraints.
Post by: Paul Roberts on August 11, 2021, 01:46:05 PM
No problem at all,

You can randomise segments on the X-Axis either using a Randomise node, or using a Random Integer wire to a selector with Generate on set to Segment.

(https://i.imgur.com/wTdNxTI.png)

I hope that helps.

Paul
Title: Re: Building generator with specific height and colour constraints.
Post by: Rio on August 11, 2021, 04:06:46 PM
If I'm not mistaken both of those will randomise on X and Y axis? I need random on X only

Thanks.
Title: Re: Building generator with specific height and colour constraints.
Post by: Paul Roberts on August 11, 2021, 05:25:23 PM
Ah, I understand what you mean now. Please take a look at the attached file.

To achieve this I've changed the graph a little so that we are now nesting generators. There are now two A2S generators that create single columns: one for the corners, and one for the main facade. These are then wired to a L1S generator to distribute them along the spline. Each time the nested generator is used it is re-randomised (achieved by setting the Random Number node's mode to Generator).

Colours are still taken from the RCSpline markers, but it this case it is now only one marker needed per sub-spline to set the colour.

I hope it helps, please let me know if you have any questions about the style.

Paul
Title: Re: Building generator with specific height and colour constraints.
Post by: Rio on August 11, 2021, 05:58:54 PM
Amazing! That is indeed a massive help, I'm going to have to get my head around how that works.

I managed to get a solution that I think also works quite well, just using your original setup, with a sequence operator and a random number (1-2) plugged in to that, it's a little bit random, not completely :)
Title: Re: Building generator with specific height and colour constraints.
Post by: Rio on August 11, 2021, 06:41:49 PM
That worked an absolute treat, and I learnt a few things too, like how to do roofs! thanks again
Title: Re: Building generator with specific height and colour constraints.
Post by: Paul Roberts on August 12, 2021, 09:10:17 AM
That looks great! Glad we could help out,

Paul
Title: Re: Building generator with specific height and colour constraints.
Post by: Rio on October 21, 2021, 01:52:19 PM
Hi Paul, just coming back to this, I'm trying to control the roof colours with markers too, is this possible? The difference being that the roof area is defined by a clipping area, rather than as a standard array. I would need to vary the roof colour independantly to the walls, so is it possible to dop this with another RCspline mod on top of the other one, or another layer of user data?