Page 10 of 11
Posted: Wed Feb 01, 2012 8:56 am
by Breinmeester
Rudiger did a script that loads and saves animation into actions so its ready to be pasted at any point in the timeline and for multiple times.
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Thu Oct 28, 2021 8:13 am
by davoodice2
any body can fix links? and block this bot from forum
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Thu Oct 28, 2021 10:44 am
by hayasidist
davoodice2 wrote: ↑Thu Oct 28, 2021 8:13 am
any body can fix links?
Vern was back and active on the forum recently -- you could try a PM to him...
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Thu Oct 28, 2021 11:00 am
by davoodice2
hayasidist wrote: ↑Thu Oct 28, 2021 10:44 am
davoodice2 wrote: ↑Thu Oct 28, 2021 8:13 am
any body can fix links?
Vern was back and active on the forum recently -- you could try a PM to him...
thanks
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Tue Feb 01, 2022 10:08 am
by Lukas
heyvern wrote: ↑Tue Jan 30, 2007 7:50 amNEW! Save and Load bone Animation!
[...]
-vern
Hi Vern, do you still have these scripts? Even though they are outdated, I'm very interested and could possibly update them. I am building a tool for re-using animation, but have not figured out how to build a library yet. This sounds like a smart way of going about it.
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Tue Feb 01, 2022 10:28 am
by Víctor Paredes
Hey, Lukas.
I couldn't find Vern's script (although I'm sure I should have a backup somewhere), but in the forum I found this other script made by David F. Sandberg. Maybe it can help:
https://www.lostmarble.com/forum/viewto ... 12&t=16748
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Tue Feb 01, 2022 11:18 am
by Lukas
Thank you Victor, I'll have a look!
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Tue Feb 01, 2022 8:54 pm
by teotoon
Hello Lukas,
I found the script you've asked. I also added a similar script.
I hope these would be helpful.
Good luck,
LG
https://www.mediafire.com/file/80nwka7u ... s.zip/file
https://www.mediafire.com/file/4byzonon ... n.zip/file
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Wed Feb 02, 2022 10:01 am
by Lukas
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Sat Feb 05, 2022 9:50 pm
by heyvern
Sorry for being away again.
Yes, I still have these scripts. I haven't used them in ages since Moho has its own built-in copy/paste bones.
As you said they don't work very well in newer versions of Moho. There was way too much version-specific junk in there.
I will try to post them later tonight after work.
My script was based on the same scripts posted here and created by "Tha Narie".
I think when I revised it, there were so many changes I simply replaced my name on it. I did combine it into one script and added some extra functions. This was ages ago so it's hard to remember. I do remember that script was A NIGHTMARE to work on. There are SO MANY BONE PROPERTIES to track for copy and paste.
I also had a "save animation" script that's in the same shape. It required similar amounts of nightmarish coding to manage all properties not just of bones but EVERYTHING. I believe my first iteration only saved bone animation.
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Sun Feb 06, 2022 9:46 am
by Lukas
heyvern wrote: ↑Sat Feb 05, 2022 9:50 pmSorry for being away again.
Yes, I still have these scripts. I haven't used them in ages since Moho has its own built-in copy/paste bones.
As you said they don't work very well in newer versions of Moho. There was way too much version-specific junk in there.
I will try to post them later tonight after work.
My script was based on the same scripts posted here and created by "Tha Narie".
I think when I revised it, there were so many changes I simply replaced my name on it. I did combine it into one script and added some extra functions. This was ages ago so it's hard to remember. I do remember that script was A NIGHTMARE to work on. There are SO MANY BONE PROPERTIES to track for copy and paste.
I also had a "save animation" script that's in the same shape. It required similar amounts of nightmarish coding to manage all properties not just of bones but EVERYTHING. I believe my first iteration only saved bone animation.
Good to see you back here again!
Intesting. Saving everything in text seems like a crazy (but impressive) undertaking. How does it know what child-layers to apply keys to when loading the data? By layer-name just like bone-names?
I'm still not sure what exactly I am looking for, but here's me thinking out loud:
I think this might be a good (and simpler, thus less prone to getting broken by updates) solution to my problems:
- An 'Export all actions as moho files' script. That exports all Regular and Morph actions of a layer as .moho files (with all keys in the Mainline) in a folder. (skipping actions of which .moho files already exist in that folder)
- An 'Import actions from folder' script. That imports all .moho files in a folder a user points at. It would simply interpret the mainline keys from "Walkcycle.moho" as an action named "Walkcycle".
That way it doesn't matter in what kind of file you're creating new actions for re-use (because often you animate something in a regular shot that you later realise is great for re-use). And if you work on a file and realise you could re-use an action but you're working on an outdated version of a rig (which happens a lot for a variety of reasons) you can still just easily import all re-usable animation.
As a bonus you can easily update actions by simply editing the animation in "Walkcycle.moho" and the next time you import you'll have the latest versions of all actions.


Re: HeyVern's scripts and tools - (focus on bones)
Posted: Mon Feb 07, 2022 3:37 pm
by Lukas
Lukas wrote: ↑Sun Feb 06, 2022 9:46 am- An 'Export all actions as moho files' script. That exports all Regular and Morph actions of a layer as .moho files (with all keys in the Mainline) in a folder. (skipping actions of which .moho files already exist in that folder)
- An 'Import actions from folder' script. That imports all .moho files in a folder a user points at. It would simply interpret the mainline keys from "Walkcycle.moho" as an action named "Walkcycle".
Oops, this turned out to be more difficult than I thought it would be... Because I can't modify and save a MohoDoc returned from LoadDocument() or by creating new files.
The "Actions" window actually has "Import Action" and "Export Action" buttons, but unfortunately I can't find a lua function that does the same thing.
It does just seem to write a json file, so it might be close in functionality to your save/load script Vern.
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Tue Feb 08, 2022 1:18 am
by synthsin75
Lukas wrote: ↑Mon Feb 07, 2022 3:37 pm
Because I can't modify and save a MohoDoc returned from LoadDocument() or by creating new files.
You should be able to save a new file using: ScriptInterface:FileSave() or ScriptInterface:FileSaveAs(path)
Maybe you were looking at: LM.GUI.SaveFile(caption)
That only prompts the user for a path.
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Tue Feb 08, 2022 9:30 am
by Lukas
synthsin75 wrote: ↑Tue Feb 08, 2022 1:18 am
Lukas wrote: ↑Mon Feb 07, 2022 3:37 pm
Because I can't modify and save a MohoDoc returned from LoadDocument() or by creating new files.
You should be able to save a new file using: ScriptInterface:FileSave() or ScriptInterface:FileSaveAs(path)
[...]
Ah you're right, thanks! After ScriptInterface:FileSaveAs(path) I can keep using moho.document to modify each file. I'm not sure what I was doing wrong before. I'm still having some trouble reverting back to the old file after exporting all actions as .moho files. It crashes, but only sometimes (all tested on the same file). API access to 'export action' and 'import action' would make all of this a lot easier :/
Re: HeyVern's scripts and tools - (focus on bones)
Posted: Wed Feb 09, 2022 5:12 am
by synthsin75
Yeah, I think we've talked about Moho not quite updating the moho.document reference before, especially with new, tabbed documents. Have you tried by having the script only have one open document at a time?