# Itoo Software Forum

## RailClone => RailClone Pro (*) => Topic started by: UP1808 on July 16, 2014, 04:25:31 PM

Title: Some segments of a color, some of another.
Post by: UP1808 on July 16, 2014, 04:25:31 PM
Hi!
I have a single spline like path and a single box segment linked both to a Linera1S generator. The box object has material ID 1.

The railclone has a multisubobject material applied with 2 sub-materials: mat 1 color red, material 2 color blue.

Along the spline there are 30 boxes instance

I'd like the first 10 boxes (from 1 to 10) to have material ID 1, then boxes from 11 to 20 material ID 2 and finally from 21 to 30 material ID again 1.

Is it possible? Maybe managing the Material and Conditional node.. I don't know.. I will start to nose bleed when I think too hard :)

Thanks
Title: Re: Some segments of a color, some of another.
Post by: Rokas on July 16, 2014, 05:07:35 PM
two methods i can think of

1st simple- you create 20 material submaterial and cycle through all of those:
(http://i.imgur.com/uTeC7BJ.jpg)

(http://i.imgur.com/a4g8LP4.jpg)

2nd, more elegant- little arithmetic involved:

(http://i.imgur.com/Gw6qFXf.jpg)

see atached max file

Title: Re: Some segments of a color, some of another.
Post by: Paul Roberts on July 16, 2014, 05:17:13 PM
Hi,

Thanks again Rokas, here's a third way.

Use your existing material and  assuming that the object's material ID is already set to 1 a material nodes to change the ID to 2. Plug both of these into a sequence operator  and set the counts to 10. This will create a repeating pattern of 10 x ID 1, 10 x ID2, 10 x ID1 ......

(http://lonelymonk.com/forum_images/edc510a8a17b4b94922bea440e1ca8e3.jpg)

Hope that helps,

Cheers,

Paul
Title: Re: Some segments of a color, some of another.
Post by: Rokas on July 16, 2014, 05:22:10 PM
yes, 3rd way is the best ;)
Title: Re: Some segments of a color, some of another.
Post by: UP1808 on July 17, 2014, 07:16:19 PM
Damn guys... it works... in the meantime I was waiting I've tried with two Conditionals operators:

www.ossosso.com/scambio/shoot10.JPG

Here the result for this project:

www.ossosso.com/scambio/sample.jpg

Even if I haven't a programmer mind this project has been more complicated it could seem.

There are three kinds of width dimension (mixed in the same row), two kinds of armrest (one for the ends and one for the middle) and three kinds of colors.

The build of all the nodes has not been so fluid, probably due to my limitated knowledge of the plugin, but I'd like to ask you a question I have ad after the creation of this project:
-Does is it possible to create a sort of Instance of some nodes? So when I change parameter on one of them it takes effect also on the others. For example when I have a lot of segments sometime I need to use more then one "Linear 1S Generator" into the same RailClone object (indetical Linear 1S Generator), and each time I have to set parameters for each of them.

I repeat: probably my way to set nodes are not "correct" or "professional"

Anyway, thank you very much for your always fast and good support.

Bye!

Title: Re: Some segments of a color, some of another.
Post by: Rokas on July 17, 2014, 09:35:57 PM
Quote
-Does is it possible to create a sort of Instance of some nodes? So when I change parameter on one of them it takes effect also on the others. For example when I have a lot of segments sometime I need to use more then one "Linear 1S Generator" into the same RailClone object (indetical Linear 1S Generator), and each time I have to set parameters for each of them.

do you mean like this:
(http://i.imgur.com/yIaZyxq.jpg)
Title: Re: Some segments of a color, some of another.
Post by: UP1808 on July 18, 2014, 09:22:32 AM
Yes I suppose, so if I need for example to use the same value for distance of the "Evenly" for both Generator, I simply extract the "distance" parameter and I connect on both a numeric node. Well yes, I think it make lighter the system.

Thank you.
Title: Re: Some segments of a color, some of another.
Post by: iToo on July 18, 2014, 10:04:06 AM
Yes I suppose, so if I need for example to use the same value for distance of the "Evenly" for both Generator, I simply extract the "distance" parameter and I connect on both a numeric node. Well yes, I think it make lighter the system.

That's it. If you don't want to expose the value, can use a "Constant" node instead.