### Author Topic: Dumb basic - best mode to have offset objects of same width align perfectly?  (Read 1134 times)

#### Screenscene vfx

• Newbie
• Posts: 36
##### Dumb basic - best mode to have offset objects of same width align perfectly?
« on: August 08, 2016, 01:33:34 PM »
Heya Folks!

I've got a job coing up with a load of rows of identical houses. Railclone does a really handy job of letting me lay this all out and since all of the houses in the scene are identical it allows me the option of making each unit along the road have an identical width for it's curbside, path, garden and drive and finally the house itself.

I've made a small test where each type of object adds up to the same width of 600 cm. My house object is 600cm wide, the drive and garden objects combine to 600cm wide and each segment of the path or curb are each 100cm wide so 6 of each combined again adds up to the same 600cm. I've set up multiple railclone linear arrays in a single RC object and the idea would be to use offsets to set the depth of each object and set the same spacing whether using evenly or default with tile with the hope that each combined 600cm segment could line up crisply with each other. I'm find that the positioning of each object along the line is a little bit random in terms of it's starting point so I end up with slight offsets and sometimes scale differences. I can understand that as each row of objects is offset out in y from the splines (all of them are mirrored too) that the offset spline they are instanced along is longer than the inner one - is there a way to get railclone to almost look at the positioning of each object as a percentage so that the center of each object will always align on each row of things?

Which mode would you recommend for something like this?

Cheers!

John

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1772
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #1 on: August 08, 2016, 02:17:50 PM »
Hi John!

Please take a look at the attached sample file for a possible solution. I've made the following changes to your style.

- Wired the house to the Defaut input instead of Evenly
- Change Default mode to Adaptive.
- Removed all the Y Offset values from the generator settings. Internally this creates a new spline of a different length which is better for reducing unwanted deformation but stops the rows from remaining in sync because they're different lengths.
- Add the offset back by creating Transform operators and exporting the Fixed Y Transform setting.
- Export the Y Size of each segment so that it can be used to calculate the offset of the adjacent row. This means you don't have to enter the values manually and you should be able to quickly swap the geometry without changing any settings
- Also in the transform operators, changed Alignment > Y to Bottom.

Many thanks!

Paul
Paul Roberts
iToo Software

#### Screenscene vfx

• Newbie
• Posts: 36
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #2 on: August 08, 2016, 04:06:51 PM »
Much appreciated!

So it's mainly the Y-offset in the generator doing the damage? Makes perfect sense of course! I like the size export thing too, very sneaky

Last thing, if I wanted to get the house object to be non bendable but get some kind of path / side garden objects stretch to fill in the newly made gaps, is it possible to do this?

Thanks again!

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1772
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #3 on: August 08, 2016, 05:38:28 PM »
No problem at all.

Yes, it's the Y offset in the generator that's causing some issues with alignment. Transforming the segments instead is a little trick to get around this limitation. Regarding non-bendy houses. How about separating the ground plot and the building? In that way the house can sit in the centre of a plot of any size. In the attached file I've added the house using a separate generator and then added an expression that automatically centres it in the plot by dynamically changing the padding values.

I've also changed the way the style works. Instead of just using adaptive I've reintroduced Evenly segments to allow you to put fences between the houses. Default mode is now set to Count with a value of 1 so that there's only one house/set of garden parts/set of curbs/pavemements between each house.

For a bit of fun I've also added another generator that adds some randomised cars to the drives!

(You might have to use your imagination for the cars )

Thanks!

Paul
« Last Edit: August 08, 2016, 05:53:49 PM by Paul Roberts »
Paul Roberts
iToo Software

#### Screenscene vfx

• Newbie
• Posts: 36
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #4 on: August 08, 2016, 05:52:12 PM »
This is pretty damn awesome, will have renders of what it ends up being over the next few weeks

The dynamic bits seem great, I'll have a good look over the manual for each of the new nodes you're adding in here.

Thanks again Paul!

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1772
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #5 on: August 08, 2016, 05:55:35 PM »
My pleasure, glad I could help out.
Paul Roberts
iToo Software

#### Screenscene vfx

• Newbie
• Posts: 36
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #6 on: August 08, 2016, 06:06:15 PM »
Actually any chance you could back save this to max 2016?

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1772
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #7 on: August 08, 2016, 06:08:29 PM »
Oops, my apologies I thought I had. Here it is saved back to 2014 just to be safe.

Thanks!
Paul Roberts
iToo Software

#### Screenscene vfx

• Newbie
• Posts: 36
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #8 on: August 08, 2016, 06:29:24 PM »
I'd say this'd end up being a really handy preset for a lot of people - much appreciated!

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1772
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #9 on: August 08, 2016, 06:30:18 PM »
I agree, I've added it to my list for tutorials and/or presets already
Paul Roberts
iToo Software

#### Screenscene vfx

• Newbie
• Posts: 36
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #10 on: August 08, 2016, 10:34:12 PM »
Just as a clarification to that last setup.

You're using count mode set to a random value - from the help it mentions that count would just stretch the count number of segments along the spline unless an x-evenly input is set to divide the spline.

Am I to think that the x-evenly, if it had a model input, would calculate the width of the model in the evenly input and then fit the default input model in the gaps between them? So in our case, if our evenly input was 100cm wide and the distance was set to 600cm, this would shrink the gaps for the default to fit into to 500cm? Hence if you're using an evenly input that has no width, it'll just use the full 600cm for an individual copy of the default model?

Would this almost point to a missing mode for default - count is setting the width by the amount of times it can fit along the spline length, would it make sense to have a count by width mode too rather than needing to short circuit it with the sneaky zero width evenly trick?

Thanks again for this!

John

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1772
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #11 on: August 09, 2016, 10:57:29 AM »
Good morning!

Quote
Just as a clarification to that last setup.

You're using count mode set to a random value - from the help it mentions that count would just stretch the count number of segments along the spline unless an x-evenly input is set to divide the spline.

Am I to think that the x-evenly, if it had a model input, would calculate the width of the model in the evenly input and then fit the default input model in the gaps between them? So in our case, if our evenly input was 100cm wide and the distance was set to 600cm, this would shrink the gaps for the default to fit into to 500cm? Hence if you're using an evenly input that has no width, it'll just use the full 600cm for an individual copy of the default model?

Yep indeed, thats exactly how it works.

Quote
Would this almost point to a missing mode for default - count is setting the width by the amount of times it can fit along the spline length, would it make sense to have a count by width mode too rather than needing to short circuit it with the sneaky zero width evenly trick?

That's an interesting idea, though to a certain extent that's how Adaptive mode works. It finds the number of items that can fit into a spline and scales them equally so that none are sliced. The difference here though is that the width is taken from the size of the default segment instead of entered as a parameter, but this can be manipulated using Padding or the Fixed Size parameters.

Thanks!

Paul
Paul Roberts
iToo Software

#### Screenscene vfx

• Newbie
• Posts: 36
##### Re: Dumb basic - best mode to have offset objects of same width align perfectly?
« Reply #12 on: August 09, 2016, 10:58:33 AM »
Great to know the thinking behind it, much appreciated again Paul.