File Request 2 LW Fog Info Globals Table of Contents

"File Type Pattern"

Availability:  LightWave 5.5 - 6.0, Inspire 1.0
Component:  Layout, Modeler

This global returns a function that allows plug-ins to retrieve file name pattern strings. These can be used to initialize the file name filter for a file request.

Global Call

   LWFileTypeFunc *filetypes;
   filetypes = global( "File Type Pattern", 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 strings in the list below.

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 is most likely to use some form of regular expression.

Layout
"Animations"
"Command"
"Envelopes"
"Previews"
"Scenes"
"Surfaces"
Modeler
"Macros"
"PSFonts"
Both
"Images"
"Motions"
"Objects"
"Plugins"
"Settings"

Example

This code fragment obtains the pattern string for image files.

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

   char *imgpat;
   LWFileTypeFunc *filetypes;

   filetypes = global( "File Type Pattern", GFUSE_TRANSIENT );
   if ( filetypes )
      imgpat = filetypes( "Images" );
   ...