## Envelope.SetDeformerColor

### Description

This method changes the color assigned to a deformer. Each vertex on a deformed object will be painted with the color of the deformer that influences it the most. The method expects normalized RBG values, in the range 0 to 1.

### C# Syntax

    Envelope.SetDeformerColor( X3DObject, Color in_pColor );

### Scripting Syntax

    Envelope.SetDeformerColor( Deformer, Color );

### Parameters

Parameter | Type | Description
--- | --- | ---
Deformer | X3DObject | deformer object
Color | Color | Color object to assign

### Examples

#### VBScript Example

    'vbscript example demonstrating how to change the vertex colors

    'that are assigned to deformers on an envelope.

    newscene ,false

    'Create a cylinder deformed by a 3 bone skeleton

    set oCylinder = ActiveSceneRoot.AddGeometry( "Cylinder", "MeshSurface" )

    Rotate oCylinder, , , 90, siAbsolute, siParent, siObj, siZ

    Translate oCylinder, 2, , , siRelative, siView, siObj, siXYZ

    SetValue "cylinder.polymsh.geom.subdivv", 8

    'Create the skeleton

    set oChainRoot = ActiveSceneRoot.Add3DChain

    set oBone0 = oChainRoot.Bones.Item(0)

    set oEffPos = XSIMath.CreateVector3

    oEffPos.Set 2,0,0

    set oBone1 = oChainRoot.AddBone(oEffPos)

    oEffPos.Set 4,0,0

    set oBone2 = oChainRoot.AddBone(oEffPos)

    set oEnvelope = oCylinder.ApplyEnvelope( oChainRoot, siBranch )

    'Bend the cylinder

    Translate "eff", -1, 0, 0, siRelative, siGlobal, siObj, siXYZ

    set oColor = oEnvelope.GetDeformerColor( oBone0 )

    logmessage "Deformer " & oBone0 & " has color " & oColor.Red & "," _

    				& oColor.Green & "," & oColor.Blue

    'Change the deformer color scheme

    oColor.Red = 0

    oColor.Green = 0

    oColor.Blue = 1

    oEnvelope.SetDeformerColor oBone0, oColor

    oColor.Red = 1

    oColor.Green = 0

    oColor.Blue = 0

    oEnvelope.SetDeformerColor oBone1, oColor

    oColor.Red = 0

    oColor.Green = 1

    oColor.Blue = 0

    oEnvelope.SetDeformerColor oBone2, oColor

    SelectObj oCylinder

### See Also

Envelope.GetDeformerColor