Page 1 of 1

Scripting Documentation

Posted: Thu Feb 10, 2005 5:31 am
by Lost Marble
Some scripting documentation is finally available. I'm sorry to say that it's a bit sparse still. Every object and function available is described, but there are no step-by-step examples yet. For now, the best way to create new tools and menu commands is to start with one that comes with Moho and modify it to fit your needs.

This document should help when you're trying to figure out what the exact format of a function is, or what other operations are available. You can download it here:

http://www.lostmarble.com/moho/extras/s ... ipting.zip

Posted: Thu Feb 10, 2005 6:25 am
by myles
... and there was much rejoicing! Hurrah!

Thank you!

Posted: Thu Feb 10, 2005 6:26 am
by bupaje
Excellent, thanks LM. :)

Posted: Thu Feb 10, 2005 11:59 am
by 7feet
Hell yeah! But why did I have to find this at 4 o'clock in the morning (almost 6 now)?

A few things I was looking for I didn't find, that I was wondering about. A couple were from your "Bonesound" script. One:

Code: Select all

if (dlog:DoModal()
Never could quite figure out what that was for. Also none of the audio functions seem to be in there, unless I missed 'em. In searching for clues how things worked I had scanned through the program in a hex editor, and saw that there were now functions for Peak and RMS audio amplitude. They accessible from Lua?

There may be a few other doodads I didn't see, but lordy this has already cleared up some of my stupidity issues.

--Brian

Posted: Thu Feb 10, 2005 5:08 pm
by Lost Marble
7feet wrote:One:

Code: Select all

if (dlog:DoModal()
Never could quite figure out what that was for.
Look in the Reference section, LM.GUI, LM_SimpleDialog class. The DoModal function basically runs the dialog once it has been set up.
7feet wrote:Also none of the audio functions seem to be in there, unless I missed 'em.
Yeah, they're there - RMS and Peak too. See the Reference->MOHO->Script Interface class. The ScriptInterface class is particularly important - it's the object called "moho" that gets passed to your script whenever something happens (like a mouse click, key press, menu command, etc.).

The moho object (the Script Interface class) allows you to access layers, create new ones, rearrange them, access vector and bone data, etc.

Posted: Fri Feb 11, 2005 1:25 am
by 7feet
Sorry, I gave it a (relatively) quick run-through, and bloody tired, must have just missed 'em. Thanks

--Brian

Posted: Mon Feb 14, 2005 9:40 pm
by Rai López
WOW!!! IT'S GREAT!! :D :D THANK YOU FOR ALL! I hope that this help me for some day can write my own scripts, yes... :?

PD: Ah,that is not important, but will can in the future acces to Scripting Help by Moho Help Menu like occurs with normal help? BYE!

Posted: Mon Feb 14, 2005 10:22 pm
by Lost Marble
Ramón López wrote:PD: Ah,that is not important, but will can in the future acces to Scripting Help by Moho Help Menu like occurs with normal help? BYE!
No, probably not. Writing scripts is a different kind of skill than animating. Some people can do both, but we don't want it to look like you need to understand scripting in order to use Moho. Scripting is kind of a "bonus" feature, and something that non-programmers should feel free to completely ignore if they wish.

Posted: Tue Feb 15, 2005 9:09 pm
by nobudget
"we don't want it to look like you need to understand scripting in order to use Moho"

Macromedia, are you reading this? Good that's why I never upgraded Flash from version 4!

Reindert.
www.nobudgetvideo.com

Posted: Tue Sep 27, 2005 9:43 pm
by Rai López
...LM! LM! (HI :)) It's only for curiosity (really) ...but I'm "trying" to learn something about scripting works and I'd like to know if the Examples*** of Scripting Documetaton will arrive someday cause (of course) I think that this would be a very BIG/GREAT help... Really is not necessary that you reply this post if you don't want, it's only that I'd want to be sure that you remember that... :wink: (only that :) ), well... THANK YOU FOR ALL!

Posted: Wed Jun 14, 2006 12:50 pm
by Fazek
I just tried the new version (the new Paint Bucket looks nice). My question: are there any changes (new functions etc.) in the scripting interface? Can we get an updated scripting documentation?

As I see there is a new function skel:CountBoneChildren(), and a view:FloodSelect(). The CountBoneChildren is OK. since it was inside the ManipulateBones tool before, I mainly understand what FloodSelect(LM_Point, number) does, except the second parameter. Is there any low-level function to reach the Flood drawing (like the BeginShape, IsFullWhite etc. stuff)?

Posted: Mon Aug 21, 2006 2:30 am
by Rai López
Well, now that seems that a lot of help files and contents are been prepared for the *NeW* Anime Studio, I wonder if we'll can see added those necessary Examples*** in the scriptng documentation... :roll:

PS: P-L-E-A-S-E, it's SO important... and well, I think that almost TWO years is TOO MUCH wait...

Posted: Mon Jun 04, 2007 12:28 pm
by heyvern
Any chance for some update on the new additions to the scripting?

For instance what is:

Code: Select all

MOHO.Localize
It is used quite extensively in all the tools. Does this have to do with versions? Pro versus standard?

And what about:

Code: Select all

BASE_STR + 2
I have no idea what this is and it doesn't seem to relate to my original bone select tool script.

If I write new tools will they not work with the standard version?

Just curious. I wrote a new bone select tool that displays bones in a scrolling list instead of filling the screen with a huge display of all the darn bones and I would like to share it.

-vern

Posted: Mon Jun 04, 2007 7:03 pm
by Genete
heyvern wrote:Any chance for some update on the new additions to the scripting?

For instance what is:

Code: Select all

MOHO.Localize
It is used quite extensively in all the tools. Does this have to do with versions? Pro versus standard?

And what about:

Code: Select all

BASE_STR + 2
I have no idea what this is and it doesn't seem to relate to my original bone select tool script.

If I write new tools will they not work with the standard version?

Just curious. I wrote a new bone select tool that displays bones in a scrolling list instead of filling the screen with a huge display of all the darn bones and I would like to share it.

-vern
MOHO.Localize(position, default) is a function that returns a string located in AnimeStudioPro5.5.strings text file at the value given by "position" and if it not found then returns the "default" string. I think it is not documented but if you look to other lua files it makes sense.

I don't know if your Moho version have this feature but it should not interfere into the main code if you don't use it in your scripts.

BASE_STR is just a number to be used into the function in the "position" value
-G

Posted: Mon Jun 04, 2007 7:13 pm
by heyvern
Thanks! I put it in anyway.

The script works you can download it from script page:

viewtopic.php?t=7842


-vern