*NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

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
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

*NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 » Wed Mar 06, 2019 9:10 pm

This tool keeps layers docked to the workspace, so they are always in view while navigating the workspace.
Very useful to anchor animatics to the workspace or with my Layer Shortcuts script.

Mac: https://sites.google.com/site/synthsin/ ... ects=0&d=1
Windows (auto-docking): https://sites.google.com/site/synthsin/ ... ects=0&d=1

Directions:
  • Mac:
    1. At frame zero, position and scale one or more layers where you want them docked relative to the workspace window. If you're doing one at a time, you can position/scale it with either layer transforms or workspace navigation, otherwise just use layer transforms to position multiple layers at once.
    2. At frame zero, hit the button and select "Add" to dock all selected layers.
    3. At any frame other than zero, hit the button to restore all docked layers...like after navigation.
    • Tips:
      • Assign this button a shortcut. I used zero.
        Frame zero to add or remove docked layers. You can just hit the first letter of a button, so adding with my shortcut is zero then "a", and removing would be zero then "r".
    Windows (auto-docking):
    1. Assign a shortcut to the "SYN: Dock Layers Use" button. (Necessary for auto-docking.)
    2. At frame zero, position and scale one or more layers where you want them docked relative to the workspace window. If you're doing one at a time, you can position/scale it with either layer transforms or workspace navigation, otherwise just use layer transforms to position multiple layers at once.
    3. At frame zero, hit the "SYN: Dock Layers Set" button (icon with gear) and select "Add" to dock all selected layers or "Remove" to undock all selected layers.
    4. Set layers will now auto-dock on frames other than zero whenever you:
      • Use right-click & drag to pan the workspace.
      • Use mouse wheel scroll to zoom the workspace.
        • This might not work with touchpad or touch screen zoom gestures, but you can simply right-click after zooming to auto-dock.
      • Use Shift+right-click & drag to zoom workspace.
      • Use Home to reset the view.
      • Use Home+Shift to zoom layer contents.
      • Use Home+Alt to zoom selected points.
    • Tips:
      • Assign "SYN: Dock Layers Use" button a shortcut, but you'll never need to use it, so it can be any available key.
        All the auto-docking only works if you release the key/s, like right-click & drag, within the workspace. This is so the automation doesn't affect anything else in Moho that may use the same key/s.
      AutoHotkey script:
      • If you have AutoHotkey installed and wish to use the uncompiled AHK script instead of the compiled exe:
        • With Moho closed, open "syn_dock_layers_set.lua" in a text editor, like Notepad.
          Under "Recurring values", change the value of "Syn_DockLayersSet.exe" from 1 to 0.
          Open Moho, and when you go to dock a layer, it will ask you to find your AutoHotkeyU64.exe
Post Reply