Corona Renderer Forum

General Category => General CG Discussion => Topic started by: cjwidd on 2021-09-15, 08:01:38

Title: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-15, 08:01:38
Look all over, but cannot find a script that evenly distributes a selection of objects in n-rows / n-columns. MCG-Arrange (http://www.scriptspot.com/3ds-max/mcg/mcg-arrange-objects) accomplished this task, but is not functional in 3ds Max 2020.

It's very surprising to me that such a script does not exist(?)
Title: Re: Arrange / Distribute Objects
Post by: aaouviz on 2021-09-15, 08:06:01
Damn,

That looks handy. I don't have any tips, but posting here in case someone comes up with a solution.
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-15, 09:58:49
This is the best I've found so far (link) (http://forums.cgsociety.org/t/distribute-evenly/1164337)

Not as flexible as I would like, but it does evenly distribute objects between two points. I'm looking for a solution that can distribute a selection of objects into an arbitrary number of rows and columns, like MCG-arrange.
Title: Re: Arrange / Distribute Objects
Post by: pokoy on 2021-09-15, 16:53:09
Hmm I guess PFlow could help here, you can specify a group as object source, and then use a grid birth operator... but controls are limited.
Maybe TyFlow provides more options...
Title: Re: Arrange / Distribute Objects
Post by: piotrus3333 on 2021-09-15, 17:56:20
what is missing from Array tool in 3ds max?
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-15, 21:11:36
Right, I was going to use TyFlow, but I was really hoping to avoid that; I assumed there was probably already a script floating around that maybe someone had but never shared online(?)
Title: Re: Arrange / Distribute Objects
Post by: aaouviz on 2021-09-16, 08:31:43
what is missing from Array tool in 3ds max?

Honestly I don't know what's missing from it. But this - to me - is an awful tool. I have no idea what it wants, I never get the expected results.
Title: Re: Arrange / Distribute Objects
Post by: romullus on 2021-09-16, 10:33:44
Array is a great tool and i use it a lot, but it doesn't do what cwidd wants. It can't take multiple existing objects and arrange them into some array. I need to test that mcg script - never felt particular need for such tool, but who knows, sometime it may come handy.
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-16, 10:34:34
what is missing from Array tool in 3ds max?

Do you mean, "How does the 3ds Max array tool not suit the intended use case?"

I think the answer is just that the array tool does not perform this function; the array tool generates an array of instances (or copies) based on the transform of the selected objects, the array tool does not *arrange* objects, which is what I'm trying to do, and what the MCG_Arrange tool used to do.
Title: Re: Arrange / Distribute Objects
Post by: Philip kelly on 2021-09-16, 10:39:56
Forest pro/ Rail clone?
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-16, 10:42:45
Forest pro/ Rail clone?

Right, I assume RailClone does do this, and ForestPack might also do this. I could look into using FP for this, but I do not have access to RC.

To be sure, I was really looking for a turnkey solution for this, thinking a script for it already existed - and it does, but not for Max 2020.
Title: Re: Arrange / Distribute Objects
Post by: Frood on 2021-09-16, 11:00:10
If plugin dependency is not an issue for you:

1. there is a free version of RC
2. you might try the (also free) Clone modifier (https://www.itoosoft.com/freeplugins/clone): Select all objects you want to distribute, apply modifier twice to create a grid with them. All parametric and adjustable.


Good Luck


Title: Re: Arrange / Distribute Objects
Post by: piotrus3333 on 2021-09-16, 11:00:55
Array is a great tool and i use it a lot, but it doesn't do what cwidd wants. It can't take multiple existing objects and arrange them into some array. I need to test that mcg script - never felt particular need for such tool, but who knows, sometime it may come handy.

create an array and replace objects with simple replacer script.
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-16, 11:14:12
If plugin dependency is not an issue for you:

1. there is a free version of RC
2. you might try the (also free) Clone modifier (https://www.itoosoft.com/freeplugins/clone): Select all objects you want to distribute, apply modifier twice to create a grid with them. All parametric and adjustable.


Good Luck

Thanks Frood, looking into this +1
Title: Re: Arrange / Distribute Objects
Post by: clemens_at on 2021-09-16, 12:36:26
also highly recommended: AdvArray (https://apps.autodesk.com/3DSMAX/en/Detail/Index?id=7221085778557027350&appLang=en&os=Win64)
Title: Re: Arrange / Distribute Objects
Post by: pokoy on 2021-09-16, 14:25:44
also highly recommended: AdvArray (https://apps.autodesk.com/3DSMAX/en/Detail/Index?id=7221085778557027350&appLang=en&os=Win64)
Neat, never heard of this one.
Title: Re: Arrange / Distribute Objects
Post by: morph3us on 2021-09-16, 15:18:20
Maybethis clone modifier by iToo helps?
https://www.itoosoft.com/freeplugins/clone

You can add it to the stack twice, one for the rows, the second for the columns.
(If its the same object over and over again, which is your user case, if Im correct.)
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-17, 00:10:30
If plugin dependency is not an issue for you:

1. there is a free version of RC
2. you might try the (also free) Clone modifier (https://www.itoosoft.com/freeplugins/clone): Select all objects you want to distribute, apply modifier twice to create a grid with them. All parametric and adjustable.


Good Luck

Unfortunately this is modifier does not achieve the desired effect; in fact, this is basically a modifier version of the array tool.
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-17, 00:14:40
I just want to clarify, because there are several people offering their advice, but are misunderstanding what I'm looking for.

Imagine you import a Megascans collection of small rocks, they are all separate (unique) objects and all import at transform (0,0,0). Now arrange them in a grid.

I'm looking for a script that does this, as MCG_Arrange does, with parameters to arrange the objects in a grid of arbitrary number of rows and columns. For example, if you have 16 objects, you could create 2 row/8 col, 8 row/2 col, 4 row/4 col, 1 row/16 col, etc.
Title: Re: Arrange / Distribute Objects
Post by: morph3us on 2021-09-17, 09:21:40
Sorry for not having read properly...

Does this Script snippet by Bobo help you?
https://forums.cgsociety.org/t/distribute-evenly/1164337/3
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-17, 11:04:47
Sorry for not having read properly...

Does this Script snippet by Bobo help you?
https://forums.cgsociety.org/t/distribute-evenly/1164337/3

Sort of - I linked to this script earlier in this thread(^)
Title: Re: Arrange / Distribute Objects
Post by: PROH on 2021-09-17, 12:33:59
Hi. Have you tried this: https://www.racoon-artworks.de/resource_quicksplineclone.php
I know it's not exactly like your description, but I think it could make the same end result.

Hope it helps.


Edit: Forget it. It doesn't work :(
Title: Re: Arrange / Distribute Objects
Post by: morph3us on 2021-09-17, 17:19:19
Again, sorry for not having read thoroughly.

I hope I can make it up with the little script I attached.
Once installed, you can find it in the "morph3us.net" category in the "Customize User Interface" window.

It does not check if your selection is correct. If you do not have anything selected it throws an error.
Also, I did not test it on groups...
There is probably a lot more to sanitize, but I gotta go in 10 minutes...

It does however set the grid size automatically depending on the biggest object that is selected.
I also implemented an undo, if needed.
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-17, 18:29:08
Hey morph3us, thanks for your effort! I'm out of the office this weekend, but I will test as soon as possible - looking forward to it :D
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-25, 20:14:10
Hey Morpheus, honestly your macros works pretty well - thank you(!) Is it possible to expose parameters for rows and columns or grid spacing? For example, "I want to arrange these 8 objects into 2 rows and 4 columns".

Also, how is the spacing between each 'cell' in the array being determined, by bounding box? Can you expose a parameter to specify the spacing?

If none of that is possible, it's still a great script and thank you so much for sharing - it was what I was looking for!
Title: Re: Arrange / Distribute Objects
Post by: morph3us on 2021-09-26, 18:15:56
Glad I was of some help!

Technically everything you ask for is possible, I guess.
The problem is that I really do not have any time at hand right now.
I have several projects that occupy me quite heavily at the moment.

The spacing is determined by the bounding box, yes.
It searches for the biggest object in the selection and the uses that as a base for all the other objects.

I can not promise anything further than what I assembled already, I will try to remember this for when things quiet down a bit (not in the next two weeks)
If you'd like, take a poke at the .ms file yourself and ask for help if you get stuck.
Title: Re: Arrange / Distribute Objects
Post by: cjwidd on 2021-09-26, 20:42:53
No problem, I really appreciate the script regardless - it's awesome!