Request: transfer switch layer keyframes to actions...

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
funksmaname
Posts: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Request: transfer switch layer keyframes to actions...

Post by funksmaname »

Hi,
I have a character, who has a mouth with skin around it to hide the teeth/tongue etc, and a beard on top which is masked by the head shape on a seperate layer - so to create mouth shapes i cant use switch layers, as i'd need to switch both the beard and the mouth - as the beard is on top of the mouth which extends past the 'inner beard'

So i created actions for all the mouth shapes with point translation - and now i have exported a long audio file from papagayo which has all the switch info.

I could go frame by frame and manually put action refs where the switch refs are, but that is really time consuming as you have to right click the switch to find out which shape it is, then flick back, and apply the action :S I tried multiple copies of the head within switch layers each having a single frame action, but then you get no interpolation...

Is there any way to script the automatic placement of action refs based on a mouth switch layer (obviously naming all actions the same as the mouth switches, and applying them to a folder layer with the vector layers underneith (as per DarthFurbys action method)?

Thanks for listening! :)
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Here's the script from Ramón López:

viewtopic.php?t=2424

Go to the last post on the first page and the link is the word "Here". That will take you to the script. It may load as a page of text, you can save that to the hard drive and rename it with the .lua extension or you could right click on the link and save it that way instead.

-vern
User avatar
funksmaname
Posts: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Post by funksmaname »

YES!
I think i want Ramons babies.

do you have any idea how to use his faux object rotation script though? i made it a button and it doesnt seem to do anything...?

Thanks Vern.
User avatar
Víctor Paredes
Site Admin
Posts: 5664
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

that script is great. i really love it.
but i don't know what Faux objegt rotation is. can you put the post link?
User avatar
funksmaname
Posts: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Post by funksmaname »

sorry - this one Here
:)
User avatar
Víctor Paredes
Site Admin
Posts: 5664
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

ahh. this one. is tricky.
and fazek made it, not ramón.

ok, copy the code into notepad or similar and save it as FA_ReversePoints.lua
save this file into \Anime Studio Pro\scripts\tool
in the same folder there is a file called "_tool_list.txt". open it and add this line

Code: Select all

button	FA_ReversePoints	...
i have added the line below the "group Draw". where the tool appear, will depend of the site you put this line into the text file.
i have made an ugly icon too, if you want
Image
just save it into the same folder as "FA_ReversePoints.png"

to use the tool, just select the points you want to reverse and then push the "reverse points" button (you can re-push it as times as necessary).
User avatar
funksmaname
Posts: 3174
Joined: Tue May 29, 2007 11:31 am
Location: New Zealand

Post by funksmaname »

ah, i had it as 'tool' not 'button... it works now - sort of - but instead of a mirror rotation, it seems to just be rotating the shape 90 degrees clockwise?

and i know it wasn't Ramon's script but i want to have his babies for the lipsync with actions script :)
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I remember this little tool.

I have used it a few times in the past and it works GREAT, but now that I use bones for doing turns I don't have as much use for it.

I have to say this tool is fantastic if you need to do a "two sided" switch layer turn.

One thing to remember, if you use it on multiple shapes you won't get the symmetry you might expect. The "reverse" is based on the center of each closed shape.

If you had two shapes each shape reverses on its OWN center point... not the center of the entire group of selected points. This is a small issue and makes sense. When you use it you will see what I mean.

-vern
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

funksmaname wrote:ah, i had it as 'tool' not 'button... it works now - sort of - but instead of a mirror rotation, it seems to just be rotating the shape 90 degrees clockwise?
That's because your shape isn't "symmetrical". If the shape has more points on one side of the "center" than on the other if will "flip" in an odd way.

This tool works best when the shape is symmetrical, the same number of points on either side of the center of the closed shape.

If the shape is not closed it will act strange. Closed symmetrical shapes are needed for best results.

-vern
donnie
Posts: 111
Joined: Mon Oct 16, 2006 11:53 pm

Post by donnie »

Hi there,

Sorry if I'm coming across as a little stupid but Having downloaded Ramon's switch actions script Ive no idea how to get it to work! I understand its an embedded script but what is the actual process in setting it up correctly?

Ive been through all of Ramon's and 7feets posts on the subject but im none the wiser! (sorry, bit dopey as I say),

any help greatly appreciated as the idea sounds cool (what I understand of it!)

cheers,

Donnie
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Donnie,

neither of the scripts mentioned in this thread are "embedded" or layer scripts. One is a menu script the other is a tool script.

The "switch actions" script is a menu script that is used on a layer that has actions for "phonemes" to import a "dat" file from papagayo for lip sync instead of using switch layer phoneme from a dat file.

In order to use this script you just pop it into the menu folder of the scripts folder of the ASP application.

You also need to have actions created for a layer for each of the 10 phonemes or mouth shapes used by papagayo AND you also need a dat file produced by papagayo...

Phew! Lots of stuff.

The best way to understand this would be to download the free papagayo application and learn that first. Then learn about actions in AS.... then in your head sort of "combine" the two concepts. ;)

Papagayo is great but some of us wanted to use it with actions. If you use papagayo and know about actions... you will immediately see the benefits.

-vern
donnie
Posts: 111
Joined: Mon Oct 16, 2006 11:53 pm

Post by donnie »

Cheers Vern,

I got a bit confused as I thought that you could somehow create a load of actions in a Bone layer, put it in a switch folder, and use the switch for selecting mouth shapes rather than inserting references of an action.

Ill have a look at Papagayo but I normaly dont like these sort of automated lip sync programs as i find it easier just to choose the mouth shapes I want at the equired frame.

Thanks very much for your help!

D.
Post Reply