// =========================================================================== // 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_SymmetryTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Symmetry')") editorTemplate -endLayout; editorTemplate -label (getPluginResource("MASH", "kPlacement")) -addControl "placementMode"; editorTemplate -label (getPluginResource("MASH", "kAxis")) -addControl "axisOfSymmetry"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kEnableRot")) -addControl "enableRotation"; editorTemplate -label (getPluginResource("MASH", "kAllowNegScale")) -addControl "enableScale"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kOffsetPos")) -addControl "offsetPosition"; editorTemplate -beginLayout (getPluginResource("MASH", "kStrength")) -collapse 0; editorTemplate -label (getPluginResource("MASH", "kStrength")) -addControl "Envelope"; editorTemplate -label (getPluginResource("MASH", "kRandStrength")) -addControl "randEnvelope"; editorTemplate -label (getPluginResource("MASH", "kStepStrength")) -addControl "StepEnvelope"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kStrengthMap")) -addControl "mColour"; editorTemplate -label (getPluginResource("MASH", "kMapProjAxis")) -addControl "mapDirection"; editorTemplate -callCustom "MASHmapHelperButton" "MASHmapHelperButtonEdit" ""; editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kFalloffObject")) -collapse 1; editorTemplate -callCustom "MASHfalloffButtons" "MASHfalloffButtonsEdit" ""; editorTemplate -endLayout; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; } global proc AEaddReplicatorButtons ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -bgc (181.0/255.0) (157.0/255.0) (136.0/255.0) -label (getPluginResource("MASH", "kWaiterConnect")) -c ("replicatorButtonCMDS " + $nodeName[0] + " 1") connReplicatorMASHButton; separator -w 100 -h 5 -hr 1 -st "none"; } global proc AEaddReplicatorButtonsEdit ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -e -c ("replicatorButtonCMDS " + $nodeName[0] + " 1") connReplicatorMASHButton; } global proc AEaddReplicatorCurveButtons ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -bgc (181.0/255.0) (157.0/255.0) (136.0/255.0) -label (getPluginResource("MASH", "kCurveConnect")) -c ("replicatorButtonCMDS " + $nodeName[0] + " 2") connReplicatorCurveMASHButton; separator -w 100 -h 5 -hr 1 -st "none"; } global proc AEaddReplicatorCurveButtonsEdit ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -e -c ("replicatorButtonCMDS " + $nodeName[0] + " 2") connReplicatorCurveMASHButton; } global proc replicatorButtonCMDS (string $nodeName, int $whichCMD) { if ($whichCMD == 1) { string $obj[] = `ls -sl`; if (size($obj) > 0) { if (`nodeType $obj[0]` == "MASH_Waiter") { connectAttr -force ($obj[0]+".inputArray") ($nodeName+".driverPositionInPP"); connectAttr -force ($obj[0]+".inRotationPP") ($nodeName+".driverRotationInPP"); connectAttr -force ($obj[0]+".inScalePP") ($nodeName+".driverScaleInPP"); MASHinViewMessage((getPluginResource("MASH", "kWaiterConn")), "Info"); } else { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectAWaiter")), "Warning"); } } else { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectAWaiter")), "Warning"); } } else if ($whichCMD == 2) { string $filter[] = `filterExpand -sm 9`; if (size($filter) > 0) { string $shape[] = `listRelatives -s $filter[0]`; connectAttr -force ($shape[0]+".worldSpace[0]") ($nodeName+".inputCurve"); setAttr ($nodeName+".useCurve") 1; MASHinViewMessage((getPluginResource("MASH", "kCurveConnected")), "Info"); } else { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectACurve")), "Warning"); } } evalDeferred("updateAE " + $nodeName); }