Interface Info

Availability LightWave 6.0 | Component Layout | Header lwrender.h

The interface info global returns information about the state of Layout's user interface. The data is read-only, but you can set the parameters using selection, navigation and display commands.

Global Call

   LWInterfaceInfo *intinfo;
   intinfo = global( LWINTERFACEINFO_GLOBAL, GFUSE_TRANSIENT );

The global function returns a pointer to an LWInterfaceInfo.

   typedef struct st_LWInterfaceInfo {
      LWTime          curTime;
      const LWItemID *selItems;
      unsigned int  (*itemFlags) (LWItemID);
      LWFrame         previewStart, previewEnd, previewStep;
      int             dynaUpdate;
      void          (*schemaPos) (LWItemID, double *x, double *y);
      int           (*itemVis)   (LWItemID);
      unsigned int    displayFlags;
      unsigned int    generalFlags;
      int             boxThreshold;
      int           (*itemColor) (LWItemID);
      int             alertLevel;
   } LWInterfaceInfo;
curTime
The current animation time selected in the Layout interface.
selItems
A NULL-terminated array of item IDs for the items currently selected in the interface.
flags = itemFlags( item )
Returns a set of bit flags for the item. These can be any combination of the following.
LWITEMF_SELECTED
LWITEMF_SHOWCHILDREN
LWITEMF_SHOWCHANNELS
LWITEMF_LOCKED
previewStart, previewEnd, previewStep
The range and step size used by the frame slider and by Layout previews. These differ from the range and step for rendering, which are returned by the scene info global.
dynaUpdate
Contains the current state of Layout's Dynamic Update setting, which controls how frequently the interface is updated while the user makes changes. Possible values are
LWDYNUP_OFF
LWDYNUP_DELAYED
LWDYNUP_INTERACTIVE
schemaPos( item, x, y )
The x and y arguments receive the position of the item in schematic viewports. This and the SchematicPosition command can be used by plug-ins to rearrange the schematic views.
visibility = itemVis( item )
Returns a code describing how an item is drawn in the interface. For objects, this can be one of the following.
LWOVIS_HIDDEN
LWOVIS_BOUNDINGBOX
LWOVIS_VERTICES
LWOVIS_WIREFRAME
LWOVIS_FFWIREFRAME
LWOVIS_SHADED
LWOVIS_TEXTURED

Other item types are limited to LWIVIS_HIDDEN and LWIVIS_VISIBLE.

displayFlags
Returns the state of certain display options as bit fields combined using bitwise-or. When set, a bit indicates that the corresponding option is turned on for the display.
LWDISPF_MOTIONPATHS
LWDISPF_HANDLES
LWDISPF_IKCHAINS
LWDISPF_CAGES
LWDISPF_SAFEAREAS
LWDISPF_FIELDCHART
generalFlags
Returns the state of certain interface options as bit fields combined using bitwise-or. When set, a bit indicates that the corresponding option is turned on for the interface.
LWGENF_HIDETOOLBAR
LWGENF_RIGHTTOOLBAR
LWGENF_PARENTINPLACE
LWGENF_FRACTIONALFRAME
LWGENF_KEYSINSLIDER
LWGENF_PLAYEXACTRATE
boxThreshold
The bounding box threshold. Objects with a number of points greater than this threshold are drawn initially as bounding boxes to speed up interaction.
color_index = itemColor( item )
Returns an index into the list of colors used to draw an item's wireframe.

alertLevel
The alert level for information dialogs. This affects how the information is displayed. Possible values are
LWALERT_BEGINNER
LWALERT_INTERMEDIATE
LWALERT_EXPERT

History

In LightWave 7.0, the server name for this global (LWINTERFACEINFO_GLOBAL) was incremented from "LW Interface Info 2" to "LW Interface Info 3", and the itemColor function and the boxThreshold and alertLevel fields were added.

Example

This code fragment collects information about the currently selected items.

   #include <lwserver.h>
   #include <lwrender.h>

   LWInterfaceInfo *intinfo;
   LWItemInfo *iteminfo;
   LWTime t;
   LWItemID *id;
   int i, f, type;

   intinfo = global( LWINTERFACEINFO_GLOBAL, GFUSE_TRANSIENT );
   iteminfo = global( LWITEMINFO_GLOBAL, GFUSE_TRANSIENT );
   if ( !intinfo || !iteminfo ) return AFUNC_BADGLOBAL;

   t = intinfo->curTime;
   id = intinfo->selItems;
   for ( i = 0; id[ i ]; i++ ) {
      f = intinfo->itemFlags( id[ i ] );
      type = iteminfo->type( id[ i ] );
      switch ( type ) {
         case LWI_OBJECT:
            ...