View Single Post
Old 11-22-11, 09:48 PM   #243
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

now since we can edit a bone's position, orientation, scale, etc. I should tell you all about the flags property of the bone. The flags property is a bitarray and has (that I know of) 3 bits:

bit 0: defines whether the bone has position data or not
bit 1: defines whether the bone has rotation data or not
bit 2: defines whether the bone has scale/shear data or not

if bit 0 is high (value of 0x1) then the bone will use the position data it has. If it is low then it defaults to 0,0,0 for position. Even if the bone has position data if this bit is low then it will ignore it.

if bit 1 is high (value of 0x2) then the bone will use the rotation data it has. If it is low then it defaults to Quaternion.Identity. Even if the bone has rotation data if this bit is low it will ignore it.

if bit 2 is high (value of 0x4) then the bone will use the scale/shear data is has. If it is low then it defaults to Matrix.Identity. Even if the bone has scale/shear data if this bit is low it will ignore it.

You can 'combine' bits to use more data. i.e: bits 0 and 1 enabled (value of 0x3) will cause the bone to use it's position data and rotation data but ignore it's scale/shear data (scale/shear will be set to Matrix.Identity).

Took me some time to figure this out about the Granny bones.
TheDarkWraith is offline   Reply With Quote