Main
|
Resume
|
Showreel
|
Blog
|
Script
|
Contact
connexion
go to footer
expand all
|
collapse all
languages
class
All
JScript|XSI
Python|XSI
JScript|WEB
Python|Maya
All
Memo
learning
DDD
php
tool
keyboard tooltips
rig
NormalizeWeights
- All - felixlecha
NormalizeWeights(); function NormalizeWeights() { SetValue("preferences.scripting.cmdlog", false, null); var aSel = new Array(); aSel = getValue("SelectionList"); if( aSel.Count >= 1) { for( var i = 0; i < aSel.Count; i++ ) { var oRoot = Application.ActiveProject.ActiveScene.Root; var oNull = oRoot.AddNull( "null_TMP" ); // Add Null as new deformer ApplyFlexEnv( aSel(i).FullName + ";" + oNull.FullName, null, 0 ); // Set Weights to 0 SIModifyFlexEnvWght( aSel(i).FullName + ".cls.EnvelopWeightCls.Envelope_Weights", oNull.FullName, aSel(i).FullName + ".pnt[*]", 0, 0, true); // Remove Tmp Deformer RemoveFlexEnvDeformer( aSel(i).FullName + ";" + oNull.FullName, null); // Delete Tmp Null DeleteObj( oNull ); // Freeze Envelope Weight History FreezeObj( aSel(i).FullName + ".cls.EnvelopWeightCls.Envelope_Weights", null, null); LogMessage( aSel(i).FullName + " > Normalized" ); } } else { LogMessage( "Select a polymesh with an envelope" ); } }