shhlife / harmony

Scripts for ToonBoom Harmony
GNU General Public License v3.0
28 stars 8 forks source link

NC_Utils.js to work with deformers and update to make it easier to use these tools on harmony network #15

Closed chrishcarter closed 5 years ago

chrishcarter commented 5 years ago

NC_Tween now also works on deformation tweens ( as well as any node contained inside a group ). It will guess that the user is in the camera view if the selection is entirely drawings and select any immediate parent pegs or deformation groups above the selected drawings to add to the "manipulationCollection".

also I created the function NC_get_scriptFile.

The speciffic use case was to reference the NC_TweenUI.ui file referenced in 2018-12-05 version of NC_TweenUI.js when running NC_TweenUI.js from the global scripts location on a Harmony network. All studios I have worked at use a harmony network so I expect this to be the default set up for mid/large Harmony productions.

When using a harmony network, the easiest way to share scripts across the team is to put them in the "global scripts" location ( looks like : < \YOUR_SERVER_NAME\USA_DB\scripts> ). NC_get_scriptFile first checks the global scripts location for the named file before looking for it in the machine's < C:\Program Files (x86)\Toon Boom Animation\Toon Boom Harmony 16.0 Premium\resources\scripts > folder. This should make it easier to roll our tools over a harmony networked studio instantly.

If the named file exists in the global location then it will return that file before looking in the local location.

I used it in NC_TweenUI.js like:

uiFile = NC_get_scriptFile( "NC_TweenUI.ui" ) NC_Log("ui file = " + uiFile) this.ui = UiLoader.load(uiFile)

I see that this function is not needed for the 2018-12-07 versuin of NC_TweenUI.js but it should be helpful in the future to enable the same repo to work without modification when used on a harmony database as well as a standalone machine

shhlife commented 5 years ago

Heya Chris! I feel bad, I tried to use the latest version and it doesn't seem to work on deformers. I tried selecting the drawing, the deformer group, and the pegs work fine. The drawing works if there's no deformer, but as soon as I add a deformer, it stops working.

I wonder if we should try sharing a file to test it on and make sure we're both working off the same data?

thanks! :)

chrishcarter commented 5 years ago

Hi Jason,

Good Idea. I've downloaded the "LEIF" rig that is used in the master controllers tutorials https://learn.toonboom.com/files/modules/190/en/MO-RIG3-008.zip using file : <MO-RIG3-008/LEIF_WithMCs.tpl>

I removed all keyframes between frame 20 and 27 and did several manipulations: 1 - selecting single and multiple drawings in the camera view. 2 - selecting single and multiple nodes in the node view . 3 - selecting layers in the timeline.

All of my tests worked as expected on the LEIF rig.

I also used NC_Tween on a drawing with just a peg, then added deformers ( curve, bone and envelope) and NC_Tween still worked as expected.

It would be good to know if you can replicate the issue you had on the LEIF rig.

Although one improvement that could be made ( after talking to animators) would be to have an option to manipulate all pegs below the selected node on as default. As often the animator will select the master peg in the timeline expecting to be able to key all child nodes. Currently NC_Tween will only edit the master peg's keyframes and not the rig below it.

I will be working on the "apply to child pegs" option today.