Colors as vertex weights
Vertex weights can be used to tell the reduction which parts of the mesh that are important and which are not. Weights can also be used when baking materials, or rather to change the size of the UVs which will affect how much texture space gets used for given parts of the mesh. An example where weights can be applied is when you would want to preserve details on a character, such as nose and eyes.
Creates a ReductionPipeline
that will use the specified color-set as vertex weights.
// creates a reduction pipeline
$reductionPipeline = `SimplygonPipeline -c "ReductionPipeline"`;
...
// enables vertex weights in reducer
$bResult = `SimplygonPipeline -ss "ReductionProcessor/VertexWeightSettings/UseVertexWeightsInReducer" -v true $reductionPipeline`;
// enables vertex weights in material caster
$bResult = `SimplygonPipeline -ss "ReductionProcessor/VertexWeightSettings/UseVertexWeightsInTexcoordGenerator" -v true $reductionPipeline`;
// sets which vertex-color-set to be used as weights
$bResult = `SimplygonPipeline -ss "ReductionProcessor/VertexWeightSettings/WeightsFromColorName" -v "colorSet1" $reductionPipeline`;
# creates a reduction pipeline
reductionPipeline = cmds.SimplygonPipeline(c = 'ReductionPipeline')
...
# enables vertex weights in material caster
bResult = cmds.SimplygonPipeline(reductionPipeline, ss = 'ReductionProcessor/VertexWeightSettings/UseVertexWeightsInTexcoordGenerator', v = True)
# sets which vertex-color-set to be used as weights
bResult = cmds.SimplygonPipeline(reductionPipeline, ss = 'ReductionProcessor/VertexWeightSettings/WeightsFromColorName', v = 'colorSet1')
Sets the strength (multiplier) of the weights.
// sets the strength of the weights (2 is low, 8 is high, 4 is default)
$bResult = `SimplygonPipeline -ss "ReductionProcessor/VertexWeightSettings/WeightsFromColorMultiplier" -v 8 $reductionPipeline`;
# sets the strength of the weights (2 is low, 8 is high, 4 is default)
bResult = cmds.SimplygonPipeline(reductionPipeline, ss = 'ReductionProcessor/VertexWeightSettings/WeightsFromColorMultiplier', v = 8)
Sets the color component to use as weights.
// sets the color component to use as weights (R = 0, G = 1, B = 2, A = 3, default = 0)
$bResult = `SimplygonPipeline -ss "ReductionProcessor/VertexWeightSettings/WeightsFromColorComponent" -v 0 $reductionPipeline`;
# sets the color component to use as weights (R = 0, G = 1, B = 2, A = 3, default = 0)
bResult = cmds.SimplygonPipeline(reductionPipeline, ss = 'ReductionProcessor/VertexWeightSettings/WeightsFromColorComponent', v = 0)
The weights color mode (previously interpreter) can be used to change the interpretation of weights.
0
Black: reduce more | White: reduce less1
Black: unchanged | White: reduce less2
Black: reduce more | White: unchanged
Sets the weights color mode.
// sets the color mode for weights (default = 0)
$bResult = `SimplygonPipeline -ss "ReductionProcessor/VertexWeightSettings/WeightsFromColorMode" -v 0 $reductionPipeline`;
# sets the color mode for weights (default = 0)
bResult = cmds.SimplygonPipeline(reductionPipeline, ss = 'ReductionProcessor/VertexWeightSettings/WeightsFromColorMode', v = 0)