Page 1 of 1

how can I get at the timeline for an action from LUA

Posted: Thu Feb 18, 2016 4:24 pm
by hayasidist
what I want to do is, from a script, find out what items (points, bones ...) are being manipulated in an action.

Put another way, if I look at, say, the position animation channels of all the points in a mesh, I can see which ones are being moved.
(e.g. using if mesh:Point(j).fAnimPos:CountKeys() > 1 ...)

and the same code gives me the point motion keys in the action if I have the action timeline on screen.

What I can't figure out is how to access the animation channels in the timeline in an action without having the action timeline active in the workspace -- IOW doc:SetCurrentDocAction("action name") doesn't seem to work as I'd hoped?

Any one got any advice please?

Re: how can I get at the timeline for an action from LUA

Posted: Thu Feb 18, 2016 4:48 pm
by Stan
I think actions are layer-specific, so what you need to do is probably use the moho.layer:ActivateAction("myAction") method, then do your point stuff, and then deactivate the action using moho.layer:ActivateAction(nil).

http://aslua.com/index.php?show=method& ... ion&id=562

Re: how can I get at the timeline for an action from LUA

Posted: Thu Feb 18, 2016 5:25 pm
by hayasidist
Thanks Stan. that's it!!

===
and ... since it may help us update ASLua.com --
> for the record: smartbone layers are returned in the child layers of a bone layer but with a zero duration (non-zero duration in the bone layer itself) along with any layer-specific actions.
> and .. any idea what MohoDoc:SetCurrentDocAction and MohoDoc:CurrentDocAction actually do??