MaterialTransparency

Returns or modifies a material's transparency value.

Syntax

rhinoscriptsyntax.MaterialTransparency (material_index, transparency=None)

rhinoscript.material.MaterialTransparency (material_index, transparency=None)

Parameters

material_index

Required.  Number.  The zero-based source material index.

transparency

Optional.  Number.  The new transparency value.  A material's transparency value ranges from 0.0 to 1.0, with 0.0 being opaque and 1.0 being transparent.  If omitted, the current transparency value is returned.

Returns

Number

If transparency is not specified, the current transparency value if successful.

Number

If transparency is specified, the previous transparency value if successful.

None

It not successful, or on error.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select object")

if obj:

    index = rs.ObjectMaterialIndex(obj)

    if index>-1:

        rs.MaterialTransparency( index, 0.50 )

Also See

MaterialBump

MaterialColor

MaterialName

MaterialReflectiveColor

MaterialShine

MaterialTexture