Class StdMat

3DS Max Plug-In SDK

Class StdMat

See Also: Class Mtl, Class Color, Working with Materials.

class StdMat : public Mtl

Description:

This class provides access to the properties of the 3ds max Standard material. All methods of this class are implemented by the system.

Note that some properties such as the texture maps used are accessed using methods of the base class MtlBase. See that class, or the Advanced Topics section Working with Materials for more details.

Methods Groups:

The following hyperlinks take you to the beginning of groups of related method within the class.

Setting material properties

Retrieving material properties

Methods:

Prototype:

virtual void SetShading(int s)=0;

Remarks:

Sets the shading limit for the material.

Parameters:

int s

One of the following values:

SHADE_CONST

SHADE_PHONG

SHADE_METAL

SHADE_BLINN

Prototype:

virtual void SetSoften(BOOL onoff)=0;

Remarks:

Sets the 'Soften' setting on or off.

Parameters:

BOOL onoff

TRUE to turn on; FALSE to turn off.

Prototype:

virtual void SetFaceMap(BOOL onoff)=0;

Remarks:

Sets the 'Face Map' setting on or off.

Parameters:

BOOL onoff

TRUE to turn on; FALSE to turn off.

Prototype:

virtual void SetTwoSided(BOOL onoff)=0;

Remarks:

Sets the '2 Sided' setting on or off.

Parameters:

BOOL onoff

TRUE to turn on; FALSE to turn off.

Prototype:

virtual void SetWire(BOOL onoff)=0;

Remarks:

Sets the 'Wire' setting on or off.

Parameters:

BOOL onoff

TRUE to turn on; FALSE to turn off.

Prototype:

virtual void SetWireUnits(BOOL onOff)=0;

Remarks:

Sets the wire size to pixels or units.

Parameters:

BOOL onoff

TRUE for units; FALSE for pixels.

Prototype:

virtual void SetFalloffOut(BOOL onOff)=0;

Remarks:

Sets the opacity falloff setting to out or in.

Parameters:

BOOL onoff

TRUE for Out; FALSE for In.

Prototype:

virtual void SetTransparencyType(int type)=0;

Remarks:

Sets the additive transparency setting.

Parameters:

int type

One of the following values:

TRANSP_SUBTRACTIVE

TRANSP_ADDITIVE

TRANSP_FILTER

Prototype:

virtual void SetAmbient(Color c, TimeValue t)=0;

Remarks:

Sets the ambient color to the specified value at the time passed.

Parameters:

Color c

The color to set.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetDiffuse(Color c, TimeValue t)=0;

Remarks:

Sets the diffuse color to the specified value at the time passed.

Parameters:

Color c

The color to set.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetSpecular(Color c, TimeValue t)=0;

Remarks:

Sets the specular color to the specified value at the time passed.

Parameters:

Color c

The color to set.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetFilter(Color c, TimeValue t)=0;

Remarks:

Sets the filter color to the specified value at the time passed.

Parameters:

Color c

The color to set.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetShininess(float v, TimeValue t)=0;

Remarks:

Sets the shininess to the specified value at the time passed.

Parameters:

float v

The value to set in the range 0 - 1.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetShinStr(float v, TimeValue t)=0;

Remarks:

Sets the shininess strength to the specified value at the time passed.

Parameters:

float v

The value to set in the range 0 - 1.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetSelfIllum(float v, TimeValue t)=0;

Remarks:

Sets the self illumination to the specified value at the time passed.

Parameters:

float v

The value to set in the range 0 - 1.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetOpacity(float v, TimeValue t)=0;

Remarks:

Sets the opacity to the specified value at the time passed.

Parameters:

float v

The value to set in the range 0 - 1.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetOpacFalloff(float v, TimeValue t)=0;

Remarks:

Sets the opacity falloff to the specified value at the time passed.

Parameters:

float v

The value to set in the range 0 - 1.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetWireSize(float s, TimeValue t)=0;

Remarks:

Sets the wire size to the specified value at the time passed.

Parameters:

float s

The value to set. This value should be > 0.

TimeValue t

The time at which to set the value.

Prototype:

virtual void SetIOR(float v, TimeValue t)=0;

Remarks:

Sets the index of refraction to the specified value at the time passed.

Parameters:

float v

The value to set in the range 0 - 10.

TimeValue t

The time at which to set the value.

Prototype:

virtual void LockAmbDiffTex(BOOL onOff)=0;

