Object InfoAvailability LightWave 6.0 Component LayoutHeader lwrender.h 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. See also the Scene Objects global. The data returned by the object info functions is read-only, but you can use commands to set many of the parameters. Global Call LWObjectInfo *objinfo; objinfo = global( LWOBJECTINFO_GLOBAL, 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); LWMeshInfoID (*meshInfo) (LWItemID, int frozen); unsigned int (*flags) (LWItemID); double (*fog) (LWItemID, LWTime); LWTextureID (*dispMap) (LWItemID); LWTextureID (*clipMap) (LWItemID); void (*patchLevel) (LWItemID, int *display, int *render); void (*metaballRes) (LWItemID, double *display, double *render); LWItemID (*boneSource) (LWItemID); LWItemID (*morphTarget) (LWItemID); double (*morphAmount) (LWItemID, LWTime); unsigned int (*edgeOpts) (LWItemID); void (*edgeColor) (LWItemID, LWTime, LWDVector color); int (*subdivOrder) (LWItemID); double (*polygonSize) (LWItemID, LWTime); int (*excluded) (LWItemID object, LWItemID light); void (*matteColor) (LWItemID, LWTime, LWDVector color); double (*thickness) (LWItemID, LWTime, int type); double (*edgeZScale) (LWItemID, LWTime); } LWObjectInfo;
count = numPoints( object ) count = numPolygons( object ) sopts = shadowOpts( object ) LWOSHAD_SELF LWOSHAD_CAST LWOSHAD_RECEIVE meshinfo = meshInfo( object, frozen )
If frozen is true, the mesh for objects with subpatches and metaballs will contain the geometry that results from subdivision and isosurface calculation. The pntBasePos function will return the same point positions that Layout uses for object coordinate texture mapping. These are completely undeformed positions in the case of regular polygons and subpatches, and positions at freezing time for metaballs and partigons. pntOtherPos will return the actual world coordinates used by Layout. These should only be considered final if the mesh is obtained after all object transformations have been completed. LWOBJF_UNSEEN_BY_CAMERA LWOBJF_UNSEEN_BY_RAYS LWOBJF_UNAFFECT_BY_FOG LWOBJF_MORPH_MTSE LWOBJF_MORPH_SURFACES texture = dispMap( object ) texture = clipMap( object ) boneobj = boneSource( object ) morphobj = morphTarget( object ) amount = morphAmount( object, time ) options = edgeOpts( object )
LWEDGEF_UNSHARED LWEDGEF_CREASE LWEDGEF_SURFACE LWEDGEF_OTHER LWEDGEF_SHRINK_DIST index = subdivOrder( object )
0 - First
state = excluded( object, light )
History In LightWave 7.5, the following functions and flags were added. matteColor thickness edgeZScale LWOBJF_UNSEEN_BY_ALPHA LWOBJF_MATTE LWOBJF_MORPH_SURFACESExample The scenscan, spreadsheet and unwrap SDK samples use the Object Info global. The following code fragment collects information about the first object. #include <lwserver.h> #include <lwrender.h> LWItemInfo *iteminfo; LWObjectInfo *objinfo; LWItemID id; LWTime t = 3.0; /* seconds */ char *fname; int npoints, npols; unsigned int shopts; double dissolve; iteminfo = global( LWITEMINFO_GLOBAL, GFUSE_TRANSIENT ); objinfo = global( LWOBJECTINFO_GLOBAL, GFUSE_TRANSIENT ); if ( iteminfo && objinfo ) { id = iteminfo->first( LWI_OBJECT, NULL ); if ( id ) { fname = objinfo->filename( id ); npoints = objinfo->numPoints( id ); npols = objinfo->numPolygons( id ); shopts = objinfo->shadowOpts( id ); dissolve = objinfo->dissolve( id, t ); } } |