Get In Line! (May 9,2011)

35 votes
Version: 
5.0
Date Updated: 
04/09/2011
Author Name: 
JokerMartini

This script evenly distributes the selected objects based on the start and end target objects.

Anyone is more than welcome to add to this.
Things you could potentially add are qsorting, transform, scale, and rotation sorting as well.

Right now it just does position.

Features

- V1.0 | Distribute selected objects evenly between two targeted objects

- V2.0 | Random position offset for each object on X,Y,Z

- V3.0 | Functionality code rewrite

- V4.0 | Offset position adjustments and bug fixes

- V5.0 | New UI design and random positioning along vector
- V5.0 | Custom Axis selecting for position aligning individually for X,Y,Z.

WishList

- Distribute Option for each axis individually X,Y,Z
- Distribute Rotation
- QSort selected objects (will allow for animating ex:spring)

Comments

Comment viewing options

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

Yes

Yes

wobi's picture

Thanks

Nice one man, thank you for this.

JokerMartini's picture

What exactly are you trying

What exactly are you trying to do?
Are you trying to space the objects, taking into account the objects dimensions?

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

su37's picture

Can you help me the script

Can you help me the script where is wrong ?

obj = for i in selection collect i
total = [0,0,0]
for i=2 to (obj.count-1) do (total += obj[i].max - obj[i].min)
format "Total X-size: %\n" total[1]
format "Total Y-size: %\n" total[2]
format "Total Z-size: %\n" total[3]
posMax = obj[obj.count].min
posMin = obj[1].max
sp = (posMax-posMin-total)/(obj.count-1)
sp.x
obj[2].pos.x = posMin.x + sp.x + (obj[2].max.x-obj[2].min.x )/2
for i=3 to (obj.count-1) do -- (obj.count-2)
(
totalzong = [0,0,0]
totalzong += obj[i-1].max - obj[i-1].min -- (obj.count-3)
format "Total X-size: %\n" total[1]
format "Total Y-size: %\n" total[2]
format "Total Z-size: %\n" total[3]

obj[i].pos.x = posMin.x + sp.x * (i-1) + totalzong.x + (obj[i].max.x-obj[i].min.x )/2

)

JokerMartini's picture

su37

im not quite sure i understand what you are talking about.
If you could try and explain in more detail or possible and image example I would love to help out.

Right now the script spaces objects based on an equal distance between object's pivots. Not taking into account the objects dimensions.

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

JokerMartini's picture

su37

im not quite sure i understand what you are talking about.
If you could try and explain in more detail or possible and image example I would love to help out.

Right now the script spaces objects based on an equal distance between object's pivots. Not taking into account the objects dimensions.

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

su37's picture

Hi JokerMartini, I have a

Hi JokerMartini,
I have a suggestion:
The maximum value of each object to the minimum of the next object is equal , but not now Pivot distance is equal , Do you realize spacing distance between objects
is equal ?

crystal3d's picture

One thing though...

It would be alot better if it did treat groups as on object and distribute them accordingly...

grouped objects are messed up if they have individual pivots...

crystal3d's picture

it would be great to use this

when you want to create quick previews for lots of models...

just place the models in a row and animate the camera, save outputs etc...

titane357's picture

Thanks for the script ! It

Thanks for the script !
It would be nice to be able to select all objects, even end and/or start objects. So we can be rid of warning. :-)

Comment viewing options

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