WP Platter Control
Animate (rotational) Bone Speeds with Accerelation/Deceleration with ease by Keyframing Speed instead of Angles.
Category: Bones
Published: Dec 7 2023, 18:59
Last Edited: Jan 2 2024, 07:46
Created for Moho Version: 14.0
Returned Version: 1.3.0
Edition Downloads: 667
DEMO/TUTORIAL
Short tutorial video on how to use the script (older version, but the basics are still the same) to generate rotating animations in Moho 14:
EXAMPLES
Example of an animation using the script to control a Reel to Reel tape deck (including controling smart bones controlling cut tapes on the tape passing the play head):
----------------------------------------------------------------------------------------------------------
DISCLAIMER
----------------------------------------------------------------------------------------------------------
I've tried my best to make this plugin as stable and useful as possible. But please bare in mind; I'm sharing this script, which I've created for doing my own animation work, for others to use for free as I think this could help others too. But this script/this plugin is 'as is'. There might be an update in the future, but that's not garanteed and there is no active support. Nor a garantee (always backup first!). That said; I hope you enjoy it and it helps you with your animation work!
----------------------------------------------------------------------------------------------------------
VERSION HISTORY
----------------------------------------------------------------------------------------------------------
1.3.0 [current]
- Added: New mode added: 'Cycle Range on repeat'. This new mode makes it possible to repeat over more than a single cycle (360 degrees) of the platterbone while still being limited to the amount of cycles entered in the 'Cycles' field (so platter bone angle won't unlimitedly increase forever but stays within cycles range). This way you can for example have a platter bone with a smart bone action ranging from 0 to -720 degrees (= 2 cycles of 360 degrees each) in which you can do all kinds of things, like letting a character walk forwards from 0 to -360 degrees and backwards from -360 to -719 degrees to create things like pingpong loops. So in this example; when the speed is 100% the first cycle will show the character walking forward and the second cycle will be the character walking backwards and after that repeats that sequence forever while the speed is 100% (or plays it accordingly to a different speed value or even in reverse when speed is -100% ???? ).
- Added: You can now apply speed changes to multiple platter bones at once using multi select in the platter bones list
- Added/Changed: The frame range that will be written in the rotation channels of platter bones will now be cleared from keyframes before starting writing new ones so there's never a left over keyframe there before writing new ones
- Changed: On higher frame intervals written keys now get the 'Step' interpolation. On one's these will now always be set to 'smooth'. So keyframes now explicitely gets set to an interpolation type.
1.2.0
- Added: Speed Dial Bone Zero Speed direction setting. With this setting you can set what direction of that bone is representing the zero speed value. You can choose between Left [default, and as before], Up, Right or Down
- Added: Introducing Cycles modes. Currently there are two modes: one to render only single 360 degrees cycles on repeat and one to keep increasing angles to go over a single cycle. This also replaces the old 'Keep angles within 360 degrees' checkbox.
- Improved: Now stops calculating when end of set range is reached. So you don't need to wait 'till the end of the timeline no more.
- Changed: Added 'Experimental' to 'Only write Keys if Speed changes' because it's not fully tested and not sure if it's a valid option
- Added: more RPM presets
- Added: Show how many frames a cycle takes when choosing an RPM
- Fixed: some little issues
- Improved: Better dialog window layout
1.1.3
- Changed: Made compatible with newer utils file
1.1.2
- Added/Fixed: Moho doesn't always return the real value of the bone's angle. The script couldn't get the speed angle's value when the speed bone was controlled by a smart bone action causing the speed to never change and the script to fail.
To work around this/fix the script could use another method to get the REAL angle values of the speed bone, but that method is extremely slow. The difference is literally between the blink of an eye and waiting seconds to minutes for the baking to finish.
So I added a setting to enable this way slower, but always working, baking method. By default it's turned off (= speed baking), but when you are controlling the speed bone not by it's own keyframes, but from within a smart bone action (or controller bone), than you need to turn this setting on, otherwise the script won't work as expected.
- Changed/Fixed: Removed the setting to only write keys on frames where the speed bone dial had a keyframe. This turned out to not be very accurate/useful. Replaced by a new setting to only write keys when the speed actually changes.
- Removed: The experimental 'never repeat the same keyframe' turned out to be not useful. This was meant to optimize keyframe writing, but it's missing important features and caused issues so removed this for now in favour of real optimizations later.
- Changed: The speed bone list isn't by default filtered on only bones with keyframes any longer. Because bones controlled by smart bones don't have keyframes themselves, but are still great speed bones to use with the script. You can still the filtering on if you like.
- Added: Now shows the script version number in the dialog box title
1.1.1
- Changed: Now by default the script limits writing rotation values to a 360 degrees range. This fixes an issue where smart bone actions only ran the first 360 degrees cycle and weren't doing anything anymore after passing the (minus) 360 degrees range.
- Added: Checkbox to turn off the 360 degrees limitation (advised to never turn this off though, unless you know what you're doing and really need to go beyond 360!)
- Added: Shows script version number in dialog title.
1.1.0
- Initial release of script
----------------------------------------------------------------------------------------------------------
HOW TO INSTALL?
----------------------------------------------------------------------------------------------------------
How to install the script in Moho?
* Click on the 'Download for Install Script command''-button below to download the zip-file
* Unzip the downloaded file
* Start Moho
* Open the Scripts menu --> choose 'Install Script' --> Browse through the unziped folder and choose the folder named 'wp_platter_control_for-moho-install-script-command' --> It should now install the script
* Once installation is done Moho shows a dialog saying 'Installation Complete!'
* Restart Moho (only after restarting the tool will become available)
* You should now see the tool in the tools panel. Ready to use!
----------------------------------------------------------------------------------------------------------
ABOUT THE CURRENT VERSION
----------------------------------------------------------------------------------------------------------
Why I created this script?
For the quick music video's I create for my music on YouTube I often struggled with the limitations of both Moho Pro and Spine Pro in relation to rotating elements because both are focussed on animating from pose to pose, but and aren't very convenient to animate cycling rotations which need to be able to accelerate, decelerate, change speed, keep running 'endlessly' at an exact speed when at full speed (given by RPM) and also do all this scalable and quickly without any manual calculations and complexity.
To create this kind of animations we need to animate speed, instead of angles. But Moho cannot animate speed, but only angles. So that's why this script converts angles to speed to make all this very easy now for everything that needs to gradually speed up, slow down and reverse! And with just four keyframes on the speed dial bone we can now create a record speeding up, run for some minutes and slow down to a stop at the end, within seconds to minutes instead of hours (and a lot of headaches)!
Especially because Moho has the great feature of Smart Bones, with this script we can now even accelerate and decelerated looped action timelines of smart bones!
The possibilities are as endless as the cycling platters. It's now easy to animate all kinds of elements that need to change speed, like windmills, records players, tape decks, car wheels, airplane propellors, walkcycles, car traffic on a high way etc. Just to name a few.
What does the script do?
The scripts generates keyframes on the rotation channel of a (platter) bone to make it rotate at a certain speed by reading the animated angle from a Speed Dial bone. Basically it's converting an angle of a bone to rotating cycles with speed on another bone. Like this it's possible to quickly and painlessly generate rotating cycles with acceleration, deceleration etc.
How to use the script?
This is a new script! Backup your moho file before use just to be sure!
Please watch the short tutorial video above for more instructions.
Quick start
1. Make sure that you have a bone that needs to rotate using this script (the 'platter bone' ).
2. Add a bone to use as speed dial. Caution! While Moho works with counter clockwise angles, this script intentionally works differently and uses clockwise to make things a little easier compared to the real world:
- Point the bone to the left (the bone angle in moho is 180 degrees) for zero speed
- Point the bone up (the bone angle in Moho is 90 degrees) for full forward speed (100%)
- Point the bone down (the bone angle in Moho is 270 degrees) for full reversed speed (-100%)
(Since version 1.2.0 it's also possible to have the zero speed bone direction pointing up, right or down by a new setting in the script, but having zero speed when the bone is pointing to the left is the default)
3. Make sure this speed dial bone is not influencing any image or vector layer when rotating:
- Go to frame 0 (setup frame)
- Select the bone layer and the speed dial bone
- Select the bone strength tool (S on your keyboard)
- Change the Bone strength of the bone to 0 in the tool properties
4. Animate the rotation of this speed dial bone to change the speed over time (see above for the range).
5. Open the WP Platter Control Tool. Please watch the short tutorial video for more instructions, but the core part is:
- Select the speed bone in the list on the left
- Select the platter bone in the list on the right
- Choose a cycle speed (RPM), or leave it at the default
- Hit OK to generate. The script will now look from frame to frame at the angle of the speed dial bone you just animated, and generate keyframes on the platter bone's rotation channel accordingly to convert this angle into platter speed.
6. Play the timeline!
Advanced: About creating a smart bone action to control with this script
This script only generates rotation cycles with speeds, acceleration and deceleration. But when using this to control a smart bone action you can basically control every other movement and complete timelines even! This makes the platter script even more powerful.
When you like to control a smart bone action with the script make sure your smart bone rotates CLOCKWISE. Meaning that while setting up the smart bone timeline the smart bone needs to rotate from 0 degrees to minus (!!) 359 degrees. That's considered forward by the script and is called a single cycle.
Even if you like to have that bone rotate counter clockwise when controlling it later, it's important to set it up like this. You can always turn on 'Counter Clockwise' when running the script to reverse direction!
[update since v1.3.0]
From v1.3.0 unwards it's possible to let the smart bone action contain more than a single cycle of 360 degrees. When you switch the mode of the Platter Control to 'Cycle Range on repeat' you can set a higher amount of cycles (360 degrees each) you want to use in the smart bone action. For instance; let's say you want to let a character walk from left to right in the first cycle (0 to -359 degrees on the smartbone) and than back to left again (-360 to -719 degrees on the smartbone) you can do that now by switching to that mode and setting the amount of Cycles to 2.
The difference of this mode compared to the 'Unlimited Increasing Cycles' mode is that this mode has a limited amount of cycles (and therefor limited agrees on the platter bone) while the 'Unlimited Increasing Cycles' mode doesn't have any limit and keeps increasing degrees 'forever', never looping.
-----------------------------------------------------------------------------------------------------------
KNOWN LIMITATIONS AND WORKAROUNDS
-----------------------------------------------------------------------------------------------------------
Speed bones that are controlled by Smart Bone Actions or Controller bones gives unexpected results
Moho doesn't always return the real value of the bone's angle. The script can't by default get the speed angle's value when the speed bone is controlled by a smart bone action causing the speed to never change and the script to fail.
Since version 1.1.2 there's a setting to fix this. It's making the baking extremely slow unfortunately, but it get's the real angle value of the speed dial and so also works in scenarios where the speed dial doesn't have keyframes itself, but is controlled from somewhere else.
Just turn on the setting 'Use Real Speed Bone Angle' under 'Keyframe writing' and grab a cup of coffee while the baking is working...
Supported Moho version
Tested in Moho 14.1
Short tutorial video on how to use the script (older version, but the basics are still the same) to generate rotating animations in Moho 14:
EXAMPLES
Example of an animation using the script to control a Reel to Reel tape deck (including controling smart bones controlling cut tapes on the tape passing the play head):
----------------------------------------------------------------------------------------------------------
DISCLAIMER
----------------------------------------------------------------------------------------------------------
I've tried my best to make this plugin as stable and useful as possible. But please bare in mind; I'm sharing this script, which I've created for doing my own animation work, for others to use for free as I think this could help others too. But this script/this plugin is 'as is'. There might be an update in the future, but that's not garanteed and there is no active support. Nor a garantee (always backup first!). That said; I hope you enjoy it and it helps you with your animation work!
----------------------------------------------------------------------------------------------------------
VERSION HISTORY
----------------------------------------------------------------------------------------------------------
1.3.0 [current]
- Added: New mode added: 'Cycle Range on repeat'. This new mode makes it possible to repeat over more than a single cycle (360 degrees) of the platterbone while still being limited to the amount of cycles entered in the 'Cycles' field (so platter bone angle won't unlimitedly increase forever but stays within cycles range). This way you can for example have a platter bone with a smart bone action ranging from 0 to -720 degrees (= 2 cycles of 360 degrees each) in which you can do all kinds of things, like letting a character walk forwards from 0 to -360 degrees and backwards from -360 to -719 degrees to create things like pingpong loops. So in this example; when the speed is 100% the first cycle will show the character walking forward and the second cycle will be the character walking backwards and after that repeats that sequence forever while the speed is 100% (or plays it accordingly to a different speed value or even in reverse when speed is -100% ???? ).
- Added: You can now apply speed changes to multiple platter bones at once using multi select in the platter bones list
- Added/Changed: The frame range that will be written in the rotation channels of platter bones will now be cleared from keyframes before starting writing new ones so there's never a left over keyframe there before writing new ones
- Changed: On higher frame intervals written keys now get the 'Step' interpolation. On one's these will now always be set to 'smooth'. So keyframes now explicitely gets set to an interpolation type.
1.2.0
- Added: Speed Dial Bone Zero Speed direction setting. With this setting you can set what direction of that bone is representing the zero speed value. You can choose between Left [default, and as before], Up, Right or Down
- Added: Introducing Cycles modes. Currently there are two modes: one to render only single 360 degrees cycles on repeat and one to keep increasing angles to go over a single cycle. This also replaces the old 'Keep angles within 360 degrees' checkbox.
- Improved: Now stops calculating when end of set range is reached. So you don't need to wait 'till the end of the timeline no more.
- Changed: Added 'Experimental' to 'Only write Keys if Speed changes' because it's not fully tested and not sure if it's a valid option
- Added: more RPM presets
- Added: Show how many frames a cycle takes when choosing an RPM
- Fixed: some little issues
- Improved: Better dialog window layout
1.1.3
- Changed: Made compatible with newer utils file
1.1.2
- Added/Fixed: Moho doesn't always return the real value of the bone's angle. The script couldn't get the speed angle's value when the speed bone was controlled by a smart bone action causing the speed to never change and the script to fail.
To work around this/fix the script could use another method to get the REAL angle values of the speed bone, but that method is extremely slow. The difference is literally between the blink of an eye and waiting seconds to minutes for the baking to finish.
So I added a setting to enable this way slower, but always working, baking method. By default it's turned off (= speed baking), but when you are controlling the speed bone not by it's own keyframes, but from within a smart bone action (or controller bone), than you need to turn this setting on, otherwise the script won't work as expected.
- Changed/Fixed: Removed the setting to only write keys on frames where the speed bone dial had a keyframe. This turned out to not be very accurate/useful. Replaced by a new setting to only write keys when the speed actually changes.
- Removed: The experimental 'never repeat the same keyframe' turned out to be not useful. This was meant to optimize keyframe writing, but it's missing important features and caused issues so removed this for now in favour of real optimizations later.
- Changed: The speed bone list isn't by default filtered on only bones with keyframes any longer. Because bones controlled by smart bones don't have keyframes themselves, but are still great speed bones to use with the script. You can still the filtering on if you like.
- Added: Now shows the script version number in the dialog box title
1.1.1
- Changed: Now by default the script limits writing rotation values to a 360 degrees range. This fixes an issue where smart bone actions only ran the first 360 degrees cycle and weren't doing anything anymore after passing the (minus) 360 degrees range.
- Added: Checkbox to turn off the 360 degrees limitation (advised to never turn this off though, unless you know what you're doing and really need to go beyond 360!)
- Added: Shows script version number in dialog title.
1.1.0
- Initial release of script
----------------------------------------------------------------------------------------------------------
HOW TO INSTALL?
----------------------------------------------------------------------------------------------------------
How to install the script in Moho?
* Click on the 'Download for Install Script command''-button below to download the zip-file
* Unzip the downloaded file
* Start Moho
* Open the Scripts menu --> choose 'Install Script' --> Browse through the unziped folder and choose the folder named 'wp_platter_control_for-moho-install-script-command' --> It should now install the script
* Once installation is done Moho shows a dialog saying 'Installation Complete!'
* Restart Moho (only after restarting the tool will become available)
* You should now see the tool in the tools panel. Ready to use!
----------------------------------------------------------------------------------------------------------
ABOUT THE CURRENT VERSION
----------------------------------------------------------------------------------------------------------
Why I created this script?
For the quick music video's I create for my music on YouTube I often struggled with the limitations of both Moho Pro and Spine Pro in relation to rotating elements because both are focussed on animating from pose to pose, but and aren't very convenient to animate cycling rotations which need to be able to accelerate, decelerate, change speed, keep running 'endlessly' at an exact speed when at full speed (given by RPM) and also do all this scalable and quickly without any manual calculations and complexity.
To create this kind of animations we need to animate speed, instead of angles. But Moho cannot animate speed, but only angles. So that's why this script converts angles to speed to make all this very easy now for everything that needs to gradually speed up, slow down and reverse! And with just four keyframes on the speed dial bone we can now create a record speeding up, run for some minutes and slow down to a stop at the end, within seconds to minutes instead of hours (and a lot of headaches)!
Especially because Moho has the great feature of Smart Bones, with this script we can now even accelerate and decelerated looped action timelines of smart bones!
The possibilities are as endless as the cycling platters. It's now easy to animate all kinds of elements that need to change speed, like windmills, records players, tape decks, car wheels, airplane propellors, walkcycles, car traffic on a high way etc. Just to name a few.
What does the script do?
The scripts generates keyframes on the rotation channel of a (platter) bone to make it rotate at a certain speed by reading the animated angle from a Speed Dial bone. Basically it's converting an angle of a bone to rotating cycles with speed on another bone. Like this it's possible to quickly and painlessly generate rotating cycles with acceleration, deceleration etc.
How to use the script?
This is a new script! Backup your moho file before use just to be sure!
Please watch the short tutorial video above for more instructions.
Quick start
1. Make sure that you have a bone that needs to rotate using this script (the 'platter bone' ).
2. Add a bone to use as speed dial. Caution! While Moho works with counter clockwise angles, this script intentionally works differently and uses clockwise to make things a little easier compared to the real world:
- Point the bone to the left (the bone angle in moho is 180 degrees) for zero speed
- Point the bone up (the bone angle in Moho is 90 degrees) for full forward speed (100%)
- Point the bone down (the bone angle in Moho is 270 degrees) for full reversed speed (-100%)
(Since version 1.2.0 it's also possible to have the zero speed bone direction pointing up, right or down by a new setting in the script, but having zero speed when the bone is pointing to the left is the default)
3. Make sure this speed dial bone is not influencing any image or vector layer when rotating:
- Go to frame 0 (setup frame)
- Select the bone layer and the speed dial bone
- Select the bone strength tool (S on your keyboard)
- Change the Bone strength of the bone to 0 in the tool properties
4. Animate the rotation of this speed dial bone to change the speed over time (see above for the range).
5. Open the WP Platter Control Tool. Please watch the short tutorial video for more instructions, but the core part is:
- Select the speed bone in the list on the left
- Select the platter bone in the list on the right
- Choose a cycle speed (RPM), or leave it at the default
- Hit OK to generate. The script will now look from frame to frame at the angle of the speed dial bone you just animated, and generate keyframes on the platter bone's rotation channel accordingly to convert this angle into platter speed.
6. Play the timeline!
Advanced: About creating a smart bone action to control with this script
This script only generates rotation cycles with speeds, acceleration and deceleration. But when using this to control a smart bone action you can basically control every other movement and complete timelines even! This makes the platter script even more powerful.
When you like to control a smart bone action with the script make sure your smart bone rotates CLOCKWISE. Meaning that while setting up the smart bone timeline the smart bone needs to rotate from 0 degrees to minus (!!) 359 degrees. That's considered forward by the script and is called a single cycle.
Even if you like to have that bone rotate counter clockwise when controlling it later, it's important to set it up like this. You can always turn on 'Counter Clockwise' when running the script to reverse direction!
[update since v1.3.0]
From v1.3.0 unwards it's possible to let the smart bone action contain more than a single cycle of 360 degrees. When you switch the mode of the Platter Control to 'Cycle Range on repeat' you can set a higher amount of cycles (360 degrees each) you want to use in the smart bone action. For instance; let's say you want to let a character walk from left to right in the first cycle (0 to -359 degrees on the smartbone) and than back to left again (-360 to -719 degrees on the smartbone) you can do that now by switching to that mode and setting the amount of Cycles to 2.
The difference of this mode compared to the 'Unlimited Increasing Cycles' mode is that this mode has a limited amount of cycles (and therefor limited agrees on the platter bone) while the 'Unlimited Increasing Cycles' mode doesn't have any limit and keeps increasing degrees 'forever', never looping.
-----------------------------------------------------------------------------------------------------------
KNOWN LIMITATIONS AND WORKAROUNDS
-----------------------------------------------------------------------------------------------------------
Speed bones that are controlled by Smart Bone Actions or Controller bones gives unexpected results
Moho doesn't always return the real value of the bone's angle. The script can't by default get the speed angle's value when the speed bone is controlled by a smart bone action causing the speed to never change and the script to fail.
Since version 1.1.2 there's a setting to fix this. It's making the baking extremely slow unfortunately, but it get's the real angle value of the speed dial and so also works in scenarios where the speed dial doesn't have keyframes itself, but is controlled from somewhere else.
Just turn on the setting 'Use Real Speed Bone Angle' under 'Keyframe writing' and grab a cup of coffee while the baking is working...
Supported Moho version
Tested in Moho 14.1