SS - Multi Layer Transform Points tool

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

SS - Multi Layer Transform Points tool

Post by SimplSam »

SS - Multi Layer Transform Points

SimplSam’s Multi-Layer Transform Points is a convenience tool which allows you to quickly transform selected points across multiple selected layers.

The tool was developed as an addition to the existing built-in Transform Points tool, and does not replace it, but allows you to select, move, scale and rotate selected points on multiple layers at the same time, or simply select child-content layers from one or more groups of layers - without having to leave the currently selected groups/layers.

Image

Enhanced Features:
  • Multi-Layer points visibility & editing - if the layer is selected, or the layer is a child of a selected group layer
  • Proximity based Select or Transform
  • Scale & Flip can use pivot offset
  • Nearest (single) point manipulation - across all selected layers
  • Global Shape, Edge and Bounding Box selection - across all selected layers
  • Does not create static-keyframe during a simple single-click selection / deselection
  • Can add static-keyframe using double-click selection, or keyboard [Enter] with selected points
  • Align points to other points - left, mid-l/r, right, middles, top, mid-t/b, bottom
  • The Transformation bounding box is always upright rectangular (does not rotate with layer)
  • Use Ctrl-Alt-A to select all points on all selected layers / groups of layers
  • Eight angular-points of fixed rotation (when using the Rotation Shift modifier)
It should otherwise be very similarly to the built-in Transform Points tool.

Video Demo:

Image
Tool Options:

ImageThe tool has 4 main modes of operation - plus flip & point alignment, all working with multiple-layers
  1. Select
    Single or multiple Points/Shapes/Edges can be selected by single-click, drag / ctrl-drag or ctrl-alt-a (select all). You can ctrl-shift-click to add individual points to selection, or you can shift-click Shapes or Edges to add them to selection. Esc or single-click canvas background to deselect. All point selection actions will be limited to content in the currently selected Groups and Layers.
  2. Translate
    Used to move a single or groups of selected Points. This can be achieved via numerical entry, or using the mouse to drag the selection, or by using ctrl-[up/down/left/right] to nudge the selected points. If zero points are selected the tools will automatically switch between Select and Transform mode - based on point proximity. If 1 point is already selected, the one-click select will choose the nearest point to the mouse - so you can easily drag the nearest point.
  3. Scale
    Used to scale & resize the group of selected Points. Drag side-handles (Top / Bottom / Left / Right) to stretch with pivot anchor at the opposite side, or alt-drag side-handles to stretch uniformly from center. Drag corner-handles to uniformly scale to the opposite corner, or shift-drag corner-handles to freeform scale from the opposite corner. You can also move the Pivot point to scale (in ant of the above modes) towards that pivot location.
  4. Rotate
    Drag between the inner and outer bounding box guide lines to rotate the selection about the pivot point. Shift-drag allows you to rotate in 8 fixed 45° increments. You can also drag and move the pivot point to change the pivot point of rotation.
  5. Flip & Align
    Allows you to Flip points Horizontally and Vertically about the center or about the pivot point, and Align selected points Left, mid-Left/Right, Right, Centers, Top, mid-Top/Bottom & Bottom.
For the most part the tool behaves like the built-in Transform Points tool, so you can refer to the docs for that for further options.

So … Why do you need the Multi-Layer Transform Points tool?

Speed and convenience. The addon can enhance your animation and point manipulation workflow. Particularly handy when wishing to maintain point and shape alignment across different layers, but also handy for selecting or picking content on different layers without having to change the currently selected layers.

Version:
  • version: 01.00 #530604 MH12.5+
  • release: 10.0+1.00 (base on LM Transform Points 10.0)
  • by Sam Cogheil (SimplSam)
Download:
How do I get set up ?
  • To install:
    • Use the Moho ‘Scripts’ > ‘Install Script …’ menu (after you Download for Install Script, and extract the zip files)
    – or –
    • Save the ‘ss_multi_layer_transform_points.lua’ and ‘ss_multi_layer_transform_points.png’ files to your computer into your<custom content folder>/scripts/tool/ folder
    • Copy the sub scriptresources folder ‘ss_multi_layer_transform_points’ to your <custom content folder>/scripts/ScriptResources/
    • Reload Moho scripts (or Restart Moho)
  • To use:
    • Run the Multi-Layer Transform Points tool from the Tools palette
    • The tool will be invoked allowing you to manipulate the vector points of your animation content
    • You can select multiple vector layers and/or multiple parent group layers to enable them for editing
