Itoo Software Forum

Author Topic: variable size by spline ID question  (Read 832 times)

IL2267

  • Newbie
  • *
  • Posts: 8
variable size by spline ID question
« on: October 24, 2018, 12:01:25 PM »
Hello,
I would like to know if there is possible to use a array2S generator with a variable Y size parameter, driven by the base spline ID.

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: variable size by spline ID question
« Reply #1 on: October 24, 2018, 01:49:36 PM »
You can't wire that directly. Maybe there is workaround in Your case. Something like works:

Rokas
iToo Software

IL2267

  • Newbie
  • *
  • Posts: 8
Re: variable size by spline ID question
« Reply #2 on: October 24, 2018, 02:47:08 PM »
Thank's for the reply.
For a better understanding of my question here is a very simplified version of my railclone object and setup.
Currently, the height of the building is set by the No_of_floors parameter.
So, the question is, how can I use the same approach and also have some height variation on the three splines without scaling my segments?

I've managed to do this for the facade, but I cannot link the offset of the roof with the rest of the building.
you can see the issue in the second and third attachment.

IL2267

  • Newbie
  • *
  • Posts: 8
Re: variable size by spline ID question
« Reply #3 on: October 24, 2018, 02:56:43 PM »
I have around 20+ types of buildings that I intend to use for context buildings in our projects. This is ok as long as you have specific building heights. The problem is when you just need to generate a random city.
I need to introduce a random numeric value that would use the spline IDs to add or subtract floors.
Example: I input a value of 10 - all the resulting buildings will have 10 floors
enable variation - this will add/subtract, let's say, 5 floors so the buildings will be from 5 to 15 floors high.

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: variable size by spline ID question
« Reply #4 on: October 24, 2018, 04:53:20 PM »
Nice Building!
You can variate height by using selector node and using arithmetic node with some condition from Your style.
Hope this helps. If not I would love to help You on this one. Please use this form to contact us if You can't attach files publicly.
Also You can use WeTransfer if compressed file is bigger than 6MB and paste the link in the message.

Rokas
iToo Software

IL2267

  • Newbie
  • *
  • Posts: 8
Re: variable size by spline ID question
« Reply #5 on: October 24, 2018, 05:44:47 PM »
Thanks Rokas, I'm sending you the file right now.
If you have any other idea on how to achieve similar result using this workflow for the buildings feel free to give me any tips.


Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: variable size by spline ID question
« Reply #6 on: October 25, 2018, 09:32:51 AM »
Hi

We have tried here to find a solution for You. And I can only suggest Pauls solution- randomize by material ID. Unfortunately no additional variation can be added on top of that.
You can set MatID= 11 and it will be 11 storey building.


Attached scene also script to randomize Editable Splines materials.
Rokas
iToo Software

IL2267

  • Newbie
  • *
  • Posts: 8
Re: variable size by spline ID question
« Reply #7 on: October 25, 2018, 10:54:25 AM »
Hello Rokas,
Thanks for the file. I've managed to alter it a bit and adapt it to my original idea. Now it works! It was just what I needed.
I have a on/off switch that enables the random variation (by spline ID) on top of the initial number of floors the user inputs.
The randomize id script you provided is very useful but would it be possible to alter it so you can input a range for the IDs before they are randomized?
This would be very useful for example if I have a whole street where buildings have more than 10 floors and I also want some kind of variation so I can set the random IDs, let's say, between 10 and 15.
Thanks a bunch!

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: variable size by spline ID question
« Reply #8 on: October 25, 2018, 11:03:59 AM »
The randomize id script you provided is very useful but would it be possible to alter it so you can input a range for the IDs before they are randomized?
This would be very useful for example if I have a whole street where buildings have more than 10 floors and I also want some kind of variation so I can set the random IDs, let's say, between 10 and 15.
Thanks a bunch!
First two lines are exactly for this reason.
Rokas
iToo Software

IL2267

  • Newbie
  • *
  • Posts: 8
Re: variable size by spline ID question
« Reply #9 on: October 25, 2018, 11:06:03 AM »
sorry for that, I think I've missed something. There wasn't any visual feedback when I ran the script. It just randomized the IDs. I'll double check.

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: variable size by spline ID question
« Reply #10 on: October 25, 2018, 11:18:59 AM »
Yes, this is simple script without User Interface. Feel free to open it in MAXScript editor and edit for Your needs.
Rokas
iToo Software

IL2267

  • Newbie
  • *
  • Posts: 8
Re: variable size by spline ID question
« Reply #11 on: October 26, 2018, 10:41:34 AM »
Hello Rokas,
Following your advice I managed to update my Building Generator.
The final version has 6 user inputs for better control:
-number of base floors
-height for the base floor
-number of top floors
-height for the top floor
-on/off switch for height variation (my take on this one was to use the info you provided and add this random height on top of the current building height; so if you have an initial input of 2(base)+5(top) and the spline ID is 5, the total number of floors will be 2(base)+5+5(top)
-on/off switch for interior lights (to use for night shots)
*I've also added randomized curtains in the style.

Thanks again for all the help!

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: variable size by spline ID question
« Reply #12 on: October 26, 2018, 10:45:37 AM »
Great use of RailClone. !
Rokas
iToo Software