Itoo Software Forum

Author Topic: Some segments of a color, some of another.  (Read 1613 times)

UP1808

  • Newbie
  • *
  • Posts: 31
Some segments of a color, some of another.
« 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

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 843
    • iToo
Re: Some segments of a color, some of another.
« Reply #1 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:




2nd, more elegant- little arithmetic involved:



see atached max file

Rokas
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: Some segments of a color, some of another.
« Reply #2 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 ......



Hope that helps,

Cheers,

Paul
Paul Roberts
iToo Software

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 843
    • iToo
Re: Some segments of a color, some of another.
« Reply #3 on: July 16, 2014, 05:22:10 PM »
yes, 3rd way is the best ;)
Rokas
iToo Software

UP1808

  • Newbie
  • *
  • Posts: 31
Re: Some segments of a color, some of another.
« Reply #4 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!



Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 843
    • iToo
Re: Some segments of a color, some of another.
« Reply #5 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:
Rokas
iToo Software

UP1808

  • Newbie
  • *
  • Posts: 31
Re: Some segments of a color, some of another.
« Reply #6 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.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3319
    • iToo Software
Re: Some segments of a color, some of another.
« Reply #7 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.
Carlos Quintero
iToo Software