ReAnimator3D About Download Editor Docs Player Docs

ReAnimator3D consists of two separate modules. You can find a reference guide for both on this site...

THE PLAYER gives you simple and easy-to-use access to exported motions in your own projects. The Export feature is only available in the registered version. Note: You'll need to have a basic understanding of Lingo and the Shockwave3D object hierarchy to work with this player.

In addition to the reference guide below, please also have a look at techniques used in the supplied demo movie.

The player consists of 2 lingo parent scripts. The main class has a comprehensive API to make its implementation as easy and flexible as possible. Here's a list of its public methods:

new(3Dmember, 3DModel, motionData [,frameBased] )

Creates a new RA3D player instance.
Parameters: 3D member reference, 3D model reference and a property list or the name of a field member containing the exported motion data. The optional parameter "frameBased" allows the player to work in a frame based mode without the use of lingo timeout objects. This might be important to increase performance when working with a large number of animated models and you only want to update those, which are visible or your project needs to have explicit control over when animations are updated. Simply set it to "true" in order to use the player in this mode. Note: You'll need to update each instance of the player (and animations) yourself by calling its update() handler. With each step a frame based player will progress the animation by the number of frames specified in the playback rate. This setting defaults to 1 frame.
Returns: Player's object reference
Example:

gPlayer=script("pLBP").new( member("3d"), member("3d").model("walkbot"), "motiondata" )
gPlayer=script("pLBP").new( member("3d"), member("3d").model("walkbot"), "motiondata", true )

cleanUp()

Frees up all resources used by the player instance. Call only, if you don't need the instance anymore. All other player methods called after this will result in a Lingo error.
Parameters: none
Returns: nothing
Example:

gPlayer.cleanup()

getStatus()

Returns details of current player status. The state field can have these values: #PLAYING, #PAUSED, #FINISHED
Parameters: none
Returns: property list [#currentMotion, #state, #currentFrame, #loop, #loop_start, #loop_end, #version]
Example:

put gPlayer.getStatus()
-- [#currentMotion: #running, #state: #playing, #currentFrame: 23,
#loop: 1, #loop_start: 10, #loop_end: 40, #version: 1.00]

getMotionList()

Returns a list of all motion names.
Parameters: none
Returns: linear list
Example:

put gPlayer.getMotionList()
-- [#running, #stand, #crouching, #sit]

play(MotionName)

Plays a specified motion from frame 1
Parameters: motion name or none
Returns: #OK or errors: #NO_MOTION_SET, #WRONG_MOTION_ID, #WRONG_PARAMETER
Example:

gPlayer.play(#running)

play({frameNumber})

Continues playback of the currently active motion. If the optional frame number is specified, playback will continue at this frame. If the motion has looping turned on and the frame number parameter is greater than the loop end frame, playback will continue at the loop start frame.
Parameters: none or frame number
Returns: #OK or errors: #NO_MOTION_SET, #WRONG_MOTION_ID, #WRONG_PARAMETER
Example:

gPlayer.play()
gPlayer.play(23)

pause()

Pauses playback of the current motion
Parameters: none
Returns: nothing
Example:

gPlayer.pause()

queue(MotionName)

Queues playback of specified motion. The new motion starts as soon as current motion is finished/completed. Calling this function automatically turns off looping of currently played back motion (only for this instance. the original loop setting will be saved!)
Parameters: motion name
Returns: #OK or error:#WRONG_MOTION_ID
Example:

gPlayer.queue(#crouch)

Note: Motion blending is not yet implemented. This will be focus of the first update.

setLoop(propList)

Set new loop parameters for specified motion. These setting are made permanent.
Parameters: propertyList in this format [#motion, #loop, #loop_start, #loop_end], permanent true/false
Returns: #OK or errors: #WRONG_MOTION_ID, #WRONG_LOOP_POINTS, #WRONG_PARAMETER
Example:

gPlayer.setLoop([#motion: #running, #loop: true, #loop_start: 30, #loop_end: 40])

setRate(float)

Motions can be played back at different speeds. Use this command to set the currently active speed (1.0 = normal speed, 2.0 = double speed etc.) Using extrem values might cause strange behaviours in the playback. Furthermore only positive values >0 are allowed, motions cannot be played backwards.
Parameters: propertyList in this format [#motion, #loop, #loop_start, #loop_end]
Returns: #OK or error: #WRONG_PARAMETER
Example:

gPlayer.setLoop([#motion: #running, #loop: true, #loop_start: 30, #loop_end: 40])

lockBone(boneName)

Locks the specified bone and excludes it from any keyframe animation. This is very useful to create semi-interactive animations. A locked bone can still be transformed by using the function "setSingleBoneTransform()" (see below)
Parameters: bone name
Returns: #OK or error: #WRONG_BONE_ID
Example:

gPlayer.lockBone(#torso)

unlockBone(boneName)

Unlocks the specified bones and (re-)includes it to the control of the player object and any keyframe animations.
Parameters: bone name
Returns: #OK or error: #WRONG_BONE_ID
Example:

gPlayer.unlockBone(#torso)

setSingleBoneTransform(boneID,[translationVector,rotationVector])

Overwrites the transform for the specified bone. E.g. can be used to align bones to user parameters, like mouse position etc.
Parameters: bone name, property list with translation and rotation vectors
Returns: #OK or error: #WRONG_BONE_ID
Example:

gPlayer.setSingleBoneTransform(#torso,[#t: vector(), #r: vector(45,-17,33)] )

getSingleBoneTransform(boneID)

Returns the transform based on the current frame in keyframe animation for the specified bone. The result can be used to check the position or rotation of bones or use it together with setSingleBoneTransform() to achieve manual overwriting relative to the ongoing keyframe animation.
Parameters: bone name
Returns: bone's transform() object or error: #WRONG_BONE_ID
Example:

put gPlayer.getSingleBoneTransform(#torso)
-- transform(0.96592,0.25814,-0.01909,0.00000, 0.03863,-0.07084,0.99674,0.00000,
0.25595,-0.96351,-0.07840,0.00000, 0.00000,0.00000,0.00000,1.00000)

© 2002 karsten schmidt (a toxi.co.uk production)