07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

Bones<br />

When you import a W3D file containing bones animation, each bone may appear as a separate model. To discover<br />

which models are the bones of a particular modelResource, you can use modelResource.getBoneID(), using the name<br />

of each model in turn. If the result is a non-zero integer, the named model is a bone in the modelResource.<br />

You can work out the parent-child hierarchy of bones by checking the parent of each of the bone models.<br />

To see an example of this, download and launch the movie MotionTest.dir. Watch the output in the Message window<br />

as the movie launches.<br />

The MotionTest.dir movie contains a very basic bones animation<br />

Bone properties<br />

model.bonesPlayer.bone[boneId].transform indicates the transform of the bone relative to the parent bone.<br />

You can find the boneId value from the name of the bone by using the modelResource.getBoneID() method of the<br />

model resource.<br />

You can read the properties of a bone's transform, but you cannot set any of its properties directly. You can however<br />

replace the bone's transform with a standard transform which you can then control.<br />

When you set the transform of a bone, it is no longer controlled by the current motion, and cannot be returned to<br />

the control of the motion. To end manual control, you can use model.bonesPlayer.playNext() to remove the bone<br />

from the playList. Manual control will end automatically when the current motion ends. You can experiment with<br />

this in the MotionTest.dir movie<br />

model.bonesPlayer.bone[boneId].worldTransform returns the world-relative transform of the bone. This<br />

property gives you a means to attach a model to a bone. For example, on every exitFrame, you can set the<br />

transform of a Hat model to the worldTransform of a character's Head bone.<br />

See the MotionTest.dir movie for an example.<br />

Motion mapping<br />

You can create new motions by combining existing motions. For example, a walking motion can be combined with a<br />

shooting motion to produce a walk-and-shoot motion. This is available only with Bones player animations.<br />

See motion.map() for more details.<br />

Last updated 8/26/2011<br />

277

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!