ScriptSpot

Script

Get In Line! (May 9,2011)

By JokerMartini · 2011-03-28

Version
5.0
Date updated
2011-04-09
Votes
61
Download
Download
Description

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.

Tags: align, 3ds max, space, line, distribute, evenly

Comments (37)

Distribute Xref Objects

ChuckRT · 2025-06-05

Hi could it be possible to order Xref Objects
I cannot get it work with those kind

Distribute script

pankovea · 2024-11-29

I have been looking for a working tool for distributing objects in space for a long time. As a result, I am developing my own.
At the moment, it can distribute not only objects, but also vertices in splines and meshes. He selects the first and last objects himself and sorts them by position in space (not by selection order). That is, everything works with one button without unnecessary windows. Highlighted - clicked the button on the panel and that's it. Or you can add keyboard shortcuts.

Download from the Github

subscribe for updates.

Attachments

the version i have definitely spoils the grouped objects...

crystal3d · 2022-02-20

can it be adjusted so that it treats groupd objects as single items so they get in line properly?

my work around atm

crystal3d · 2022-02-20

is to open those groups and select on the group entity so the objects inside the group dont get spoiled

but that would be much more practical

crystal3d · 2022-02-20

if i did not have to check for groups as i use this script for practicality purposes... merge vegetation from a scene, get them inline and check the shadings each next to each other in one go for comparsion between

tracymurphy · 2020-05-30

The UX interviews really stood out to us. We received a lot of internal information UX design firm that we could learn from,The team is organized, efficient, and prompt to accommodate feedback.

trueman · 2014-01-31

Hi. Thanks for the cool script.
I suggest it would be nice to add start/end objects existence check. Sometimes I accidentally try to distribute objects between deleted objects that leads to runtime error.

barigazy · 2014-01-31

@trueman
Just change state_ok function in line 6.
Here is the fix

fn state_ok = if selection.count == 0 then return off else
(
for obj in selection where isValidNode obj do
(
if (obj.name == StartObj.name or obj.name == EndObj.name) do return off
) ; on
)

JokerMartini · 2013-12-11

This is getting a re-write at the moment and will be much quicker with easier control and use.

Thank you

Spacelord · 2013-12-10

This is so cool, I was just thinking it would be great to have a Revit feature that is very similar to this script in 3dsmax and here it is !!

Thanks a million.

Serjio444 · 2013-11-08

sorry
I do not understand how this script works
You can make video?

JokerMartini · 2013-05-15

Sorry about the bug. I'll look into fixing that and implement it into the update.

I never test on groups as they, to me, are bad practice to use inside of 3ds Max. I only say that because man handles them incorrectly. That is no fault of you or I, but just wanted to make mention of it.

As far as fixing that though, I'll be sure to do so. Thank you for the report.

not working with groups

dub73 · 2013-05-14

nice script, but it is not working with groups, it opens groups and distribute all objects. It should keep groups closed and distribute only the group node/container. That would be awesome :)

cheers

dub

asymptote · 2012-06-27

Very useful, the only things I could suggest to improve are realtime preview and ability to remember which objects are selected (selection sets?)

thx for the script.

very good and

crystal3d · 2011-12-06

and it shuffles the order of the objects... maybe it could consider the objects' name on distribution order like 12345 and not like 154362.

thanks you

JokerMartini · 2011-10-07

You could space out the objects based on their bounding box and then space them accordingly.
It is definitely something worth integrating into the next release of this script.

Thanks

wobi · 2011-10-06

Nice one man, thank you for this.

su37 · 2011-10-06

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 · 2011-10-06

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

su37 · 2011-10-07

Yes

su37

JokerMartini · 2011-10-05

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.

su37

JokerMartini · 2011-10-05

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.

su37 · 2011-10-05

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 ?

it would be great to use this

crystal3d · 2011-10-04

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...

One thing though...

crystal3d · 2011-10-04

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...

titane357 · 2011-05-11

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. :-)

Michele71 · 2011-05-10

Thanks John, this is a great script!!!! One point to you :) ;)

Glad

JokerMartini · 2011-05-03

I'm glad to hear this us useful for a lot of people.
Does anyone have any ideas on ways to further develop this?
I'd be sure to jump on board and add anything people might want to see in this.

randomness and interactivity

sergo · 2011-05-05

It would be very cool If you could add some kind of random options:

  1. randomness in ordering - to have more diverse row of objects. (I think just turning off the ordering would be sufficient)
  2. randomness in intervals - to have objects aligned in more natural way.
  3. randomness in positioning - to have objects aligned not in straight line but a little bit scattered. (this could be accompished by using some other scripts, but th second option could not be accomplished considering non-orthogonal aligning)

And other (little bit harder to implement) option is interactivity - to have an ability to move the head or tail and objects between them rebuilt interactively. This could happen only during the script window is open.

Great Ideas.

JokerMartini · 2011-05-05

Great ideas Sergo. I've gone ahead and added the random offsetting. You can get some cool results with it.

You are more than welcome to dive into the code if you want and add to it. I'm cool with that.

Incorporating your other ideas as well as a bias on the positioning would be very cool.

sergo · 2011-05-10

I'll try to add random intervals and interactivity as soon as I can. Thank you!

Random

JokerMartini · 2011-05-10

I've added the random.
check it out.

If you want to go ahead and add something to this I'll hold off on messing with it until you are done.
back and forth kinda thing. That way we both are messing with it at the same time.

Attachments

art0411 · 2011-05-03

gooooooood!!

sergo · 2011-04-27

This is the most amazing little tool. Another one is Shuffle.
Thank you, you've made my job lot easier.

tassel · 2011-03-31

First thing that crossed my mind when i saw this was:

What about add functionality that lets you pick for example an spline and make the possibility to make an loft/profile of the spline between these 2 points?

Nice script by the way :)

Get in line

tommym · 2011-03-30

This may have a lot of potential.
Will it do the same on vectors from a center point?
Thanks from Paul

Develop

JokerMartini · 2011-03-30

If everyone wants to, we could all dive into further developing this if wanted.

We could first start a wishlist, because I could see this being very useful as well.