File Request 2 Fog Info Globals Table of Contents

File Type Pattern

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

This global returns a function that allows plug-ins to retrieve file name pattern strings. These can be used to translate the string in the fileType passed to file request plug-ins into a literal filter string.

Global Call

   LWFileTypeFunc *filetypes;
   filetypes = global( LWFILETYPEFUNC_GLOBAL, GFUSE_TRANSIENT );
The global function returns a pointer to an LWFileTypeFunc.
   typedef const char * LWFileTypeFunc (const char *type);
The type argument identifies the kind of file you want a pattern string for. It can be any of the following. 
LWFTYPE_ANIMATION
LWFTYPE_IMAGE
LWFTYPE_ENVELOPE
LWFTYPE_MOTION
LWFTYPE_NODES
LWFTYPE_RIGS
LWFTYPE_OBJECT
LWFTYPE_PLUGIN
LWFTYPE_PREVIEW
LWFTYPE_PSFONT
LWFTYPE_SOUNDS
LWFTYPE_INSTALL
LWFTYPE_SCENE
LWFTYPE_SETTING
LWFTYPE_SURFACE
LWFTYPE_CONTENT
LWFTYPE_DYNAMICS
LWFTYPE_LIGHTS
The association between a type string and a literal filter is usually stored in the configuration file. Pattern strings are platform-specific. Under Windows, the string is a list of wildcard extensions separated by semicolons, e.g. *.iff;*.tga for images. On the Mac, the string is a list of 4-character file types, also separated by semicolons. The Unix string uses a regular expression.

Example

This code fragment obtains the pattern string for image files.

   #include <lwserver.h>
   #include <lwhost.h>

   char *imgpat;
   LWFileTypeFunc *filetypes;

   filetypes = global( LWFILETYPEFUNC_GLOBAL, GFUSE_TRANSIENT );
   if ( filetypes )
      imgpat = filetypes( LWFTYPE_IMAGE );
   ...