*NEW* Find and delete negative keyframes
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
*NEW* Find and delete negative keyframes
https://drive.google.com/uc?export=down ... f-pbWRqj1a
This will find and show a list of all the keyframes in the negative timeline, and ask if you want to delete them. This will solve a lot of problems with layers freaking out and other odd behaviors.
If the list is too long and the buttons are off screen, you can just hit "y" to delete them or "n" to cancel.
It avoids what seem to be legit keyframes on the negative timeline, but until there are more test cases, use it on a copy of your file so you can verify everything is working fine.
This will find and show a list of all the keyframes in the negative timeline, and ask if you want to delete them. This will solve a lot of problems with layers freaking out and other odd behaviors.
If the list is too long and the buttons are off screen, you can just hit "y" to delete them or "n" to cancel.
It avoids what seem to be legit keyframes on the negative timeline, but until there are more test cases, use it on a copy of your file so you can verify everything is working fine.
Last edited by synthsin75 on Sat Sep 04, 2021 6:18 am, edited 2 times in total.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: *NEW* Find and delete negative keyframes
This could be useful for troubleshooting troublesome files, thanks for sharing. 

Re: *NEW* Find and delete negative keyframes
Thanks Wes! This is very helpful!
Even with the head in the clouds You can touch the ground
https://www.facebook.com/santiago.penny
https://www.behance.net/pennysantiago
https://www.facebook.com/santiago.penny
https://www.behance.net/pennysantiago
Re: *NEW* Find and delete negative keyframes
Life saver! Thank you Wes!
-
- Posts: 11
- Joined: Fri Aug 16, 2019 12:52 am
Re: *NEW* Find and delete negative keyframes
Negative keys... interesting. I'm wondering what are major causes and how do I know I have them?
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Find and delete negative keyframes
If you have any significant performance issues or weird behavior, you can run this script to see if keyframes in the negative timeline may be a cause.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: *NEW* Find and delete negative keyframes
Coincidentally, a user in another forum asked this same question yesterday, so I'm re-posting an edited version of my reply here:catwrestler wrote: ↑Sat Sep 28, 2019 3:39 am Negative keys... interesting. I'm wondering what are major causes and how do I know I have them?
You'll know when this happens: Moho will suddenly crawl like it's processing the entire internet.

This happens when Moho places an unintended keyframe thousands of frames before frame zero, which apparently causes the computer to evaluate every frame in-between. It takes only one of these unintended keyframes to seriously impact Moho's performance. If there's more than one, Moho may become unusable. By 'serious impact', I mean basic actions like trying to animate a bone or copy and paste a keyframe will make Moho take a long pause, and getting any work done will take forever.
To fix this previously, you had to copy the visible keyframes for each channel, delete the entire channel, and then paste the intended keyframes back into the channel. Then you had to repeat this for every channel until you were sure you got rid of any and all of the unintended keyframes. Needless to say, this could be a huge time-waster. Or, if you know what to look for, you could search for the bad keyframes in the project file using a text editor and delete the keys that way.
Wes' script simplifies the process to a single command.
FYI, this issue happened to me Friday at work: A Moho rigged character I was animating suddenly became sluggish for no apparent reason. Even copying and pasting keys took forever. Prior to this slow-down, the rig was very responsive and quick to animate, so I was pretty sure I had at least one negative keyframe in this project.
When I ran Wes' script, it confirmed that this was indeed the case and it fixed the problem instantly.
If the script says there are no negative keyframes in the project, then at least you know to look elsewhere for the problem.
As mentioned above, you should save a backup copy of your project before running this script, just in case it does more harm than help.
Nobody seems to know why it happens but fortunately the problem occurs rarely. Also, it may occur in Moho 12.5 and earlier but I'm not yet sure that this happens in Moho 13.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
Re: *NEW* Find and delete negative keyframes
Does anyone have a clue how these negative frames might be created? The only thing I can think of in corrupt recovery files?
- hayasidist
- Posts: 3831
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: *NEW* Find and delete negative keyframes
the default frame for shape creation is -1,000,000 http://mohoscripting.com/methods/82 but I've never seen a key there...
the animated scatter brush shapes have keys in the "-1 to -100" (ish) range.
other than that -- sorry -- dunno!! (and, at the risk of causing it to happen -- I haven't experienced such a problem yet, but if I do, I'll do some serious digging)
Re: *NEW* Find and delete negative keyframes
Thank you! I will save it for when I need it. So far all my performance problems have always been solved deleting some reference layer. They get corrupted sometimes.
Re: *NEW* Find and delete negative keyframes
I don't see the problem nearly as much as I used to (thank goodness!), but this may be because my usage of Moho at work went down for a year or two. Lately, I'm using Moho more regularly at work and at home again. So far, so good. 
That said, I'm still thankful we have Wes' script. I seem to recall running into this issue maybe a year ago, or at least helping a co-worker that ran into it.

