"LW Object Info"Availability: LightWave 6.0 The object info global returns functions for getting object-specific information about any of the objects in a scene. Use the item info global to get the object list and for generic item information. For complete information about the geometry in the object files used in a scene, you can use the scene objects global. The information returned by the object info functions is read-only. Global Call LWObjectInfo *objinfo; objinfo = global( "LW Object Info", GFUSE_TRANSIENT ); The global function returns a pointer to an LWObjectInfo. typedef struct st_LWObjectInfo {
const char * (*filename) (LWItemID);
int (*numPoints) (LWItemID);
int (*numPolygons) (LWItemID);
unsigned int (*shadowOpts) (LWItemID);
double (*dissolve) (LWItemID, LWTime);
} LWObjectInfo;
Example This code fragment collects information about the first object. #include <lwserver.h>
#include <lwrender.h>
LWItemInfo *iteminfo;
LWCameraInfo *objinfo;
LWItemID id;
LWTime t = 3.0; /* seconds */
char *fname;
int npoints, npols;
unsigned int shopts;
double dissolve;
iteminfo = global( "LW Item Info 2", GFUSE_TRANSIENT );
objinfo = global( "LW Object Info", GFUSE_TRANSIENT );
if ( iteminfo && objinfo ) {
id = iteminfo->first( LWI_OBJECT, NULL );
fname = objinfo->filename( id );
npoints = objinfo->numPoints( id );
npols = objinfo->numPolygons( id );
shopts = objinfo->shadowOpts( id );
dissolve = objinfo->dissolve( id, t );
}
|