// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // AEskinClusterTemplate // // Description: // Creates attribute editor controls the skinCluster node // // Input Value: // nodeName // // Output Value: // None // global proc checkObeyMaxInfl(string $nodeName) { int $value = `getAttr ($nodeName + ".maintainMaxInfluences")`; editorTemplate -dimControl $nodeName "maxInfluences" (!$value); } global proc checkNormalizeWeights(string $nodeName) { int $value = `getAttr ($nodeName + ".normalizeWeights")`; editorTemplate -dimControl $nodeName "weightDistribution" (!($value == 1)); } global proc scReassignWeights(string $nodeName) { string $maxInfl = `getAttr ($nodeName+".maxInfluences")`; string $cmd = ("skinCluster -e -mi "+$maxInfl+" "+$nodeName); evalEcho $cmd; } global proc updateDQSProperties(string $nodeName) { int $method = `getAttr ($nodeName + ".skinningMethod")`; editorTemplate -dimControl $nodeName "dqsSupportNonRigid" ($method == 0); int $supported = `getAttr ($nodeName + ".dqsSupportNonRigid")`; editorTemplate -dimControl $nodeName "dqsScale" (($method == 0) || !$supported); } global proc AEskinClusterTemplate ( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEskinClusterTemplate.kSmoothSkinAttributes")) -collapse false; editorTemplate -beginNoOptimize; editorTemplate -addControl "skinningMethod" "updateDQSProperties"; editorTemplate -addControl "useComponents"; editorTemplate -addControl "deformUserNormals"; editorTemplate -label (uiRes("m_AEskinClusterTemplate.kDQSNonRigidSupport")) -addControl "dqsSupportNonRigid" "updateDQSProperties"; editorTemplate -label (uiRes("m_AEskinClusterTemplate.kDQSScale")) -addControl "dqsScale"; editorTemplate -endNoOptimize; editorTemplate -addSeparator; editorTemplate -addControl "normalizeWeights" "checkNormalizeWeights"; editorTemplate -addControl "weightDistribution"; editorTemplate -addControl "maxInfluences"; editorTemplate -addControl "maintainMaxInfluences" "checkObeyMaxInfl"; editorTemplate -suppress "lockWeights"; editorTemplate -suppress "weightList"; editorTemplate -suppress "bindPreMatrix"; editorTemplate -suppress "geomMatrix"; editorTemplate -suppress "matrix"; editorTemplate -suppress "dropoffRate"; editorTemplate -suppress "dropoff"; editorTemplate -suppress "bindMethod"; editorTemplate -suppress "driverPoints"; editorTemplate -suppress "basePoints"; editorTemplate -suppress "baseDirty"; editorTemplate -suppress "paintWeights"; editorTemplate -suppress "paintTrans"; editorTemplate -suppress "paintArrDirty"; editorTemplate -suppress "nurbsSamples"; editorTemplate -suppress "smoothness"; editorTemplate -suppress "useComponentsMatrix"; editorTemplate -suppress "wtDrty"; editorTemplate -suppress "blendWeights"; editorTemplate -endLayout; AEweightGeometryFilterTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }