CSMaterial Object

The CSMaterial Object represents a 3DCrafter Palette Material.

Color GetColor
  SetColor
Translucent GetTranslucent
  SetTranslucent
Diffuse GetDiffuse
  SetDiffuse
Ambient GetAmbient
  SetAmbient
Specular GetSpecular
  SetSpecular
Texture GetTextureFileName
  GetTextureWrappingFlags
  SetTextureFileName
  SetTextureWrappingFlags
  GetTextureAlphaChannelUse
  SetTextureAlphaChannelUse
  GetTextureAlphaIsTransparent
  SetTextureAlphaIsTransparent
Secondary Texture GetSecondaryTextureFileName
  SetSecondaryTextureFileName
  GetSecondaryTextureTranslucent
  SetSecondaryTextureTranslucent
TranslucentMap GetTranslucentMapFileName
  SetTranslucentMapFileName
BumpMap GetBumpMapFileName
  SetBumpMapFileName
SpecularMap GetSpecularMapFileName
  SetSpecularMapFileName
EnvironmentMap GetEnvironmentMapFileName
  SetEnvironmentMapFileName
General GetCustomFieldValue
  SetCustomFieldValue
  GetAlphaTest
  SetAlphaTest
  GetAlphaTestReference
  SetAlphaTestReference
  GetDoubleSided
  SetDoubleSided

 

GetColor

Gets the material color.

Syntax

shape.GetColor(Red As Variant,
Green As Variant,
Blue
As Variant)

Remarks

Each color component may be from 0 to 1 in intensity.

SetColor

Sets the material color.

Syntax

shape.SetColor(Red As Variant,
Green As Variant,
Blue
As Variant)

Remarks

Each color component may be from 0 to 1 in intensity.

GetTranslucent

Gets the translucent factor.

Sets the

Syntax

shape.GetTranslucent() As Variant

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

SetTranslucent

Sets the translucent factor.

Syntax

shape.SetTranslucent(Translucent As Variant)

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

GetDiffuse

Gets the diffuse factor.

Syntax

shape.GetDiffuse() As Variant

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

SetDiffuse

Sets the diffuse factor.

Syntax

shape.SetDiffuse(Diffuse As Variant)

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

GetAmbient

Gets the ambient factor.

Syntax

shape.GetAmbient() As Variant

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

SetAmbient

Sets the ambient factor.

Syntax

shape.SetAmbient(Ambient As Variant)

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

GetSpecular

Gets the Specular factor.

Syntax

shape.GetSpecular() As Variant

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

SetSpecular

Sets the Specular factor.

Syntax

shape.SetSpecular(Specular As Variant)

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

GetTextureFileName

Gets the texture file name.

Syntax

shape.GetTextureFileName() As Variant

SetTextureFileName

Sets the texture file name.

Syntax

shape.SetTextureFileName(FileName As Variant)

GetSecondaryTextureFileName

Gets the secondary texture file name.

Syntax

shape.GetSecondaryTextureFileName() As Variant

SetSecondaryTextureFileName

Sets the secondary texture file name.

Syntax

shape.SetSecondaryTextureFileName(FileName As Variant)

GetSecondaryTextureTranslucent

Gets the secondary texture translucent factor.

Syntax

shape.GetSecondaryTextureTranslucent() As Variant

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

SetSecondaryTextureTranslucent

Sets the secondary texture translucent factor.

Syntax

shape.SetSecondaryTextureTranslucent(Translucent As Variant)

Remarks

May be from 0 to 100 as in the 3DCrafter Material Palette.

GetTranslucentMapFileName

Gets the translucent map file name.

Syntax

shape.GetTranslucentMapFileName() As Variant

SetTranslucentMapFileName

Sets the translucent map file name.

Syntax

shape.SetTranslucentMapFileName(FileName As Variant)

GetBumpMapFileName

Gets the bumpmap file name.

Syntax

shape.GetBumpMapFileName() As Variant

SetBumpMapFileName

Sets the bumpmap file name.

Syntax

shape.SetBumpMapFileName(FileName As Variant)

GetSpecularMapFileName

Gets the specular map file name.

Syntax

shape.GetSpecularMapFileName() As Variant

SetSpecularMapFileName

Sets the specular file name.

Syntax

