3ds Max C++ API Reference
Loading...
Searching...
No Matches
stdmat.h File Reference
#include "buildver.h"
#include "imtl.h"
#include "TextureMapIndexConstants.h"

Classes

class  StdMat
 
class  StdMat2
 
class  StdUVGen
 
class  StdXYZGen
 
class  StdTexoutGen
 
class  BitmapTex
 
class  MultiMtl
 
class  Tex3D
 
class  MultiTex
 
class  GradTex
 
class  StdCubic
 
class  StdMirror
 
class  StdFog
 

Namespaces

namespace  MaxSDK
 
namespace  MaxSDK::AssetManagement
 

Macros

#define NSHADES   4
 
#define SHADE_CONST   0
 
#define SHADE_PHONG   1
 
#define SHADE_METAL   2
 
#define SHADE_BLINN   3
 
#define TRANSP_SUBTRACTIVE   0
 
#define TRANSP_ADDITIVE   1
 
#define TRANSP_FILTER   2
 
#define ID_RAY_REFLECTION   12
 
#define ID_RAY_REFRACTION   13
 
#define ID_RAY_REFRACTION_IOR   14
 
#define ID_TRANSLUCENT_CLR   15
 
#define UVMAP_EXPLICIT   0
 
#define UVMAP_SPHERE_ENV   1
 
#define UVMAP_CYL_ENV   2
 
#define UVMAP_SHRINK_ENV   3
 
#define UVMAP_SCREEN_ENV   4
 
#define XYZ_COORDS   0
 
#define UVW_COORDS   1
 
#define UVW2_COORDS   2
 
#define XYZ_WORLD_COORDS   3
 
#define TEXOUT_XXXXX   1
 
#define TEXOUT_INVERT   2
 
#define TEXOUT_CLAMP   4
 
#define TEXOUT_ALPHA_RGB   8
 
#define TEXOUT_COLOR_MAP   16
 
#define TEXOUT_COLOR_MAP_RGB   32
 
#define FILTER_PYR   0
 
#define FILTER_SAT   1
 
#define FILTER_NADA   2
 
#define ALPHA_FILE   0
 
#define ALPHA_RGB   2
 
#define ALPHA_NONE   3
 
#define END_LOOP   0
 
#define END_PINGPONG   1
 
#define END_HOLD   2
 
#define BITMAPTEX_INTERFACE   Interface_ID(0x55b4400e, 0x29ff7cc9)
 
#define GetIBitmapTextInterface(cd)    (BitmapTex *)(cd)->GetInterface(BITMAPTEX_INTERFACE)
 
#define FALLOFF_TOP   0
 
#define FALLOFF_BOTTOM   1
 
#define FALLOFF_NONE   2
 

Enumerations

enum  { bitmaptex_reload , bitmaptex_crop }
 

Functions

CoreExport void RegisterSXPReader (const MCHAR *sxpName, Class_ID cid)
 
CoreExport Tex3DGetSXPReaderClass (const MCHAR *sxpName)
 
CoreExport StdMat2NewDefaultStdMat ()
 
CoreExport BitmapTexNewDefaultBitmapTex ()
 
CoreExport MultiMtlNewDefaultMultiMtl ()
 
CoreExport MultiMtlNewEmptyMultiMtl ()
 
CoreExport MultiTexNewDefaultCompositeTex ()
 
CoreExport MultiTexNewDefaultMultiTileTex ()
 
CoreExport MultiTexNewDefaultMixTex ()
 
CoreExport MultiTexNewDefaultTintTex ()
 
CoreExport GradTexNewDefaultGradTex ()
 
CoreExport StdCubicNewDefaultStdCubic ()
 
CoreExport StdMirrorNewDefaultStdMirror ()
 
CoreExport StdFogNewDefaultStdFog ()
 
CoreExport MtlNewPhysicalMaterial (const MCHAR *configkey=nullptr, bool *legacy=nullptr)
 Create a Physical Material (or, optionally, a legacy StdMtl2)
 
CoreExport MtlNewDefaultMaterial (const MCHAR *configkey=nullptr)
 Create a material of the type defined in the "market defaults" (or optionally, a StdMtl2 as a fallback)
 
CoreExport int GetPrimaryMapSlot (Mtl *mtl)
 Return the primary texture slot for a material.
 

Macro Definition Documentation

◆ NSHADES

#define NSHADES   4

◆ SHADE_CONST

#define SHADE_CONST   0

◆ SHADE_PHONG

#define SHADE_PHONG   1

◆ SHADE_METAL

#define SHADE_METAL   2

◆ SHADE_BLINN

#define SHADE_BLINN   3

◆ TRANSP_SUBTRACTIVE

#define TRANSP_SUBTRACTIVE   0

◆ TRANSP_ADDITIVE

#define TRANSP_ADDITIVE   1

◆ TRANSP_FILTER

#define TRANSP_FILTER   2

◆ ID_RAY_REFLECTION

#define ID_RAY_REFLECTION   12

◆ ID_RAY_REFRACTION

#define ID_RAY_REFRACTION   13

◆ ID_RAY_REFRACTION_IOR

#define ID_RAY_REFRACTION_IOR   14

◆ ID_TRANSLUCENT_CLR

#define ID_TRANSLUCENT_CLR   15

◆ UVMAP_EXPLICIT

#define UVMAP_EXPLICIT   0

◆ UVMAP_SPHERE_ENV

#define UVMAP_SPHERE_ENV   1

◆ UVMAP_CYL_ENV

#define UVMAP_CYL_ENV   2

◆ UVMAP_SHRINK_ENV

#define UVMAP_SHRINK_ENV   3

