Scripting Documentation
Moderators: Víctor Paredes, Belgarath, slowtiger
- Lost Marble
- Site Admin
- Posts: 2355
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
Scripting Documentation
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
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
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:
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
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()
There may be a few other doodads I didn't see, but lordy this has already cleared up some of my stupidity issues.
--Brian
- Lost Marble
- Site Admin
- Posts: 2355
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
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:One:Never could quite figure out what that was for.Code: Select all
if (dlog:DoModal()
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.).7feet wrote:Also none of the audio functions seem to be in there, unless I missed 'em.
The moho object (the Script Interface class) allows you to access layers, create new ones, rearrange them, access vector and bone data, etc.
- Lost Marble
- Site Admin
- Posts: 2355
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
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.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!
"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
Macromedia, are you reading this? Good that's why I never upgraded Flash from version 4!
Reindert.
www.nobudgetvideo.com
...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...
(only that
), well... THANK YOU FOR ALL!



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)?
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)?
- - - Fazek
Any chance for some update on the new additions to the scripting?
For instance what is:
It is used quite extensively in all the tools. Does this have to do with versions? Pro versus standard?
And what about:
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
For instance what is:
Code: Select all
MOHO.Localize
And what about:
Code: Select all
BASE_STR + 2
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.heyvern wrote:Any chance for some update on the new additions to the scripting?
For instance what is:
It is used quite extensively in all the tools. Does this have to do with versions? Pro versus standard?Code: Select all
MOHO.Localize
And what about:
I have no idea what this is and it doesn't seem to relate to my original bone select tool script.Code: Select all
BASE_STR + 2
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
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
Thanks! I put it in anyway.
The script works you can download it from script page:
viewtopic.php?t=7842
-vern
The script works you can download it from script page:
viewtopic.php?t=7842
-vern