Data Types

3DS Max Plug-In SDK

Data Types

This section lists the data types most commonly used in the SDK. Some of these data types are defined by 3ds max while others are part of the Win32 API.

BOOL

A boolean value, either TRUE or FALSE.

BYTE

An 8-bit unsigned value.

CIRCLE

The CIRCLE structure defines the x and y coordinates of the circle center and radius value. A CIRCLE data structure has the following form (defined in GFX.H):

typedef struct tagCIRCLE

{

LONG x;

LONG y;

LONG r;

} CIRCLE;

COLORREF

A 32-bit value used as a color value. See COLORREF.

DWORD

A 32-bit unsigned integer or the address of a segment and its associated offset.

HFONT

The handle of a font.

HCURSOR

The handle of a cursor.

HDC

The handle of a device context (DC).

HIMAGELIST

The handle to an image list.

HINSTANCE

The handle of an instance.

HMENU

The handle of a menu.

HPALETTE

The handle of a palette.

LONG

A 32-bit signed integer.

LPARAM

A 32-bit value passed as a parameter to a window procedure or a callback function.

LPSTR

A 32-bit pointer to a character string.

LRESULT

A 32-bit value returned from a window procedure or callback function.

POINT

The POINT structure defines the x and y coordinates of a point. A POINT data structure has the following form:

typedef struct tagPOINT {

int x;

int y;

} POINT;

RECT

The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle. A RECT data structure has the following form:

typedef struct tagRECT {

int left;

int top;

int right;

int bottom;

} RECT;

USHORT

A 16-bit unsigned short integer.

SIZE

This structure specifies the width and height of a rectangle. The rectangle dimensions stored in this structure can correspond to viewport extents, window extents, text extents, bitmap dimensions, or the aspect-ratio filter for some extended functions.

typedef struct tagSIZE {

int cx;

int cy;

} SIZE;

ULONG

A 32-bit unsigned long integer.

WNDPROC

A 32-bit pointer to a window procedure.

WORD

A 16-bit unsigned integer.

WPARAM

A 32-bit value passed as a parameter to a window procedure or callback function.

Other various typedefs and structures used in the SDK:

typedef unsigned long ulong;

typedef unsigned char uchar;

typedef uchar UBYTE;

typedef unsigned short USHORT;

typedef unsigned short UWORD;

typedef int TimeValue;

typedef unsigned short BMMRES;

typedef ulong SClass_ID;

 

typedef unsigned int RefMessage;

typedef unsigned short MtlID;

typedef unsigned long ChannelMask;

struct Color24 {

 uchar r,g,b;

 };

struct Color48 {

 UWORD r,g,b;

 };

struct Color64 {

 UWORD r,g,b,a;

 };

typedef Point3 UVVert;

typedef Point3 VertColor;

typedef AColor RGBA;

 

typedef enum {IO_OK=0, IO_END=1, IO_ERROR=2} IOResult;

typedef enum {NEW_CHUNK=0, CONTAINER_CHUNK=1, DATA_CHUNK=2} ChunkType;

enum RefResult {

 REF_FAIL,

 REF_SUCCEED,

 REF_DONTCARE,

 REF_STOP,

 REF_INVALID

 };

enum LightType { OMNI_LGT, SPOT_LGT, DIRECT_LGT, AMBIENT_LGT };

typedef enum {IOTYPE_MAX=0, IOTYPE_MATLIB=1} FileIOType;

 

typedef unsigned long NURBSId;

typedef Tab<NURBSId> NURBSIdTab;

typedef Tab<BOOL> BoolTab;

 

typedef Tab<WVert *> WVertTab;

typedef Tab<WEdge *> WEdgeTab;

typedef Tab<WFace *> WFaceTab;

 

typedef DWORD HJOB;

typedef INT_PTR_MSVC70 StringResID;

typedef INT_PTR_MSVC70 ResID;

typedef Animatable* AnimatablePtr;

typedef DWORD ActionTableId;

typedef DWORD ActionContextId;

typedef DWORD HJOB;

typedef INT_PTR_MSVC70 StringResID;

typedef INT_PTR_MSVC70 ResID;

typedef Animatable* AnimatablePtr;

typedef DWORD ActionTableId;

typedef DWORD ActionContextId;