Archived

This topic is now archived and is closed to further replies.

Scripting Languages and Animation

This topic is 4936 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, everybody! I have a question. Is it possible fora model to be animated with a scripting language. I''m trying to implement skeletal animation with fixed joints and bones in a custom format. Live in my world, Play in yours!!!

Share this post


Link to post
Share on other sites
If you''ve got access to vertex data and functions to load up a file then you could do it but scripting languages are designed for high level constructs not things like skeletal animation, it''d probably run rather slowly.

Share this post


Link to post
Share on other sites
Speed. I was worried about that. then what''s the fastest way. give the vertex the same name and them just make a format? I''m trying to make animation object oriented and independent of mesh data


Live in my world, Play in yours!!!

Share this post


Link to post
Share on other sites
The fastest way would be to write your animation code in whatever your main language is rather than the scripting language. If you want animation object orientated then just have your animation functions operate on vertex streams with some sort of mechanism to pass vertex data from a mesh object to one of your animation functions before rendering it. If you still want to use a scripting language the fastest way to do it depends on what scripting language you are using.

[edited by - Monder on June 6, 2004 11:50:15 AM]

Share this post


Link to post
Share on other sites
It should be straightforward to implement animation from a scripting system as long as you leverage the actual playback code from within a compiled language. What kind of animation are you talking about? Vertex animation, skeletal animation or simply transform-based animation?

If you are doing vertex animation of a model, normally you have a collection of vertex data that represents multiple frames of animation. You could name these collections of frames something meaningful - "walk" or "run" or what have you. From your scripting language, call a function that plays the named animation on a mesh object.

Likewise, if you are implmenting transform or skeletal animation, you''ll want to do all of you animating in native code, but call the correct animation or the mesh from your script.

Starting out with an object oriented approach certainly can help with script interface design. What about having a "AnimationController" object that can be assigned an animation and pointed at a mesh object. In your code, you can do all the checks to make sure the vertex count matches, or the hierarchies are the same, and if so start playing the animation. The script can interface with the animation controller and perform whatever tasks it needs - IsAnimationFinished(), GetAnimationTime(), StopAnimation(), SetAnimationSpeed(), or what have you. If you use an AnimationController as a base class, and extend it to support vertex, transform and skeletal animation, then the script system can be made to look like all animation is handled the same, regardless of type.

Without further information I''m afraid I can''t really help more!

Share this post


Link to post
Share on other sites