Itoo Software Forum

Author Topic: random seed  (Read 481 times)

JTP Vis

  • Full Member
  • ***
  • Posts: 107
random seed
« on: November 18, 2016, 05:56:02 PM »
Hi,

I'm trying to create a RC building using various components around a multi-layered spline. Basically by changing the id of the underlying spline you get different components showing, therefore making variation in the building.

What I want to do next is allow, say the brick elements, to be any one of 5 options across the building. I can make them all be the same material, and I can make that material changeable, but what I really want to achieve is that when I attach my RC object to a spline, it automatically randomises the selection of the material form the 5 IDs in the multi-sub material.

I hope that makes sense and i hope someone can shed light on it. If you need more information, please ask and I'll try to provide.

Cheers,

Bill

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1396
Re: random seed
« Reply #1 on: November 21, 2016, 10:14:37 AM »
Hi Bill,

The Material Operator set in the Random mode in corresponding range (From 1 to 5) should do the trick. Just please double check, that material IDs correspond to the Replace Material ID value (by default 1).

I would suggest you to check the chapter "4 - How to Control Material IDs and UVWs" of our Next Steps with RailClone guide for detailed explication of this topic and useful hints.

Best regards,

JTP Vis

  • Full Member
  • ***
  • Posts: 107
Re: random seed
« Reply #2 on: November 21, 2016, 01:49:11 PM »
Hi Michal,

Thanks for getting back to me. I've read through most of that how-to, and I'm quite familiar with the randomisation features of railclone, at least I think I am, but I still can't get the randomisation to work for this particular railclone. I have a feeling that there is something fundamental that I am missing, but it could also be tied into the complexity of the RC object.

I using a single spline object, with different IDs and verts, and different sub-splines, to drive 18 linear 1S generators. There may even be some ways to optimise to reduce this number, but at the moment that's the way I have it. I have 17 segment objects, which I am trying to drive the materials of, in two basic sets. For this reason, I have each of the objects wired to a material Operator, which in turn has the "replace material id" set to the curent mat id on the base object, 11 for instance. For each operator I have exported the "from" and "to" parameters and for each set, wired them to a "Random" parameter. So I have two "random" parameters in the RC object that drive the two materials that can be randomised. I have tried turning on, and off the "seed" check button, with aparently no effect. I have also tried adding a random parameter wired into the seed value, but with no effect.

When I talk about effect, I am specifically talking about making a new RC object, and selecting the preset that I've put in my library and attaching it to a new spline. What is frustrating is that each RC object produces the same looking building. I have also tried making the "seed" value into a settable parameter, which has met with some success, but I have to set it each time, which is not really the point.

I have also observed another oddity, which is this: under the "general" tab of the RC object, there is a "Random seed" setting, which I would assume should be different for every RC object created, i.e. it's a random seed that should drive the randomness, but for me, using RC Pro 2.7.4 this "random seed" figure is always "123456".

Anyway, I hope I have not missed something more fundamental on this topic, and hope this information helps.

If someone from iToo would like to seem my RC object, please let me know where to send it to and I'll send the max file.

I look forward to responcses.

Cheers,

Bill

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1396
Re: random seed
« Reply #3 on: November 21, 2016, 03:25:39 PM »
Hi Bill,

I would suggest you to have the Seed option disabled within the Random Operator(s) and this way use the global Random Seed value defined under the General roll-out. The default Random Seed value (123456) can be easily modified for each RC object via maxscript. Attaching a simple "rcRandomSeed" script, hope you'll find it useful for this kind of scenarios.

Please feel free to send us your scene to check it here. Thanks in advance.

Best regards,
« Last Edit: November 22, 2016, 02:01:26 PM by Michal Karmazín »

JTP Vis

  • Full Member
  • ***
  • Posts: 107
Re: random seed
« Reply #4 on: November 21, 2016, 06:39:25 PM »
Hi Michal,

quick reply to your script:

It selects all the RC objects, then applies a random seed to them, but it applies the same random seed, so they are all still the same!

I'll keep looking into this.

Cheers,

Bill

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1396
Re: random seed
« Reply #5 on: November 22, 2016, 03:25:21 PM »
Hi Bill,

My apologies, you're totally right, yesterday I uploaded by mistake a wrong version of the "rcRandomSeed" script, which wasn't working correctly. I've just replaced it by the correct version.

Best regards,