Notes & Limitations

Notes:
  • Compatible with MH12.5+
Known Limitations:
  • Construction curves are only visible on the Active layer (last selected), but can be turned on manually using layer quick-properties
  • Point Welding across multiple layers is not possible, thus the feature (as a whole) is not supported
  • Bezier Handles would only be visible on a single-selected layer, thus they are not currently supported
  • Copy/Paste only works from and to the Active (last selected) layer - if it is a vector layer
  • Point Groups are not currently supported
  • Some odd point placement / behaviour may occur with:
    • Switch layers & Frame by Frame content layers – so they are not official supported
    • Scaling of content on rotated layers which are not rotated close to 0, 90, 180 or 270 degrees
    • 3D translated layers (i.e. Rotated about X or Y axis) and Sheared layers

Special Thanks to:
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: SS - Multi Layer Transform Points tool

Post by Greenlaw »

Nice one SimplSam!

A Multi Layer Transform Points tool has been sought after for ages. Thank you for creating what's sure to be a very useful script and for sharing it with the Moho community!
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: SS - Multi Layer Transform Points tool

Post by Lukas »

Amazing! Thanks.

The keyboard actions Ctrl+A and Esc don't work as expected (they only select and deselect on the moho.layer).

(keyEvent.keyCode == LM.GUI.KEY_ESCAPE) doesn't seem to work. On macOS at least.
User avatar
KuzKuz
Posts: 483
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: SS - Multi Layer Transform Points tool

Post by KuzKuz »

Oh, thank you!
I started developing such a tool, but then its progress was shifted towards the Transform Rig Tool, and I've put the original tool on hold indefinitely.
I'm really glad that I don't have to complete it now!
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: SS - Multi Layer Transform Points tool

Post by SimplSam »

Lukas wrote: Mon Jun 05, 2023 9:51 am Amazing! Thanks.
The keyboard actions Ctrl+A and Esc don't work as expected (they only select and deselect on the moho.layer).
(keyEvent.keyCode == LM.GUI.KEY_ESCAPE) doesn't seem to work. On macOS at least.
Umm. Yes - Moho gobbles up a bunch of Keys and never passes them through to scripts incl: Ctrl-A, Ctrl-C, Ctrl-V. But looks like the Mac version also gobbles up Esc & Tab.

So I already had a work-around for Ctrl-A and that is to use Ctrl-Alt-a (Command-Option-a). Windows interprets the 'a' slightly differently from Mac and uses 'A' instead of 'a'. The script now looks for either.

I don't have fix for Esc (DeSelect) per se. But can use an alternate key like: ` (backtick) or \ (backslash) - which are under Esc on a number of Keyboards ...

I don't have fix for Tab (Select Connected) per se. But can use an alternate key combo like: Alt-` (alt-backtick) or Alt-\ (alt-backslash) ...

I have placed those in the code for now (+01.04) and will see how it goes. May also send a request to LM to see if these keys can be passed through.

Edited: added backtick, backslash and alt variants in version +01.04.
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
hayasidist
Posts: 3526
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: SS - Multi Layer Transform Points tool

Post by hayasidist »

SimplSam wrote: Mon Jun 05, 2023 5:13 pm Umm. Yes - Moho gobbles up a bunch of Keys and never passes them through to scripts .... May also send a request to LM to see if these keys can be passed through.
This is a longstanding (and still unresolved) problem - ever since the ability for users to assign their own shortcut keys, scripts have no way of guaranteeing that a particular keystroke will be passed to them.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: SS - Multi Layer Transform Points tool

Post by Daxel »

This is so cool! thank you!
User avatar
negroclarito
Posts: 123
Joined: Sun Feb 28, 2010 6:38 am

Re: SS - Multi Layer Transform Points tool

Post by negroclarito »

I love it. I love being able to animate points without having to go through all the layers one by one.
Thanks a lot!!! :P :P
Post Reply