Can a script do this?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Can a script do this?

Post by mkelley »

Once again, I'm not looking for anyone to write anything -- I'll do it myself if it's possible -- but I just want to know if it's even worth investigating the capability I'd like to have.

Right now I'm getting some terrific facial expressions laid on top of lip sync. I do this by creating four or five different mouth sets (smiling, angry, neutral, grimace) in a "master" switch layer as well as different eyebrow and eyelid switch sets. Animating all this is a bit of a PITA, though, as I need to set all of the keys separately one at a time.

As a programmer it immediately occured to me that I can program something like Papapayo and have a person indicate where they want their character to smile, snarl, whatever and have the resultant DAT file loaded into the switch layers as noted above. And I will indeed do this, but getting the timeline (and audio lines) right is a lot of work so I'd rather work with the timeline as it exists in AS.

I have almost zero idea what the scripting is capable of, but what I'd like is to be able to go into any point on the timeline and from a dropdown choice choose a facial expression and then generate the result switch keys for the various layers as noted above (actually first I'd have it lay down an existing key for the previous expression, to "hold" it -- or perhaps have that as a choice as well).

Is any of that possible in AS scripting, or should I work on an external program to do what I want?
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I did try something like this but not for lip sync.

If I understand you correctly what you are trying to do is "add" actions. For instance if you have an action that moves a point x distance and an action that moves a point y distance you should be able apply each action individually and have a point move x + y. Or possibly you should be able to appy an action to REPLACE all movement.

Unfortunately I haven't been able to pull that off yet. It would be cool as heck. What you describe should be possible. I just don't have the skill or possibly the patience to do it.

I mention using actions because that seems to be the best way to "mix" saved "poses" the way you describe. The mechanism is already in AS and actions are scriptable. Actions can also be used instead of switch layers for lip syncing with Papagayo.

-vern
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

I think there is a work around for that.

1) Place all the switch layers inside a folder (the current bone layer is valid)
2) At folder level (probably the bone layer) create a set of actions (one per each individual drawing)
-angry eyes
-normal eyes
-sad mouth
-happy mouth

and so on.

Be sure that you only modify one switch layer every time in every action.

Now create a new action called normal eyes + sad mouth, then at frame 1 copy the action "normal eyes" inside. To do this just make one click on "normal eyes" action and press Insert copy button. Repeat the same with "sad mouth" action. Then you have recorded a mix of two actions into a single one.

You should repeat that for every combination you want. If each switch layer have more nested switches then you just need to combine actions in cascade.

That would allow you quickly create a tree-like library of switches combinations, and avoid the tedious task of create nested switch keyframes

What should be a cool script is the one that move the time position of a bunch of nested keyframes for any kind of layer combination. That's what is really needed in AS.

-G
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Post by mkelley »

I have to remember not to get "stuck" in a certain way of thinking because you guys know the program so much better (and I well remember thinking how terrible it was to draw in AS and Vern's remarks kept me at it to where I like it a LOT better than AI now) but I really HATE actions.

I've followed the tutorial about how to create head turns with actions and even if that guy's tutorial he gets confused and lost and makes many wrong moves (selecting the wrong layer to start the action, not going back to the right layer for another action, etc. etc). To me actions are just not nearly as straightforward as putting keys for a switch layer.

But I am willing to at least listen to you gurus -- however, I haven't a clue as to how to make actions do the same kind of interpolated lip sync I get when I load in a Papagayo file. How the heck does *that* happen? Is there a tutorial for it somewhere?

And, Genete -- I understand you all the up until you say "now create a new action called "normal eyes" " etc. Where are you suggesting I create this action? In that same upper folder that contains the angry eyes, normal eyes, etc? Because it will get *real* confusing real fast if I have all the combinations there as well as the "parent" expressions. Or are you saying to create yet one more upper folder that contains the lower folders?

I'll play around with this a bit and see if I can get it to work without completely confusing me.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

mkelley wrote:And, Genete -- I understand you all the up until you say "now create a new action called "normal eyes" " etc. Where are you suggesting I create this action? In that same upper folder that contains the angry eyes, normal eyes, etc? Because it will get *real* confusing real fast if I have all the combinations there as well as the "parent" expressions. Or are you saying to create yet one more upper folder that contains the lower folders?
All the actions are created at the same folder level (the higher one). That's very important because when you create an action at a folder, all the children (folders and sub folders, and so on) create the same action with the same name. If you create an action at a sub-folder level it is not visible at its parent level what is a pity because you cannot combine it with others.

You save time when you combine two actions into a single one because you do it very quick (meanwhile editing the combined action just select each single action and insert a copy of each at frame 1) and you have the ability of insert a lot of switch keyframes (imagine combine 5 switch at the same time) with only one click.

-G
Post Reply