Page 1 of 2

*NEW* Find and delete negative keyframes

Posted: Wed Feb 20, 2019 2:09 am
by synthsin75
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.

Re: *NEW* Find and delete negative keyframes

Posted: Wed Feb 20, 2019 9:22 am
by Lukas
This could be useful for troubleshooting troublesome files, thanks for sharing. :)

Re: *NEW* Find and delete negative keyframes

Posted: Wed Feb 20, 2019 4:19 pm
by Penny
Thanks Wes! This is very helpful!

Re: *NEW* Find and delete negative keyframes

Posted: Fri Aug 02, 2019 10:06 pm
by Slyanim
Life saver! Thank you Wes!

Re: *NEW* Find and delete negative keyframes

Posted: Sat Sep 28, 2019 3:39 am
by catwrestler
Negative keys... interesting. I'm wondering what are major causes and how do I know I have them?

Re: *NEW* Find and delete negative keyframes

Posted: Sat Sep 28, 2019 6:50 pm
by synthsin75
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.

Re: *NEW* Find and delete negative keyframes

Posted: Sun Sep 29, 2019 3:43 pm
by Greenlaw
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?
Coincidentally, a user in another forum asked this same question yesterday, so I'm re-posting an edited version of my reply here:

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.

Re: *NEW* Find and delete negative keyframes

Posted: Fri Feb 19, 2021 3:00 pm
by Lukas
Does anyone have a clue how these negative frames might be created? The only thing I can think of in corrupt recovery files?

Re: *NEW* Find and delete negative keyframes

Posted: Fri Feb 19, 2021 5:58 pm
by hayasidist
Lukas wrote: Fri Feb 19, 2021 3:00 pm Does anyone have a clue how these negative frames might be created? The only thing I can think of in corrupt recovery files?
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

Posted: Fri Feb 19, 2021 6:33 pm
by Daxel
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

Posted: Fri Feb 19, 2021 9:06 pm
by Greenlaw
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.

Re: *NEW* Find and delete negative keyframes

Posted: Thu Mar 18, 2021 12:51 am
by kgeetvcartoons
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!

Re: *NEW* Find and delete negative keyframes

Posted: Thu Mar 18, 2021 1:09 am
by synthsin75
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.

Re: *NEW* Find and delete negative keyframes

Posted: Thu Mar 18, 2021 1:10 am
by Greenlaw
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!
Hi,

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.

Re: *NEW* Find and delete negative keyframes

Posted: Thu Mar 18, 2021 3:16 am
by kgeetvcartoons
THANK YOU SO MUCH! It worked. It didn't find any negative keyframes so we'll work from there!
Thanks again!