Surface Functions Texture Editor Globals Table of Contents

System ID

Availability  LightWave® 6.0
Component  Layout, Modeler
Header  lwhost.h

The system ID global returns the hardware key serial number. Each unique serial number represents a LightWave® license, so a plug-in installed on a particular machine can use this value to lock that installation to the LightWave® license. But note that your plug-in can be called in contexts in which the host doesn't require a hardware key, so exercise care when relying on the value returned by this function.

Global Call

   unsigned int sysid;
   sysid = ( unsigned int ) global( LWSYSTEMID_GLOBAL,
      GFUSE_TRANSIENT );

The global function ordinarily returns a void *, so this should be cast to an integer type to get the return value.

The serial number is in the low 28 bits of the return value. The high four bits indicate whether the plug-in is running in an interactive Layout or Modeler session, or in a non-interactive Screamernet session. The two components of the number can be extracted using macros defined in lwhost.h.

   context  = sysid & LWSYS_TYPEBITS;
   serialno = sysid & LWSYS_SERIALBITS;

The context can be LWSYS_LAYOUT, LWSYS_MODELER, or LWSYS_SCREAMERNET.

If the context is LWSYS_SCREAMERNET, the serial number will either be the node number, or 0 if no node number is available. The serial number can also be 0 for products other than LightWave® that don't require a hardware key, e.g. Inspire, regardless of the context. (The product info global allows you to identify the product your plug-in is running in.)