Tiling Cloner Setup

In most cases when I am using a cloner I just want to make tiles.
I just want clones of cubes to sit next to each other.

Follow up:

This is easy in linear mode because you have a "Per Step" mode (Count x Distance).
In "Grid Array" mode this is not an option. So you have to calculate the distance between a certain number of clones times their size… Boring!

So here is a little setup that will take you two minutes and teach you the very basics of Xpresso.

Lets get started with a Cube in a Cloner. Set the cloner in Grid Array mode. as you can see this sucks, the cubes overlap and all.
Now add a Xpresso tag to your Cloner.
Drag the Cloner into the Xpresso wind twice (2x), open the Count ports on the left one and the Size ports not the right one, like so:

drag cloners into xpresso

Now add three (3) Math nodes in Multiply mode, and enter the size of the cube in the lower input ports:

Add Multiply nodes

AAARGH! They don't touch!!

Argh gaps

This is normal and we are going to solve this.
What happens is that the setup calculates the size multiplied by the count but that gives us one times too much distance.
So we have to subtract one (-1) from the clone count to get the right results.

Add subtract nodes -1

Yeah man this rocks!

No it doesn't. We don't want to climb into xpresso each time we modify the size of the cube. This should all go automatically.
So we have to drag the cube into xpresso and open the size ports and connect those to the Math:Multiply nodes respectively

Add cube size

Ok this is it, this works. We are done.

Voila!

Options: Gaps
Lets say we want more than this, we want to be able to add gaps between the tiles.
Well if you have come this far this should be easy.
We need a User-Data field in the cloner.
Click on the Cloner, in the attributes go tho the User Data menu, and Add User-Data.
Set it to "Real" and name it "GAP" and click OK

Add user-data

In the xpresso window we can find this User-Data in the (left) Cloner node

Add three (3) Math nodes in Add mode. Reconnect them between Cube size and the Math:Multiply and connect the User Data to the lower ports.
Bam! We got gaps. Duh who said xpresso was difficult?

Add Gap size
Option GAPS

Option: Auto resize the cube (not the cloner)
You can also take this whole setup to automatically adapt the size of the cube to the cloner size.
This is basically a whole new setup.
We need to open the Size and the Count ports on the cloner.
Subtract one (1) to the clone count.
Divide the size of the Cloner by the clone count -1.
Subtract the GAP from the result
And pass it on to the cube size.
Wow not to fast!
Just watch the image below and try to reproduce it (oh oh this is going to generate some negative comments here)

Auto resize cube

Keep this Setup in your library for later use.
Enjoy!


3 comments

Comment from: Paul [Visitor] Email · http://neosun.org : 2011-04-04 @ 14:33
****-
thanks for this tutorial,

but in this case i would prefer using two cloner stacked
into another. one of them rotated by 90 degrees. you wont
get an automatic size calculation of the cube, but it is
just one value to tweak inside the cloner, the pos.X (per step).
same goes for the count slider, just select both cloner
if u want to go with an overall rectangle shape.

with a third cloner you have the "per step" method as a grid array cloner.

regards,
paul
Comment from: Mike [Visitor] : 2011-10-04 @ 20:15
*****
What a brilliant quick and easy fix for the MoGraph cloner. Worked just fine.

Thanks
Mike
*****
hello there and thank you for your info – I've definitely picked up something new from right here. I did however expertise some technical points using this site, as I experienced to reload the website lots of times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I'm complaining, but sluggish loading instances times will often affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Well I'm adding this RSS to my email and could look out for much more of your respective intriguing content. Make sure you update this again very soon.

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)