Remarks:

Locks or unlocks the ambient/diffuse textures together.

Parameters:

BOOL onOff

TRUE to lock; FALSE to unlock.

Prototype:

virtual void EnableMap(int i, BOOL onoff)=0;

Remarks:

Enables or disables the specified map type.

Parameters:

int i

See List of Texture Map Indices.

BOOL onoff

TRUE to enable; FALSE to disable.

Prototype:

virtual BOOL MapEnabled(int i)=0;

Remarks:

Returns TRUE if the specified map is enabled; otherwise FALSE.

Parameters:

int i

See List of Texture Map Indices.

Prototype:

virtual void SetTexmapAmt(int imap, float amt, TimeValue t)=0;

Remarks:

This method is used to change the 'Amount' setting of the specified map.

Parameters:

int imap

See List of Texture Map Indices.

float amt

The amount to set in the range of 0-1.

TimeValue t

The time at which to set the amount.

Prototype:

virtual float GetTexmapAmt(int imap, TimeValue t)=0;

Remarks:

Returns the amount setting of the specified texture map at the time passed. The returned range is 0 to 1.

Parameters:

int imap

See List of Texture Map Indices.

TimeValue t

The amount at this time is returned.

Prototype:

virtual void SetSamplingOn(BOOL on)=0;

Remarks:

This method is available in release 3.0 and later only.

Set super sampling on or off (enabled or disabled).

Parameters:

BOOL on

TRUE for on; FALSE for off.

Prototype:

virtual int GetShading()=0;

Remarks:

Returns the shading limit. One of the following values:

SHADE_CONST

SHADE_PHONG

SHADE_METAL

SHADE_BLINN

Prototype:

virtual BOOL GetSoften()=0;

Remarks:

Returns TRUE if soften is on; otherwise FALSE.

Prototype:

virtual BOOL GetFaceMap()=0;

Remarks:

Returns TRUE if face mapping is on; otherwise FALSE.

Prototype:

virtual BOOL GetTwoSided()=0;

Remarks:

Returns TRUE if two sided is on; otherwise FALSE.

Prototype:

virtual BOOL GetWire()=0;

Remarks:

Returns TRUE if wire is on; otherwise FALSE.

Prototype:

virtual BOOL GetWireUnits()=0;

Remarks:

Returns TRUE if the wire size is in units; FALSE if the wire size is in pixels.

Prototype:

virtual BOOL GetFalloffOut()=0;

Remarks:

Returns the opacity falloff setting: 1 = Out, 0 = In.

Prototype:

virtual int GetTransparencyType()=0;

Remarks:

Returns the transparency type.

Return Value:

int type

One of the following values:

TRANSP_SUBTRACTIVE

TRANSP_ADDITIVE

TRANSP_FILTER

Prototype:

virtual Color GetAmbient(TimeValue t)=0;

Remarks:

Returns the ambient color setting at the specified time.

Parameters:

TimeValue t

The time to return the color.

Prototype:

virtual Color GetDiffuse(TimeValue t)=0;

Remarks:

Returns the diffuse color setting at the specified time.

Parameters:

TimeValue t

The time to return the color.

Prototype:

virtual Color GetSpecular(TimeValue t)=0;

Remarks:

Returns the specular color setting at the specified time.

Parameters:

TimeValue t

The time to return the color.

Prototype:

virtual Color GetFilter(TimeValue t)=0;

Remarks:

Returns the filter color setting at the specified time.

Parameters:

TimeValue t

The time to return the color.

Prototype:

virtual float GetShininess( TimeValue t)=0;

Remarks:

Returns the shininess setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual float GetShinStr(TimeValue t)=0;

Remarks:

Returns the shininess strength setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual float GetSelfIllum(TimeValue t)=0;

Remarks:

Returns the self illumination setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual float GetOpacity(TimeValue t)=0;

Remarks:

Returns the opacity setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual float GetOpacFalloff(TimeValue t)=0;

Remarks:

Returns the opacity falloff setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual float GetWireSize(TimeValue t)=0;

Remarks:

Returns the wire size setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual float GetIOR(TimeValue t)=0;

Remarks:

Returns the index of refraction setting at the specified time.

Parameters:

TimeValue t

The value at this time is returned.

Prototype:

virtual BOOL GetAmbDiffTexLock()=0;

Remarks:

Returns TRUE if the ambient-diffuse texture lock is set; otherwise FALSE.