// =========================================================================== // 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. // =========================================================================== global proc AEMASH_InheritTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Inherit')") editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kInheritNode")) -collapse 0; editorTemplate -callCustom "AEDistributeRadios" "AEDistributeRadiosEdit" "inheritStyle"; editorTemplate -label (getPluginResource("MASH", "kRandSeed")) -addControl "randomSeed"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kStrength")) -addControl "Envelope"; editorTemplate -label (getPluginResource("MASH", "kRandStrength")) -addControl "randEnvelope"; editorTemplate -label (getPluginResource("MASH", "kStepStrength")) -addControl "StepEnvelope"; editorTemplate -suppress "inIterations"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kForce")) -addControl "force"; editorTemplate -label (getPluginResource("MASH", "kForceVar")) -addControl "forceVar"; editorTemplate -addSeparator; editorTemplate -callCustom "AEaddInheritButtons" "AEaddInheritButtonsEdit" ""; editorTemplate -beginLayout (getPluginResource("MASH", "kFalloffObject")) -collapse 1; editorTemplate -callCustom "AEfalloffButton" "AEfalloffButtonEdit" ""; editorTemplate -endLayout; AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; editorTemplate -suppress "time"; } global proc AEDistributeRadios( string $attrName ) { radioButtonGrp -label (getPluginResource("MASH", "kDistroStyle")) -numberOfRadioButtons 2 -label1 (getPluginResource("MASH", "kLinear")) -data1 1 -label2 (getPluginResource("MASH", "kRandom")) -data2 2 inheritDistRadioGrp; connectControl inheritDistRadioGrp $attrName; } global proc AEDistributeRadiosEdit( string $attrName ) { connectControl inheritDistRadioGrp $attrName; } global proc AEaddInheritButtons ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -bgc (181.0/255.0) (157.0/255.0) (136.0/255.0) -label (getPluginResource("MASH", "kConnectParent")) -c ("inheritParentButtonCMDS " + $nodeName[0] + " 1") connParentMASHButton; button -bgc (140.0/255.0) (167.0/255.0) (173.0/255.0) -label (getPluginResource("MASH", "kCrea")) -c ("inheritParentButtonCMDS " + $nodeName[0] + " 2") createParentMASHButton; separator -w 100 -h 5 -hr 1 -st "none"; } global proc inheritParentButtonCMDS (string $nodeName, int $whichCMD) { if ($whichCMD == 1) { //string $filter[] = `filterExpand -sm 9`; string $filter[] = `ls -sl -tr`; if (size($filter) > 0) { for ( $i = 0; $i < size($filter); $i++) { int $index = getNextFreeMultiIndex( ($nodeName+".inTargetMatrices"), 0 ); connectAttr -force ($filter[$i]+".worldMatrix[0]") ($nodeName+".inTargetMatrices[" + $index + "]"); MASHinViewMessage("Translate connected.", "Info"); } } else { MASHinViewMessage("Please select a transform.", "Warning"); } } else if ($whichCMD == 2) { string $obj[] = `spaceLocator -n "Inherit Null"`; setAttr ($obj[0]+".overrideColor") 9; setAttr ($obj[0]+".overrideEnabled") 1; int $index = getNextFreeMultiIndex( ($nodeName+".inTargetMatrices"), 0 ); connectAttr -force ($obj[0]+".worldMatrix[0]") ($nodeName+".inTargetMatrices[" + $index + "]"); MASHinViewMessage("Translate connected.", "Info"); } evalDeferred("updateAE " + $nodeName); } global proc AEaddInheritButtonsEdit ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -e -c ("inheritParentButtonCMDS " + $nodeName[0] + " 1") connParentMASHButton; button -e -c ("inheritParentButtonCMDS " + $nodeName[0] + " 2") createParentMASHButton; }