List of available functions?
Moderators: Víctor Paredes, Belgarath, slowtiger
List of available functions?
This is driving me crazy -- I've found the Lua reference sites and understand the language (nothing particularly new there), but without a list of the available functions in AS it's hard to do anything useful.
I really need to write a script to key all points in a layer. I study all the scripts and can make out *some* functions, but there are many basic ones that I just can't find any reference to. I need to select all the points in a layer -- where is THAT function? I can find functions that DO things with selected points, just not any examples where one automatically cycles through all the points in a layer. I need to set a key on all the points -- I can find example functions in other people's scripts on how to set keys for bones, but no where do I find a reference for setting a key on vector points.
I downloaded the Moho documentation that LM posted early on but it only has a bare handful of functions listed (it was done years ago, and maybe even pre LUA). Am I missing something *real* obvious here?
I really need to write a script to key all points in a layer. I study all the scripts and can make out *some* functions, but there are many basic ones that I just can't find any reference to. I need to select all the points in a layer -- where is THAT function? I can find functions that DO things with selected points, just not any examples where one automatically cycles through all the points in a layer. I need to set a key on all the points -- I can find example functions in other people's scripts on how to set keys for bones, but no where do I find a reference for setting a key on vector points.
I downloaded the Moho documentation that LM posted early on but it only has a bare handful of functions listed (it was done years ago, and maybe even pre LUA). Am I missing something *real* obvious here?
The initial documentation here should get you started, along with a decent Lua reference and reading through the sample scripts provided.
Some further functions are documented in the new release announcements, e.g. see the Scripting section of version 5.3 release notes.
I've got an antique modification to the API script here which goes trawling through the API looking for functions and values. However, it doesn't provide function parameters - sometimes you have to look in the existing tool and menu scripts to get an idea of these.
That version outputs to a .html file (provide the extension as well).
Looking through its output I can tell you you need to use the SelectAll function which is the member of an M_Mesh object.
Reading through the lm_autoweld.lua sample script, I see you can get that by calling Mesh(), which seems to be part of the ScriptInterface object/table.
without testing, something like:
local mesh = moho:Mesh()
mesh.SelectAll()
Regards, Myles.
Some further functions are documented in the new release announcements, e.g. see the Scripting section of version 5.3 release notes.
I've got an antique modification to the API script here which goes trawling through the API looking for functions and values. However, it doesn't provide function parameters - sometimes you have to look in the existing tool and menu scripts to get an idea of these.
That version outputs to a .html file (provide the extension as well).
Looking through its output I can tell you you need to use the SelectAll function which is the member of an M_Mesh object.
Reading through the lm_autoweld.lua sample script, I see you can get that by calling Mesh(), which seems to be part of the ScriptInterface object/table.
without testing, something like:
local mesh = moho:Mesh()
mesh.SelectAll()
Regards, Myles.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
-- Groucho Marx
Thanks Myles. That's very helpful. I guess I'll have to start digging through all that stuff.
I do appreciate the specific headsup for the mesh points -- I think I can stumble around and get the right syntax there. I don't suppose you have even a guess as to setting the keys for the points?
I know that user programmable interfaces tend to be the least documented of any program's features, but it's too bad more time wasn't spent on this because a whole lot of very useful stuff could be done with it.
I do appreciate the specific headsup for the mesh points -- I think I can stumble around and get the right syntax there. I don't suppose you have even a guess as to setting the keys for the points?
I know that user programmable interfaces tend to be the least documented of any program's features, but it's too bad more time wasn't spent on this because a whole lot of very useful stuff could be done with it.
If you use "SetValue" on the animation value of a point it creates a key frame.I don't suppose you have even a guess as to setting the keys for the points?
For example this is from Genete's code:
Code: Select all
for i=0, mesh:CountPoints()-1 do --- move the points.
local pi=mesh:Point(i)
local pimoved =LM.Vector2:new_local()
pimoved:Set(0,0)
for k=1, maxposes do
local pospik=pi.fAnimPos:GetValue(k)
pimoved = pimoved + pospik*w[k]/wtot
end
pi.fPos:Set(pimoved)
end
Code: Select all
pi.fAnimPos:SetValue(when, pimoved)
-vern
I use "fPos" more so than "fAnimPos" because I don't need all the keys for my scripts. Unfortunately there are some things that can't be changed unless you put in a key. Some things only have an AnimVal.
Also, some things don't even have an AnimVal. like point width. No AnimVal even though it can be animated. This means you can only set the value on the current frame. You can still key this by forcing a key frame for that channel... can't remember how to do it though off hand.
I keep pestering poor Mike to add ALL the properties to ALL of the elements just so it's consistent. I have my fingers crossed for the long awaited "update".
-vern
Also, some things don't even have an AnimVal. like point width. No AnimVal even though it can be animated. This means you can only set the value on the current frame. You can still key this by forcing a key frame for that channel... can't remember how to do it though off hand.
I keep pestering poor Mike to add ALL the properties to ALL of the elements just so it's consistent. I have my fingers crossed for the long awaited "update".

-vern
Oh please.. I couldn't use AS as a Java app. It might be easier to make improvements but running in java would be a nightmare. Every Java app I've ever used was a dog. I haven't seen one that runs "smoothly". Maybe I'm not using the right ones though.human wrote:Can I assume that AS is written in C++?
If it were ported to Java, wouldn't it be a hell of a lot easier to make improvements?
I don't see it happening though. Yes as far as I know AS is done in C++ or some variation of it and I don't think it will get ported anytime soon. Besides wouldn't that put it in the "open source" category?
-vern
Oh, man, you are so 1995.heyvern wrote:Every Java app I've ever used was a dog. I haven't seen one that runs "smoothly". Maybe I'm not using the right ones though.

It's 2008, get with the programming.
MovieStorm is written in Java, as far as I know.
It pushes 3D humans around a 3D set in real time.
AS is just vectors!
PS Besides, Java's Batik "Squiggle" browser can animate SVG morphing in 3D parallax space, as I recently demonstrated.
http://generalpicture.com/walt/?p=53
(You need to install the Java Batik package to see the crude demo.)
* My apologies to "English as a second language" readers. "You are so X" is an idiom. It means" "You are trapped in condition X."
Therefore, "You are so 1995" means "You are still thinking about the slow performance of Java as we knew it in 1995."