View Full Version : Offsetting objects script in Modeller?

05-10-2013, 03:34 AM
Just created 40 planes using the very handy MGImagesToPlanes - lovely. It's created 40 planes on 40 layers but all on the same co-ords. I'm doing it like this as a UV is created for each plane so I can easily texture later. I need to offset the planes down the Z.

Is there a way to move the plane on layer 40 down the Z and have layers 1-39 spread linear between layer 1 and 40, but keeping my 1,2,3,4....40 structure?

Or, a simple script that will just offset the layers by a specified amount? If I have to move everything to one layer to do this then that's fine, so long as it maintains a 1 to 40 ordering. I'm hoping there is a way to do this in Modeller without having to jump to Layout!

05-10-2013, 03:21 PM
Hi, quick script to move objects in multiple layers. Assumes you have nothing in the layer apart from the image planes. Save this as an lscript and set how much you want to move in the Z direction.



@version 2.8
@script modeler

result = lyrdata();
n = sizeof(result);
d = 0;
for(i = 1; i<= n; i++){
d = d + 1; // replace the 1 with the amount that you need moving in the Z direction

05-10-2013, 05:18 PM
Version with a UI.

05-11-2013, 04:07 AM
Wow, amazing! Massive thanks, will test when I get to work :D

05-11-2013, 07:43 AM
There's Artspere's AlignAndDistribute (http://www.artssphere.com/plugins/alignanddistribute.php), a Illustrator-like tool for Modeler and Layout.

If you're using the modified version it will ask for a tga image for the logo witch is not in the zip file. To make it work you need to edit the lscript and change line 637 to //ctl_logo = ctlimage("awAlignAndDistribute.tga");.

05-11-2013, 08:42 AM
Version with a UI.

Works brilliantly, thanks Nick :thumbsup:

(even entering a negative value the same as one previously entered can reset the position)
Is it possible to have one that does Y and X ?

05-11-2013, 10:11 AM
Yeah, I thought if that. It's not hard to add the other coordinates. Could look into adding rotation and scale too.

05-12-2013, 03:56 AM
That's lovely and works a treat, thanks all! That additional functionality would be really useful, nickdigital, surprised its not built in (in to Modeller I mean, not your plugin :D).