shape.SetSpecularMapFileName(FileName As Variant)

GetEnvironmentMapFileName

Gets the environment map file name.

Syntax

shape.GetEnvironmentMapFileName() As Variant

SetEnvironmentMapFileName

Sets the environment map file name.

Syntax

shape.SetEnvironmentMapFileName(FileName As Variant)

GetTextureWrappingFlags

Gets the texture wrapping flags of the material.

Syntax

shape.GetTextureWrappingFlags(U As Variant,
V
As Variant)

SetTextureWrappingFlags

Sets the texture wrapping flags of the material

Syntax

shape.SetTextureWrappingFlags(U As Variant,
V
As Variant)

Remarks

Flat wraps require 0, 0 as arguments.
Cylindrical wraps require 1, 0 as arguments.
Spherical wraps require 1, 1 as arguments.

GetCustomFieldValue

Gets the value of a custom field.

Syntax

shape.GetCustomFieldValue(FieldID as Variant) As Variant

Remarks

The FieldID can be determined using GetMaterialCustomFieldID of the CSScene shape.

SetCustomFieldValue

Sets the value of a custom field.

Syntax

shape.SetCustomFieldValue(FieldID as Variant, FieldValue As Variant)

Remarks

The FieldID can be determined using GetMaterialCustomFieldID of the CSScene shape.

GetTextureAlphaChannelUse

Get how the alpha channel of the primary texture is used.

Syntax

shape.GetTextureAlphaChannelUse() As Variant

Remarks

0 = Standard Usage (as an alpha channel)
1 = Ignore Alpha Channel
2 = Use Alpha Channel as Bump Map
3 = Use Alpha Channel as Specular Map
4 = Use Alpha Channel as Environment Map

SetTextureAlphaChannelUse

Used to indicate how the alpha channel of the primary texture is to be used.

Syntax

shape.SetTextureAlphaChannelUse(AlphaChannelUse as Variant)

Remarks

0 = Standard Usage (as an alpha channel)
1 = Ignore Alpha Channel
2 = Use Alpha Channel as Bump Map
3 = Use Alpha Channel as Specular Map
4 = Use Alpha Channel as Environment Map

GetTextureAlphaIsTransparent

Get whether any level of texture alpha channel translucency is to be treated as transparent.

Syntax

shape.GetTextureAlphaIsTransparent() As Variant

Remarks

0 = Use standard alpha channel translucency
1 = Alpha channel is to be treated as transparency

SetTextureAlphaIsTransparent

Used to indicate if any level of texture alpha channel translucency is to be treated as transparent.

Syntax

shape.SetTextureAlphaIsTransparent(AlphaIsTransparent As Variant)

Remarks

0 = Use standard alpha channel translucency
1 = Alpha channel is to be treated as transparency

GetAlphaTest

Get Direct3D's D3DRS_ALPHAFUNC render state for this material.

Syntax

shape.GetAlphaTest() As Variant

Remarks

See Direct3D's D3DRS_ALPHAFUNC render state, and CONST_D3DCMPFUNC for more details.

SetAlphaTest

Used to set Direct3D's D3DRS_ALPHAFUNC render state for this material.

Syntax

shape.SetAlphaTest(AlphaTest as Variant)

Remarks

See Direct3D's D3DRS_ALPHAFUNC render state, and CONST_D3DCMPFUNC for more details.

GetAlphaTestReference

Get Direct3D's D3DRS_ALPHAREF render state for this material.

Syntax

shape.GetAlphaTestReference() As Variant

Remarks

See Direct3D's D3DRS_ALPHAREF render state.

SetAlphaTestReference

Used to set Direct3D's D3DRS_ALPHAREF render state for this material.

Syntax

shape.SetAlphaTestReference(AlphaTestReference as Variant)

Remarks

See Direct3D's D3DRS_ALPHAREF render state.

GetDoubleSided

Get whether this material is rendered double-sided or not.

Syntax

shape.GetDoubleSided() As Variant

Remarks

False = Render Single-Sided
True = Render Double-Sided

SetDoubleSided

Set whether this material is to be rendered double-sided or not.

Syntax

shape.SetDoubleSided(DoubleSided as Variant)

Remarks

False = Render Single-Sided
True = Render Double-Sided