Script Automatic Lipsync?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Greenlaw
Posts: 9300
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script Automatic Lipsync?

Post by Greenlaw »

synthsin75 wrote: Sun Jul 24, 2022 2:39 am The only time layer order matters in a switch layer is when you're not using Preston Blair phonemes and Moho is just using audio amplitude to set the switches. The louder the audio, the higher in the layer order.
Oh that's funny! I'll have to try that out.
User avatar
slowtiger
Posts: 6086
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Script Automatic Lipsync?

Post by slowtiger »

That's the one I'm going to use right now, simple dynamic lipsync is good enough.

I can't download your hand example, file not found.

I still think it makes a difference that I fill my swicthes with images instead of vector layers, and that's the reason it doesn't work for me.


I just finished the first 2 puppets 10 min ago, main characters, so more elaborated: 5 head views (+4 mirrored), 3 body views (+2 mirrored), but only from the hips upwards because it's 80% talking heads only. Remember: only rig what you really need. Other characters will have only 2 heads.

Walking characters and anything out of the line will be done in TVPaint.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
Greenlaw
Posts: 9300
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script Automatic Lipsync?

Post by Greenlaw »

slowtiger wrote: Sun Jul 24, 2022 9:00 pm I can't download your hand example, file not found.
Oops! Thanks for letting me know. :)

Link is fixed now and here it is again: multiSiwtchHand.moho

BTW, I don't normally work directly out of Dropbox but I did for this project and somehow the file got corrupted. I recall somebody saying that they had trouble working directly out of Dropbox so I better look into that. Just a warning for anybody else doing that.
User avatar
Greenlaw
Posts: 9300
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script Automatic Lipsync?

Post by Greenlaw »

Quick follow up on my Dropbox file corruption problem. Yup, here's the topic I remembered:

Moho 13.5 and Dropbox problem

The problem is apparently an incompatibility with Dropbox and Moho's Auto-save. Disable Moho's Auto-save and it should be fine. Alternatively, you can work out of a normal directory instead of Dropbox, and copy your files over to Dropbox when your finished and ready to share. (I'm doing the latter.)
User avatar
Greenlaw
Posts: 9300
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script Automatic Lipsync?

Post by Greenlaw »

slowtiger wrote: Sun Jul 24, 2022 9:00 pm I still think it makes a difference that I fill my swicthes with images instead of vector layers, and that's the reason it doesn't work for me.
It really shouldn't matter but I'm going to do another test right now to be sure.
User avatar
synthsin75
Posts: 9984
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Script Automatic Lipsync?

Post by synthsin75 »

slowtiger wrote: Sun Jul 24, 2022 9:00 pm I still think it makes a difference that I fill my swicthes with images instead of vector layers, and that's the reason it doesn't work for me.
Only in that Moho won't recognize Preston Blair phonemes if they end in .jpg, .png, etc.. The layer names must only be the phoneme names. Otherwise Moho will default to simple amplitude lip sync.
User avatar
Greenlaw
Posts: 9300
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script Automatic Lipsync?

Post by Greenlaw »

Confirmed: it doesn't matter if the layers are vector or image, it's about the names...

Image

Here's something surprising: To make the above I updated a copy of mutliSwitchHand.moho project uploaded earlier and found that replacing the vector layers with image layers was easier than expected!

1.First I created a PSD (in Photoshop) using layers with the same names as the vector layers...

Image

(Note: I used Photoshop but any paint program that exports layered PSD (i.e, Krita, Clip Studio Paint, Photopea, etc.,) will do.)

2. In Moho, I opened the multiSwitchHand.moho project and saved it as multiSwitchPaw.moho.

3. Imported the PSD and dragged the images to the appropriate Switch folders.

4. Deleted the vector layers...

...and that was it. Since Moho only cares about the layer names and not the layer order or layer type, the Smart Bone Actions and keyframes I created previously adapted to the new drawings without a hitch!

Yeah...Moho 13.5.5 is awesome! 😸

Here's the project download for the kitty paw version including the PSD file:

multiSwitchKittyPaw.zip

Hope this helps!
Last edited by Greenlaw on Mon Jul 25, 2022 3:46 pm, edited 1 time in total.
User avatar
slowtiger
Posts: 6086
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Script Automatic Lipsync?

Post by slowtiger »

Deleting the file extensions from the layer names .. . now that's something I hadn't tried yet. Will report later.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
Greenlaw
Posts: 9300
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script Automatic Lipsync?

Post by Greenlaw »

Oh, yeah, that will probably do it.

When I import PNGs or JPGS, they always come in with their extensions in the layer name. I understand why the devs decided on this behavior but I think this should be a user option in Preferences since I always wind up stripping the extensions to keep the layer names concise. (Now I have another reason to strip the extensions from the layer names.)

BTW, if you use layered PSD, the images will not have the .PSD extension unless you named them that way in your paint program. The parent folder, however, will be labeled with .PSD.
Post Reply