PDA

View Full Version : Offsetting objects script in Modeller?



raw-m
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!

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

Regards

Iain


@version 2.8
@warnings
@script modeler


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

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

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

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

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");.

daforum
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 ?

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

raw-m
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).