Bone InfoAvailability LightWave 6.0 The bone info global returns functions for getting bone-specific information about any of the bones in a scene. Use the item info global to get the bone list and for generic item information. The data returned by these functions is read-only, but you can use commands to set many of the parameters. Global Call LWBoneInfo *boneinfo; boneinfo = global( LWBONEINFO_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to an LWBoneInfo. typedef struct st_LWBoneInfo {
unsigned int (*flags) (LWItemID);
void (*restParam) (LWItemID, LWItemParam, LWDVector vec);
double (*restLength)(LWItemID);
void (*limits) (LWItemID, double *inner, double *outer);
const char * (*weightMap) (LWItemID);
double (*strength) (LWItemID);
int (*falloff) (LWItemID);
void (*jointComp) (LWItemID, double *self, double *parent);
void (*muscleFlex)(LWItemID, double *self, double *parent);
} LWBoneInfo;
History In LightWave 7.0, the server name for this global (LWBONEINFO_GLOBAL) was incremented from "LW Bone Info 2" to "LW Bone Info 3". The following functions and flags were added. strength falloff jointComp muscleFlex LWBONEF_JOINT_COMP LWBONEF_JOINT_COMP_PAR LWBONEF_MUSCLE_FLEX LWBONEF_MUSCLE_FLEX_PAR Example This code fragment collects information about the bones in the scene. #include <lwserver.h>
#include <lwrender.h>
LWItemInfo *iteminfo;
LWBoneInfo *boneinfo;
LWItemID object, bone;
unsigned int flags;
LWDVector pos;
double restlen;
iteminfo = global( LWITEMINFO_GLOBAL, GFUSE_TRANSIENT );
boneinfo = global( LWBONEINFO_GLOBAL, GFUSE_TRANSIENT );
if ( !iteminfo || !boneinfo ) return AFUNC_BADGLOBAL;
object = iteminfo->first( LWI_OBJECT, NULL );
while ( object ) {
bone = iteminfo->first( LWI_BONE, object );
while ( bone ) {
flags = boneinfo->flags( bone );
boneinfo->restParam( bone, LWIP_POSITION, pos );
restlen = boneinfo->restLength( bone );
...
bone = iteminfo->next( bone );
}
object = iteminfo->next( object );
}
|