select across layers

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
otonal
Posts: 39
Joined: Tue Jun 05, 2012 4:44 pm

select across layers

Post by otonal » Fri Jun 07, 2013 8:56 am

is there a scriptmod that allows auto- selecting elements from all/any layers on the canvas for the layer transform and the point translate tool, without the need to always go to layers menu and select the layer first?
Breinmeester
Posts: 294
Joined: Thu May 13, 2010 2:01 pm

Re: select across layers

Post by Breinmeester » Fri Jun 07, 2013 12:12 pm

I did this for my multilayer magnet tool. The trick is to put the layers in an array. Next you put the points you need in an array as well which you make a property of the layer, like this:

Code: Select all

layer = moho.layer
layer.PointList = {}
Now you can recall all the layers in the array and every pointlist array from that layer when you need to do your translations, like this:

Code: Select all

for k, layer in ipairs(LayerList) do
  for i, pt in ipairs(layer.PointList) do
    --transform point
  end
end
The thing that makes this really tricky is you need to compensate for any transformations made on the several different layers. Read this thread to figure out how to do that: viewtopic.php?f=12&t=23609
otonal
Posts: 39
Joined: Tue Jun 05, 2012 4:44 pm

Re: select across layers

Post by otonal » Fri Jun 07, 2013 2:32 pm

alright thx first of all
but i am not a programmer/scripter. i would not even know where to put that text ^^
it was more of a question if something is around as a mod that already does it for layer transform and point translate.

as it seems this is not the case ,so i will forward it into the request area of the forum for future updates, because this really hinders my workflow.

but for the magnetool this would be nice as well indeed. have you uploaded the finished mod anywhere?
User avatar
chucky
Posts: 3932
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: select across layers

Post by chucky » Sun Jun 09, 2013 7:17 am

Hey Breiny, did you finish that multilayer magnet? I would love to get a copy :D :D
Sequential offender.
my latest animations
Breinmeester
Posts: 294
Joined: Thu May 13, 2010 2:01 pm

Re: select across layers

Post by Breinmeester » Mon Jun 17, 2013 9:49 am

Yeah, i got it working. But i want to add some more features.
otonal
Posts: 39
Joined: Tue Jun 05, 2012 4:44 pm

Re: select across layers

Post by otonal » Tue Jun 18, 2013 3:36 pm

8)
User avatar
chucky
Posts: 3932
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: select across layers

Post by chucky » Tue Jun 18, 2013 4:26 pm

No worries, I will keep an eye out for it. :wink:
Sequential offender.
my latest animations
Post Reply