Instance Update Item Info Globals Table of Contents

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);
      void          (*setItemColorIndex)  (LWItemID, int);
      void          (*setItemColorCustom) (LWItemID, double *);
      int             alertLevel;
      int             autoKeyCreate;
      void          (*defaultItemTypeColor) (LWItemType itemtype, float *color, int set);
      void          (*itemColorRgba)     (LWItemID, unsigned int state, float rgba[4]);
      float         (*itemIconScale)     (LWItemID);
   } 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
LWOVIS_TEXTURED_WIRE
This is the textured wire mode with combines the textured and front face wire-frame draw modes.

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
LWGENF_AUTOKEY (LW7.5+)
LWGENF_IKENABLE (rev.4+)
This indicates that IK (Inverse Kinematics) is enabled.
LWGENF_LMBITEMSELECT
LWGENF_DOUBLECLICKBONEMODE
On when switching between bones and non-bones requires a double mouse click.
LWGENF_MCENABLE
Set when the use of motion controllers (other than IK) is enabled.

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.
 
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

setItemColorIndex( item, color_index ) (rev.4+)
This allows setting an item's user interface display color using a color index. This is not a surface color for final rendering. The color_index can be one of the 15 values defined above. You may also use a 24bit color (RGB) by setting the upper byte of a 32-bit value to 0x01. For example, yellow can be specified as 0x01FFFF00. It is preferred to use setItemColorCustom instead since custom colors will be supported in the future, whereas color indexes may not.

setItemColorCustom( item, color_val ) (rev.4+)
This allows setting an item's user interface display color using a floating point values from 0.0 to 1.0 for each of the red, green, and blue components. The color_var parameter is an array of doubles representing the red, green and blue components of the custom color. For example: yellow would be { 1.0, 1.0, 0.0}.

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

autoKeyCreate (LW7.5+)
The auto key create mode state, defined as one of these values:
LWAKC_OFF
LWAKC_MODIFIED
LWAKC_ALL

defaultItemTypeColor( itemtype, color, set )
This will get or set the default user interface display color for an item type. Set 'set' to 1 to set or '0' to get. The 'color' must be a float[3] array. Be aware that a float array is used here instead of double array.

itemColorRgba( item, state, rgba ) (LW9.5, LW9.6)
Gets the interface color of the item in the given state as floating point RGBA values. This takes into account if the item is selected or not, and if a custom color is used. The state is one if:
LWITEMCOL_CURRENT
The color of the item in its current state
LWITEMCOL_NORMAL
The color of the item in normal (non-selected) state
LWITEMCOL_SELECTED
The color of the item in selected state

scale = itemIconScale( item ) (LW9.5)
Returns the icon scale of the item. This is used to size the icon representation of the item in the viewports.

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:
            ...