That said, I'm still thankful we have Wes' script. I seem to recall running into this issue maybe a year ago, or at least helping a co-worker that ran into it.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
-
- Posts: 58
- Joined: Fri Mar 12, 2021 2:34 am
Re: *NEW* Find and delete negative keyframes
I'm having issues running the script. I download it but nothing happens or says attach the script to a software. After I download it where can I find it in Moho? How do I open it to use it. This problem of animation slow down is happening in my lip syncing and my animation. It's killing my skits! Please help!
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Find and delete negative keyframes
If you haven't, you need to create a Custom Content Folder, from the preferences. Then you just need to drop this script into the Scripts>Menu folder, restart Moho, and then you can use it from the Scripts menu.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: *NEW* Find and delete negative keyframes
Hi,kgeetvcartoons wrote: ↑Thu Mar 18, 2021 12:51 am I'm having issues running the script. I download it but nothing happens or says attach the script to a software. After I download it where can I find it in Moho? How do I open it to use it. This problem of animation slow down is happening in my lip syncing and my animation. It's killing my skits! Please help!
I wrote these instructions the other day for another user, so I'm just copying it here. Hope this helps...
1. Download Wes' script from here: Find and Delete Negative Keyframes
2. With Moho 12.5 open, select File > Open Custom Content Folder. if this command isn't available, it means you haven't set a Custom Content Folder yet. To set it, select Edit > Preferences. You can set the path at the bottom of the window. The Custom Content Folder can be anywhere you like; I suggest setting it somewhere local, like maybe in a 'Moho' folder inside your Documents folder so Moho always has access to it.
3. When you have the Custom Content Folder open, open the Scripts folder, then the Menu folder. Here, make a folder for custom scripts. I like to name mine '+Special', which forces the menu to the top of the menu list, but you can call it anything you like.
4. Put the syn_negative_keys.lua script in this folder. Now you can close these folders.
5. Quit Moho and restart it. This will add the new script. (Alternatively, you can press Ctrl+Shift+Alt+L...this reloads scripts without quitting Moho.)
6. Open a copy of the Project that's giving your trouble. To be safe, make sure you're working with a copy!
7. Now you should see SYN: Negative Keys listed under the Scripts menu, inside the sub menu you created ('+Special' on my computer). Select the script, and it will do its magic. If it finds any negative keys, it will ask if you want to delete them. Say yes. (Understand that there is a possibility that this can mess up your Project file, which is why you should work with a copy. Chances are, everything will be fine though.)
8. Save your cleaned Project file and you should be ready to go.
Note 1: Under the Script menu, there is a command that tells Moho to install the script for you, but it requires that the script have a specific folder structure already set up. TBH, I'm so used to installing scripts manually (as described above,) that I almost never think to use this feature, but it's good to know about when the script author has a very specific setup in mind.
Note 2: the '+Special' folder is just something I do to keep things tidy. I actually go a step further by adding sub-folders by author inside that folder. You can use any structure that works best for you.
Note 3: the steps are the same for Moho 13.0 but the reload scripts shortcut is different. Frankly, I'd stick with Moho 12.5, and wait until Moho 13.5 comes out before setting this up for this version.
NEW! Visit our Little Green Dog Channel on YouTube!
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
D.R. Greenlaw
Artist/Partner - Little Green Dog
Little Green Dog Channel | Greenlaw's Demo Reel Channel
-
- Posts: 58
- Joined: Fri Mar 12, 2021 2:34 am
Re: *NEW* Find and delete negative keyframes
THANK YOU SO MUCH! It worked. It didn't find any negative keyframes so we'll work from there!
Thanks again!
Thanks again!