SymEnvWeight

Introduced

v2.0

Description

Smooths the weighting of envelope points.

Scripting Syntax

oReturn = SymEnvWeight( PropObj, [SubComp], [MappingTemplate], SymmetryAxis );

Return Value

Returns an XSICollection that contains the new envelope operators.

Parameters

Parameter Type Description
PropObj String Envelope weights property to be used.
SubComp String List of points/objects/clusters to be copied in symmetry.

Default Value: Current selection

MappingTemplate String Mapping template that determines the symmetric mapping between deformers
SymmetryAxis Integer The symmetry axis used to build the symmetry mapping template and symmetry map.

Examples

VBScript Example

'This example creates an envelope on "BodyMan" model, with less bones

'than usual (2 nulls for the body, 1 bone per arm).

'

'The default envelope assignment doesn't give a correct separation

'between the arms and the body, so we will use LocalAssignFlexEnv,

'SISmoothEnvWght and SymEnvWeight in order to modify the weight assignment.

NewScene

GetPresetModel "Man", "Man"

'Create basic skeletons: 2 for the arms, plus 2 nulls for the body

Create2DSkeleton -1.9, 17.0, 0, -5.15, 17.0, 0, 0, 0, 0, 4

Set Null0 = GetPrim("Null")

Translate Null0, 0, 15.049359948647, 0, siRelative, siView, siObj, siXYZ

Set Null1 = GetPrim("Null")

Translate Null1, 0, 3.76822515334527, 0, siRelative, siView, siObj, siXYZ

DuplicateSymmetry "B:root", True, False, 1, 0, 0, 0, True

ApplyFlexEnv "Man.Man;root1,bone1,eff1,root,bone,eff,null,null1", False

'We want the head and the center of the body to be only assigned

'to the 2 Nulls, so let's do it using LocalAssignFlexEnv

LocalAssignFlexEnv "Man.Man.pnt[0,2-23,25,26,28-30,34-99,101,103-109,"_

& "113,116-120,122,124-143,145-203,212-220,222-227,229-250,252-279,"_

& "281-284,286-295,297-299,302,304-307,310-315,317,319,321,322,324,"_

& "326-329,332-350,353-359,361,362,365,366,368-379,381,383,385,387,"_

& "389,391,393,395-414,625,629-694,696,698-704,708,711-715,717,719-738,"_

& "740-778,787-795,797-802,804-825,827-854,856-859,861-870,872-874,877,"_

& "879-882,885-890,892,894,896,897,899,901-904,907-925,928-934,936,937,"_

& "940,941,943-954,956,958,960,962,964,966,968,970-989]",_

"Man.Man;null,null1", 2

Rotate "bone", 0, 0, 58.5, siRelative, siAdd, siObj, siXYZ

Translate Null1, 0, 2, 4.0, siRelative, siView, siObj, siXYZ

'Because of the local reassignment, we can see that the shoulder's weight

'assignation is no longer smooth. Let's smooth it using SISmoothEnvWght.

'We increase the smoothing depth for better results.

Set SmoothOp = SISmoothEnvWght( , "Man.Man.pnt[0,2-23,25,26,28-30,34-99,"_

& "101,103-109,113,116-120,122,124-143,145-183,186-189,197-203,215,217-219,"_

& "221,228,229,251,259,271,280,285,287,289,290,292,294,296,298,300,301,303,"_

& "307-309,316,318,320,322,323,325,330,331,333,338,341,345,349,351,352,360,"_

& "363,364,366,367,369,371,402-406,409-432,434,436,439-446,625,629-694,696,"_

& "698-700,702,703,708,711-715,717,719-738,740-778,793,804,834,864,865,867,"_

& "873,897,908,913,924,941,944,977,980,981,985,986,989]")

SetValue SmoothOp & ".neighborhooddepth", 3

Rotate "bone1", 0, 0, 59.625, siRelative, siAdd, siObj, siXYZ

'The same problem occurs on the right shoulder. Since we have corrected the

'left shoulder, let's simply mirror the weights from left to right in order

'to propagate the changes symmetrically.

Set SymTemplate = CreateSymmetryMappingTemplate("Man.Man", True, 0, True)

SymEnvWeight , "Man.Man.pnt[0-32,34-101,103-113,115-219,221-224,226-230,"_

& "233-236,239-262,264-266,268-275,277-285,287-318,320-326,328-354,356-390,"_

& "392-400,402-621]", SymTemplate