◆ UVMAP_SCREEN_ENV

#define UVMAP_SCREEN_ENV   4

◆ XYZ_COORDS

#define XYZ_COORDS   0

◆ UVW_COORDS

#define UVW_COORDS   1

◆ UVW2_COORDS

#define UVW2_COORDS   2

◆ XYZ_WORLD_COORDS

#define XYZ_WORLD_COORDS   3

◆ TEXOUT_XXXXX

#define TEXOUT_XXXXX   1

◆ TEXOUT_INVERT

#define TEXOUT_INVERT   2

◆ TEXOUT_CLAMP

#define TEXOUT_CLAMP   4

◆ TEXOUT_ALPHA_RGB

#define TEXOUT_ALPHA_RGB   8

◆ TEXOUT_COLOR_MAP

#define TEXOUT_COLOR_MAP   16

◆ TEXOUT_COLOR_MAP_RGB

#define TEXOUT_COLOR_MAP_RGB   32

◆ FILTER_PYR

#define FILTER_PYR   0

◆ FILTER_SAT

#define FILTER_SAT   1

◆ FILTER_NADA

#define FILTER_NADA   2

◆ ALPHA_FILE

#define ALPHA_FILE   0

◆ ALPHA_RGB

#define ALPHA_RGB   2

◆ ALPHA_NONE

#define ALPHA_NONE   3

◆ END_LOOP

#define END_LOOP   0

◆ END_PINGPONG

#define END_PINGPONG   1

◆ END_HOLD

#define END_HOLD   2

◆ BITMAPTEX_INTERFACE

#define BITMAPTEX_INTERFACE   Interface_ID(0x55b4400e, 0x29ff7cc9)

◆ GetIBitmapTextInterface

#define GetIBitmapTextInterface (   cd)     (BitmapTex *)(cd)->GetInterface(BITMAPTEX_INTERFACE)

◆ FALLOFF_TOP

#define FALLOFF_TOP   0

◆ FALLOFF_BOTTOM

#define FALLOFF_BOTTOM   1

◆ FALLOFF_NONE

#define FALLOFF_NONE   2

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
bitmaptex_reload 
bitmaptex_crop 
@ bitmaptex_reload
Definition: stdmat.h:1044
@ bitmaptex_crop
Definition: stdmat.h:1044

Function Documentation

◆ RegisterSXPReader()

CoreExport void RegisterSXPReader ( const MCHAR sxpName,
Class_ID  cid 
)

◆ GetSXPReaderClass()

CoreExport Tex3D * GetSXPReaderClass ( const MCHAR sxpName)

◆ NewDefaultStdMat()

CoreExport StdMat2 * NewDefaultStdMat ( )

◆ NewDefaultBitmapTex()

CoreExport BitmapTex * NewDefaultBitmapTex ( )

◆ NewDefaultMultiMtl()

CoreExport MultiMtl * NewDefaultMultiMtl ( )

◆ NewEmptyMultiMtl()

CoreExport MultiMtl * NewEmptyMultiMtl ( )

◆ NewDefaultCompositeTex()

CoreExport MultiTex * NewDefaultCompositeTex ( )

◆ NewDefaultMultiTileTex()

CoreExport MultiTex * NewDefaultMultiTileTex ( )

◆ NewDefaultMixTex()

CoreExport MultiTex * NewDefaultMixTex ( )

◆ NewDefaultTintTex()

CoreExport MultiTex * NewDefaultTintTex ( )

◆ NewDefaultGradTex()

CoreExport GradTex * NewDefaultGradTex ( )

◆ NewDefaultStdCubic()

CoreExport StdCubic * NewDefaultStdCubic ( )

◆ NewDefaultStdMirror()

CoreExport StdMirror * NewDefaultStdMirror ( )

◆ NewDefaultStdFog()

CoreExport StdFog * NewDefaultStdFog ( )

◆ NewPhysicalMaterial()

CoreExport Mtl * NewPhysicalMaterial ( const MCHAR configkey = nullptr,
bool *  legacy = nullptr 
)

Create a Physical Material (or, optionally, a legacy StdMtl2)

Create new instances of the Physical Material, optionally depending on a 3dsmax.ini configuration key. If no config key is passed, the creation is unconditional. If a key name is passed, that key is searched in 3dsmax.ini's [LegacyMaterial] section, and if existing and set to 1, a legacy standard material is returned instead. This allows restoring legacy behaviour inside 3ds Max if that is necessary for some particular users reason.

The optional legacy parameter can point to a bool that will be set to true if the legacy fallback is used, meaning a StdMtl2 is returned.

Note
This returns EITHER a Physical Material OR a Legacy Standard material. No other types of materials are ever returned.

◆ NewDefaultMaterial()

CoreExport Mtl * NewDefaultMaterial ( const MCHAR configkey = nullptr)

Create a material of the type defined in the "market defaults" (or optionally, a StdMtl2 as a fallback)

Create new instances the configured "market default" mtl, optionally depending on a 3dsmax.ini configuration key. If no config key is passed, the creation is unconditional. If a key name is passed, that key is searched in 3dsmax.ini's [LegacyMaterial] section, and if existing and set to 1, a legacy standard material is returned instead. This allows restoring legacy behaviour inside 3ds Max if that is necessary for some particular users reason.

Note
This can return ANY material, whatever is configured in the market defaults.

◆ GetPrimaryMapSlot()

CoreExport int GetPrimaryMapSlot ( Mtl mtl)

Return the primary texture slot for a material.

Function returns the primary texture slot ID for a material, generally the diffuse slot or similar. If the material derives from StdMtl2, this is equivalent to calling mtl->StdIDtoChannel(ID_DI).