Daxel wrote: ↑Tue Mar 16, 2021 12:53 am Another tip: If the script doesn't find negative keyframes or you keep having performance problems, try deleting the reference layers and creating them again because they can get corrupted in certain situations. When that happens the .moho file size increases a lot and causes performance problems but what I told you solves the problem easily.
*NEW* Find and delete negative keyframes
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 10266
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Find and delete negative keyframes
In another thread, someone also mentioned trying this:
- 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
Do you have reference layers? Try to delete them and see if performance improves. If it does, you can create the references again. Sometimes they get corrupted and slow Moho down.kgeetvcartoons wrote: ↑Thu Mar 18, 2021 3:16 am THANK YOU SO MUCH! It worked. It didn't find any negative keyframes so we'll work from there!
Thanks again!
Edit: oh I didn't see Wes mentioned this already. Anyway, did you solve your performance problem?
Re: *NEW* Find and delete negative keyframes
I've been running your script automatically on opening files, because there were some instances were corrupt layers were copied to many shots and it became impossible to work on the project. It has saved me a lot of headaches. (I did remove the "There were no keyframes found in the negative timeline." alert.)
Here's a script to run scripts automatically on opening files. Save it as LK_AutoRun.lua in your tools folder. Just add SomeScript:Run(moho) or any code within the LK_AutoRun:Scripts(moho) function and it will automatically run on opening saved files (there's a small exception when re-opening the same file, but ctrl+n cltr+w will make it run again). I've been using it to run various project management scripts. But it's been the most useful for Wes' negative keyframes script.
Here's a script to run scripts automatically on opening files. Save it as LK_AutoRun.lua in your tools folder. Just add SomeScript:Run(moho) or any code within the LK_AutoRun:Scripts(moho) function and it will automatically run on opening saved files (there's a small exception when re-opening the same file, but ctrl+n cltr+w will make it run again). I've been using it to run various project management scripts. But it's been the most useful for Wes' negative keyframes script.
Code: Select all
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************
ScriptName = "LK_AutoRun"
-- **************************************************
-- General information about this script
-- **************************************************
LK_AutoRun = {}
function LK_AutoRun:Name()
return "Auto Run Script"
end
function LK_AutoRun:Version()
return "0"
end
function LK_AutoRun:Description()
return "Auto Run Scripts"
end
function LK_AutoRun:Creator()
return "Lukas Krepel, Frame Order"
end
function LK_AutoRun:UILabel()
return("Auto Run Script")
end
function LK_AutoRun:IsRelevant(moho)
if (MohoMode == nil or MohoMode:Vanilla()) then
return false
else
self:Run(moho)
return false
end
end
function LK_AutoRun:IsEnabled(moho)
self:Run(moho)
return false
end
LK_AutoRun.LastDocument = ""
-- **************************************************
-- Check if we have already run on this document.
-- Does not work when opening the same file after just closing it.
-- If you DO want to run it in that case, just create and close a new empty file.
-- **************************************************
function LK_AutoRun:Run(moho)
local thisDocument = moho.document:Path()
if (self.LastDocument ~= thisDocument) then
self.LastDocument = thisDocument
self:Scripts(moho)
end
end
-- **************************************************
-- Put all code you want to run automatically in this function:
-- **************************************************
function LK_AutoRun:Scripts(moho)
Syn_NegativeKeys:Run(moho)
end
- synthsin75
- Posts: 10266
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Find and delete negative keyframes
Nice one, Lukas. I've been using the IsRelevant or IsEnabled functions to automatically run code for years.
Currently, I'm using it to invoke a button script's settings dialog, that I only need once, at most, every time I start Moho.
Currently, I'm using it to invoke a button script's settings dialog, that I only need once, at most, every time I start Moho.
- 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/
-
- Posts: 58
- Joined: Fri Mar 12, 2021 2:34 am
Re: *NEW* Find and delete negative keyframes
I have moho 13.5 and your script is not available. Can you please give me the info of how to download and where to get the download again? I see the copy and paste but I don't have a clue what to do with it.
Re: *NEW* Find and delete negative keyframes
The link is in the first post, and the current version works for Moho 13.5. When the script is updated, this same link will download the latest version.
If you want Lukas 'auto-run' mod, just copy and paste the text from his post above exactly as instructed.
Hope this helps.
If you want Lukas 'auto-run' mod, just copy and paste the text from his post above exactly as instructed.
Hope this helps.
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: 55
- Joined: Wed Dec 20, 2017 11:27 pm
Re: *NEW* Find and delete negative keyframes
link lead to 404 error
- synthsin75
- Posts: 10266
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Find and delete negative keyframes
Last edited by synthsin75 on Thu Nov 04, 2021 6:28 pm, edited 1 time 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/
- davoodice2
- Posts: 397
- Joined: Tue Jun 15, 2021 1:14 pm
Re: *NEW* Find and delete negative keyframes
2 days ago my moho became like turtleGreenlaw wrote: ↑Sun Sep 29, 2019 3:43 pmCoincidentally, 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.
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- animated_magic
- Posts: 7
- Joined: Thu Sep 29, 2016 1:39 pm
Re: *NEW* Find and delete negative keyframes
Thank you Wes, you're a life saver! Had negative keyframes happen a couple of times and it was driving me a slightly crazy. This script is brilliant!
- synthsin75
- Posts: 10266
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Find and delete negative keyframes
Always happy to hear old scripts are still helping people.
- 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/