select across layers

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

Moderators: Víctor Paredes, Belgarath, slowtiger

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

select across layers

Post by otonal »

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: 303
Joined: Thu May 13, 2010 2:01 pm

Re: select across layers

Post by Breinmeester »

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 »

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?
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: select across layers

Post by chucky »

Hey Breiny, did you finish that multilayer magnet? I would love to get a copy :D :D
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

Re: select across layers

Post by Breinmeester »

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 »

8)
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: select across layers

Post by chucky »

No worries, I will keep an eye out for it. :wink:
Post Reply