Harmony Script

Peg To Static Transformation

Peg2Static

Creates a series of Static Transformation modules from the selected Peg’s keyframe values.
By converting a Peg to Static modules, you can make a peg-like module that is un-animatable and also immune to “Reset All Transfomations” function.
The Static modules will be connected to a Transformation Switch likewise deformer chains.
This way, each Static modules can be switched based on the selected drawing’s cel timings.

  • v1.2 – Fixed the issue where created static node is not linked to the same port of the original peg’s source node.
  • v1.21 – On cloned drawing (Deformation comp node timing ref.), follow the setting of “Animate With Animation Tools” option.
  • v1.22 – “drawing.elementMode” attribute is changed to “drawing.ELEMENT_MODE” to accomodate Harmony 22 update.

Download


Installation:

  1. Click on the Download button above. The GitHub page for this script will open.
  2. On the page, click on the Code button then choose Download Zip from the menu.
  3. Locate to your user scripts folder (a hidden folder) for the version of your Harmony.
  4. There is a folder named src inside the zip file. Copy all its contents directly to the folder above.
  5. In Harmony, add RIG_Peg_To_Static_Transformation function to any toolbar.

Direction:

  1. Select one Peg and one Drawing module.
  2. Run RIG_Peg_To_Static_Transformation.
  3. Static Modules will be created and connected to a new Transformation Switch module.
  4. The clone of the selected drawing will also be connected to the switch module for switching.
  5. All generated modules will be wrapped inside a group with the prefix “StaticGroup-“.

Detailed Description:

This script determines the total number of Static modules to generate
based on the sum of valid keyframes on the Peg.
A valid keyframe must have a corresponding drawing cel so a keyframe-cel pair can be formed.
After a Static module is made based on the keyframe’s value, Transformation Switch can use the cel as the reference to select the Static module.
When script finds a keyframe on a frame but the exposed cel on the same frame has already been paired with another keyframe, the keyframe will be skipped.

Timeline
In this scenario, script will only generate Static modules for frame 1 and 5.
Frame 3 and 8 will be ignored because CEL 1 is already paired with frame 1. Frame 6 will be ignored because it has no exposed cel to pair.

Credit:

This script is made based on Animator/Tech Artist Jonathan Murphy’s rigging technique. (jonathanrobertart.com)


Copyright © 2024 Yu Ueda All Rights Reserved.