Please, how can I Insert an Action by Script?? (PLEASE)

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

Post Reply
User avatar
Ramón López
Posts: 1802
Joined: Sun Aug 08, 2004 1:41 pm
Location: Elda! Again...
Contact:

Please, how can I Insert an Action by Script?? (PLEASE)

Post by Ramón López » Fri Sep 30, 2005 4:56 pm

HELLO! Well, this comes to this Feature Request derivated Post http://www.lostmarble.com/forum/viewtopic.php?t=2412, it was only a matter of time that I would put it here... Jaja, SORRY! but I'm SO desperate with this issue that... well, the thing is that in the Scripting Documentation I found this info:

Code: Select all

void InsertAction(name, frame, byReference)
     Inserts an action into the main timeline.
          Return value: none
          name (string): the name of the action to insert
          frame (int): which frame to insert it at
          byReference (bool): true if by reference, false if by copy
...But the problem is that I'm SO ignorant yet, that I don't know how to use it correctly without can see any example (I've tried, yes... but nothing :( ) Somebody can helpme with this? I think/hope that when I know how to Insert an Action by Script I'll get modify the 7feet's ImporDAT script (with his permission ¿...?) to can made LipSync based in Actions instead Switch Layers method :) I think that this can by very usefull & powerful feature for others too and cause of this, if you know something about (more than I, sure...) or have any clue or some/anything it'd be very good know it, well, hope that this can be resolved soon , I'll go on "investigating" THANK YOU for/if all and CIAO! :D
Last edited by Ramón López on Fri Sep 30, 2005 5:45 pm, edited 2 times in total.
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA » Fri Sep 30, 2005 5:34 pm

YES.......... good one, Ramon...

inserting actions through scripts would certainly open worlds of possibility.
User avatar
Lost Marble
Site Admin
Posts: 2190
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble » Fri Sep 30, 2005 7:53 pm

Say you have a layer object - for example, the moho object passed in to most script functions has a copy of the current layer in moho.layer. So, to call this function you would say:

moho.layer:InsertAction("Action 1", 12, true)

This would insert the action named "Action 1" into the layer's timeline at frame 12, and would insert it as a reference (not as a copy). Of course, for this example to work, the layer already has to have an action named "Action 1".
User avatar
Ramón López
Posts: 1802
Joined: Sun Aug 08, 2004 1:41 pm
Location: Elda! Again...
Contact:

Post by Ramón López » Fri Sep 30, 2005 8:02 pm

...WOW!!! :D At last! THANK YOU LM!!! I was waiting for something like this in Real Time :D ...I can't wait to try it! I hope this works in my case (I must translate better the firs part of your post), but well, works it or not :arrow: THANK YOU!!!
PS: ...VERY MUCH! :D
User avatar
Ramón López
Posts: 1802
Joined: Sun Aug 08, 2004 1:41 pm
Location: Elda! Again...
Contact:

Post by Ramón López » Fri Sep 30, 2005 10:44 pm

:shock: Finaly...
Last edited by Ramón López on Fri Sep 30, 2005 11:06 pm, edited 1 time in total.
User avatar
Ramón López
Posts: 1802
Joined: Sun Aug 08, 2004 1:41 pm
Location: Elda! Again...
Contact:

Post by Ramón López » Fri Sep 30, 2005 10:45 pm

...it...
User avatar
Ramón López
Posts: 1802
Joined: Sun Aug 08, 2004 1:41 pm
Location: Elda! Again...
Contact:

Post by Ramón López » Fri Sep 30, 2005 11:05 pm

...WORKS!!! :D :D :D ...Sniff :cry: I CAN'T BELIEVE IT!!! :D Really, I've been SO much time looking for it that, that... well, now I'm more quiet 8) , but when I've run the script and the "Referenced" Keyframes have appeared... uf, how explain it... I've started to jumping! :D Of course, THANKS to 7feet because he made all the scripting work, and to LM (of course too) because he have made ALL the rest :) (the reason for it didn't work to me at the begining was because the to values were inverted in order, jaja... :roll: ) I'll be always GRATEFULL to both!!! Now I've try it a little more and then I'll put it here... I want to be sure too about some little things more :wink: ...CIAO!
Last edited by Ramón López on Sun Oct 02, 2005 5:15 pm, edited 1 time in total.
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman » Sat Oct 01, 2005 7:55 am

Congratulations Ramon! I'm happy you finally got it to work!
User avatar
mr. blaaa
Posts: 622
Joined: Sun Jul 31, 2005 12:41 am
Location: ---
Contact:

Post by mr. blaaa » Sat Oct 01, 2005 5:07 pm

:wink: yeeehaaw!
Image
User avatar
Ramón López
Posts: 1802
Joined: Sun Aug 08, 2004 1:41 pm
Location: Elda! Again...
Contact:

Post by Ramón López » Sun Oct 02, 2005 4:23 pm

HELLO!!! :D Jaja... and THANK YOU guys for your coments and THANK YOU again to 7feet and LM to make it possible, I hope this can be usefull for all of you too :) ...For me, what can I say... it have saved my life! The Switch Layers have been always a NIGHTMARE for me and my characters and I can now do Lip Sync (or any other thing) without ANY limit in the construction of they, without any limit in movements/interpolations with face interactions and yes, all in the more easy, simple (only one layer if I want) and quickly way! :D I think my characters soon will be ALIVE! :) ...Well, I want to improve it but for now you can try it :arrow: HERE, I have got add a window to choose if insert *.dat file as Reference or as a Copy, little thing but I'm only starting :wink: I've other ideas to do it more USEFULL & POWERFULL but I'm afraid I can get it with my actual "knowledgeds", an option (i.e.) to inset a Prefix in a text box like "Left", "Right", "Center" and Script can add it to the phonemes name when load a *.dat info to make possible insert actions called Left_AI, Left_O, Right_MBP, CENTER_etc, etc... for diferent heads orientation with the same *.dat file without any extra job it'd be a DREAM! :) and would become all of this in a most powerfull and interesant feature, well, I'll see what can I do, but if you want help me with that I'll be VERY grateful (again :) ) ...Now I'm going to see what can I do with this http://www.lostmarble.com/forum/viewtopic.php?t=2233, the most important scripting work for me (and my characters) now... (of course any help i'd be very apreciated too :wink:) ...CIAO!
Last edited by Ramón López on Tue Dec 15, 2009 12:50 am, edited 2 times in total.
Dodgy
Posts: 206
Joined: Sat Jan 13, 2007 8:01 pm
Location: Sydney
Contact:

Post by Dodgy » Sat Mar 21, 2009 9:42 am

Does anyone have any idea where I can get this script? Only the link is broken.....
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 » Sat Mar 21, 2009 7:06 pm

viewtopic.php?t=10551

The large script archive posted here is the only place I know of. :wink:
Dodgy
Posts: 206
Joined: Sat Jan 13, 2007 8:01 pm
Location: Sydney
Contact:

Post by Dodgy » Sun Mar 22, 2009 12:39 am

Thanks Synth.
Post Reply