Script for lip sync I'm working on

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Re: Script for lip sync I'm working on

Postby strider2000 » Fri Jan 15, 2016 2:30 am

I just confirmed that the / works on Windows. I was wondering about that when I wrote the script, but don't have ASP running on a Mac so I couldn't test. Sorry about that. :oops:

I've made the change on mine, I've also created a little button so you can make it a tool. I haven't posted the change, because there are a couple of other things I'd like to add first.
- Animator's Survival Kit suggests 2 frames for consonants
- May want to support extreme open for emphasis on vowels (similar to long)
- Would like to improve selection of frames, maybe start where timeline marker is

Does anyone know now to capture the start an end frame for a timeline selection? I see that you can select in the timeline. I know that's for selecting keys, but if I could capture start and end frame I'm thinking I could make it a tool, then bring up the dialog after mouse up. Don't know how to do that yet, but thinking about it.
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

Re: Script for lip sync I'm working on

Postby synthsin75 » Fri Jan 15, 2016 2:59 am

Once upon a time I wrote a bit of code to get a timeline range from dragging in the workspace...syncing SetCurFrame with mouse move (I think). I'm not sure if I can find what script (or test script) I wrote that in though.
- Wes
ImageImageImage
User avatar
synthsin75
 
Posts: 6921
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma

Re: Script for lip sync I'm working on

Postby strider2000 » Sat Jan 16, 2016 4:15 am

I've seen the bone time machine and will probably use that as an example if I can't find out how to capture events in the timeline. I expect it does something similar to what you're suggesting.
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Tue Feb 16, 2016 11:15 am

Sounds amazing, really looking forward. And don't forget the donate button for your great work. I really value this tool!

Yea, the biggest issue I'm experiencing currently is the amount of time required to enter frames. If start frame would be captured and cursor would focus in the end frame box and even select the contents (for quick erasing), this would make it much faster. Tool-ability sounds great as well!!! And if you manage to do a draggable selection on the timeline with the tool, this would be even more amazing!!!

Such great work over there!!! Thank you so much for this.
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby strider2000 » Sun Feb 21, 2016 1:45 am

I've been pretty swamped lately, but I have the start frame capturing the timeline marker. Does anyone know how to set the focus in an ASP dialog? I know how to do it in dojo, but not ASP :oops: I'll also try the time machine approach when I get a chance.
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Tue Feb 23, 2016 6:33 pm

strider2000 wrote:I've been pretty swamped lately, but I have the start frame capturing the timeline marker. Does anyone know how to set the focus in an ASP dialog? I know how to do it in dojo, but not ASP :oops: I'll also try the time machine approach when I get a chance.


I can imagine the time machine approach with dragging on the timeline would be incredibly fast to work with - if you would just activate the tool, drag from start to end keyframe and then get the dialog with prefilled start and end frames and the text phrase in focus, this would be an incredible thing for lipsync workflow!!!
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby strider2000 » Wed Feb 24, 2016 4:22 am

lehtiniemi wrote: if you would just activate the tool, drag from start to end keyframe and then get the dialog with prefilled start and end frames and the text phrase in focus


Well, I still don't know how to set focus, but ... I have the drag the cursor to set the start and end frames working!!! Much better now! You set the start frame by just setting the timeline marker _in the timeline_ then you set the end frame by dragging _in the workspace_ until you get to the end frame. That will bring up the dialog.

Here's a quick video explaining the update.


You can get the new script here.
http://www.mediafire.com/download/jbb67ueddt9aqk5/LipSync2.zip

Enjoy!
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Wed Feb 24, 2016 9:35 am

WHOAAAA!!! THIS IS AMAZING!!!

You don't know how much this helps me in my current project. Ok well you prorbably do because you wrote it. :D Thank you soooo much!!!

Oh and remember the donate-thingie....!!! This is the coolest thing I've ever seen. Soooo fast. The refresh-thing is a minor issue and at least it doesn't disturb any essential workflow thingies.
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby strider2000 » Wed Feb 24, 2016 2:36 pm

Glad it helps :)

lehtiniemi wrote:Oh and remember the donate-thingie....!!!


I don't have a website and paypal seems to imply that the donate button is only for charitable fund raising, so I created a paypalme link. (I didn't include it here, because I didn't want to imply that I'm taking advantage of this site, so I just sent the link to you via message.) I'm not a paypal expert, so just learning about a lot of that stuff.

I'll continue to improve the script as I learn more about the ASP API and animation. (Next will probably be a control for consonant length. It's just 1 right now, but Richard Williams suggests 2.)
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Wed Feb 24, 2016 4:01 pm

strider2000 wrote:Glad it helps :)

lehtiniemi wrote:Oh and remember the donate-thingie....!!!


I don't have a website and paypal seems to imply that the donate button is only for charitable fund raising, so I created a paypalme link. (I didn't include it here, because I didn't want to imply that I'm taking advantage of this site, so I just sent the link to you via message.) I'm not a paypal expert, so just learning about a lot of that stuff.

I'll continue to improve the script as I learn more about the ASP API and animation. (Next will probably be a control for consonant length. It's just 1 right now, but Richard Williams suggests 2.)


Thanks! I'll get back to that after my next paycheck. :)
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Fri Feb 26, 2016 10:57 am

strider2000,

I got this one idea for future if you keep on improving the script.

Sometimes there are characters that speak really slowly or they have longer vowels in the words which need require adding additional keyframes so it doesn't look like the mouth "stops" inbetween.

Would it be technically possible that the script could automatically alternate layers for long vowels. In practise this would mean the following:
-I would first add switch layers AI, AI 2, AI 3 or something
-When applying the script, it would detect if the vowel is longer than 3 frames for example
-In this case the script would look for AI 2 and switch to this.
-If the vowel still keeps on going on after 3 more frames, it would switch to AI 3 etc.
-In addition, if the user would add a number after a letter (like W1), this would mean the alternation rate would be every frame. W2 would make the alternate switch get changed every other frame. W3 every third (default in my example). But this rate-feature is pure extra and not compulsory at all.

This is a feature that I often find doing manually, in my current project one of the characters speaks really slowly so I keep having to add additional frames to long vowels all the time. I don't know if my example is the best way for it to work but this kind of feature would rock!
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Fri Feb 26, 2016 1:13 pm

Maybe this helps with updating the keyframes on the timeline?

viewtopic.php?f=12&t=28594
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby strider2000 » Sat Feb 27, 2016 11:42 pm

I tried that, but it didn't work. However, it's possible that I did something wrong. I'll check it again when I have a chance.
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

Re: Script for lip sync I'm working on

Postby lehtiniemi » Sun Mar 06, 2016 7:47 pm

If you add this after moho.layer:UpdateCurFrame(true):
moho:UpdateUI()

then the newly added keyframes seem to get redrawn and it works perfectly!
lehtiniemi
 
Posts: 107
Joined: Mon Jan 14, 2013 3:18 pm

Re: Script for lip sync I'm working on

Postby strider2000 » Mon Mar 07, 2016 2:33 pm

Cool. Thanks :)
My new website (just getting started) | M1 Characters for Moho
User avatar
strider2000
 
Posts: 425
Joined: Sat Mar 07, 2015 5:14 pm

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest