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.

Comments (37)
Comment policy
Distribute Xref Objects
Hi could it be possible to order Xref Objects
I cannot get it work with those kind
Distribute script
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...
can it be adjusted so that it treats groupd objects as single items so they get in line properly?
my work around atm
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
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
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.
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.
@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
)
This is getting a re-write at the moment and will be much quicker with easier control and use.
Thank you
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.
sorry
I do not understand how this script works
You can make video?
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
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
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
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
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
Nice one man, thank you for this.
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
)
What exactly are you trying to do?
Are you trying to space the objects, taking into account the objects dimensions?
Yes
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.
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.
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
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...
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...
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. :-)
Thanks John, this is a great script!!!! One point to you :) ;)
Glad
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
It would be very cool If you could add some kind of random options:
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.
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.
I'll try to add random intervals and interactivity as soon as I can. Thank you!
Random
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
gooooooood!!
This is the most amazing little tool. Another one is Shuffle.
Thank you, you've made my job lot easier.
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
This may have a lot of potential.
Will it do the same on vectors from a center point?
Thanks from Paul
Develop
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.