Procedural Array

38 votes
Version: 
0.01
Author Name: 
Markus Boos

Instructions:

This script allows you to create procedural arrays which stay editable
even after you close and reopen the file. The array objects are linked to
a parent helper which you can transform to your liking while still keeping
array qualities. This is great for creating tiles or roofs where you place the array first and still want to tweak the distance between its elements.

Running the script: Drag & Drop the script into MAX's viewport or start it via MAXScript -> Run Script

Usage:
1. A dialog opens. Click <pick geo node> and select the source object in your scene (currently only instances are supported).
2. The master array node (yellow point helper) and one instance will be created at [0,0,0].
3. Move, rotate and scale the master array node into place (instances are linked to it).
4. Change number of instances in each axis (x,y,z) and distance between objects to yourliking.
5. Check "auto-distance" if you want the script to place one object right next to each other (without any gaps). This is based on the bounding box on the object. Does not work that well if source object is transformed (scaled, rotated). Needs Max 2008 or higher to work
6. "Center around master" means all instances will be placed around the master array node,instead of starting to place elements there and continue in one direction.
7. The scale values allow you to locally scale the instances without affecting the source object.
8. Similar to 7, just changing the rotation values.
9. After you are done. Close the tool window and continue working.

If you want to change an existing array:
1. Reopen the tool.
2. Click <pick master node> and click the master array node.
3. The last settings are read in from the master node.
3. If you want to change anything, you need to have an instance selected as well. But with every change the array needs to be rebuilt. So make a copy of an existing array element, move it somewhere else and use this as your geo node:. Click <pick geo node> and select the object you copied.
4. Then change to your liking and array will be rebuilt.

Attention:
Do not delete the master array node or its modifier. Otherwise the array will lose its ability to be changed. After that it will be treated as any other collapsed max array.

The auto-distance option only works in MAX 2008 and higher.

Everything is still a bit clunky but maybe it is useful for something.

2009-05-17: Update: I just uploaded v0.02 of the script. It has more options (see jpg) such as seperate position rotation and scale offset for each array dimension as well as multipliers to get arrays where elements do not have constant distances from each other. A multiplier of 1 means constant offsets, more than 1 means growing distances, less than 1 means shrinking distances.

I also rearranged a couple of things so it is more similar to MAX's native array. Basically it should do whatever MAX's native array does. Attention: because I introduced new parameters the two arrays are not compatible with each other. So you can not change 0.02 arrays with the 0.01 script.

The thing with random values is in progress. I just need to find a way that the random value is reproduceable if the array needs to be rebuilt.

2010-06-03: Update: I uploaded a macroscript version of the tool. Please run it once or drag it from windows explorer into the max window. Then if you go to Customize User Interface it will show up under the r7 category and you can drag it as a button onto a toolbar, into the quad menu or assign a keyboard shortcut.

usage

Additional Info: 

For further questions, bug reports or wish lists please email me. My email address is in the header of the file. Thanks !

Version Requirement: 
3ds max 9-2010
AttachmentSize
r7_procedural_array.ms13.95 KB
ScreenShot_01_sm.jpg94.84 KB
r7_procedural_array_v0.02.ms47.51 KB
v0.02.JPG68.71 KB
r7_procedural_array_v0.02.mcr47.61 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Marco Brunetta's picture

Oh, did not know about the

Oh, did not know about the seed in the random function. Good to know, thanks!

Martijn van Herk's picture

Values produced by

Values produced by maxscript's random function (or any other computer program for that matter) are already pseudo-random. If you implicitly set the "seed" value (see maxscript docs) to a fixed value before generating random numbers, maxscript will always generate the same "random" sequence.

Martijn

MLB's picture

This seems very

This seems very handy!

Request: could you add circular arrays and arrays along a spline?

Something like this:
http://www.vg2max.spb.ru/clone.htm

relief7's picture

Hi Marco, thanks for your

Hi Marco,

thanks for your comment and your suggestions!

I was also thinking about using one of those pseudo-random number generators such as perlin's noise function or something similar. I guess that this would work.

I will keep you posted...

Marco Brunetta's picture

About the random thing. You

About the random thing.
You can't have a random series of values that you can repeat, that's a logical impossibility.

What you can do is generate a function that given a value and a threshold always generates the same series of "random-like" numbers. If you want to have some extra variation, you can add a "unique seed" value.

I hope that was clear enough.

Nice script btw.

W DIGITAL's picture

jes i like it also very

jes i like it also very much, but can you make it exactly like the array tool?

titane357's picture

Hello, Thank you very much

Hello,
Thank you very much for sharing this !!! Works fine.
But now you are binded to make a circular array mode, and to add some position,rotation,scale random possibilities !! :-))

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.