// =========================================================================== // 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 MASHcheckInfluenceRadius ( string $nodeName ) { if ( `objExists $nodeName` == 0 ) return; string $nodeAttr = $nodeName + ".influenceMode"; int $value = `getAttr $nodeAttr`; if ($value) { editorTemplate -dimControl $nodeName "influenceRadius" false; } else { editorTemplate -dimControl $nodeName "influenceRadius" true; } } global proc AEMASH_InfluenceTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Influence')") editorTemplate -endLayout; editorTemplate -callCustom "MASHinfluenceTransformListWidgetBuildQt" "MASHinfluenceTransformListWidgetUpdateQt" ""; editorTemplate -label (getPluginResource("MASH", "kInfluencePower")) -addControl "falloffPower"; editorTemplate -label (getPluginResource("MASH", "kUseRadius")) -addControl "influenceMode" "MASHcheckInfluenceRadius"; editorTemplate -label (getPluginResource("MASH", "kInfluenceRadius")) -addControl "influenceRadius"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kStrength")) -addControl "Envelope"; editorTemplate -label (getPluginResource("MASH", "kRandStrength")) -addControl "randEnvelope"; editorTemplate -label (getPluginResource("MASH", "kStepStrength")) -addControl "StepEnvelope"; editorTemplate -addSeparator; editorTemplate -bn; editorTemplate -label (getPluginResource("MASH", "kEnableVortex")) -addControl "vortexStrength"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kEnableScale")) -addControl "enableScale"; editorTemplate -label (getPluginResource("MASH", "kEnableRot")) -addControl "enableRot"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kOverwriteScale")) -addControl "overwriteScale"; editorTemplate -label (getPluginResource("MASH", "kOverwriteRot")) -addControl "overwriteRotation"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kEnableTransX")) -addControl "translateX"; editorTemplate -label (getPluginResource("MASH", "kEnableTransY")) -addControl "translateY"; editorTemplate -label (getPluginResource("MASH", "kEnableTransZ")) -addControl "translateZ"; editorTemplate -en; AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; editorTemplate -suppress "inIterations"; } global proc AEguideButton ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -label (getPluginResource("MASH", "kAddInfluenceLoc")) -c ("MASHguideButtonCMDS " + $nodeName[0] + " 1") setGuideMASHButton; separator -w 100 -h 5 -hr 1 -st "none"; } global proc AEguideButtonEdit ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -e -c ("MASHguideButtonCMDS " + $nodeName[0] + " 1") setGuideMASHButton; } global proc MASHinfluenceTransformListWidgetBuildQt(string $nodeName) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; python("import MASHlistQtWidget"); string $parent = `setParent -q`; //get python to create the widget, include the desired nodeType as an arguement python("MASHlistQtWidget.build_qt_widget('" + $parent + "', '" + $nodeName + "', 'transform', 'guideMatrices', 'worldMatrix[0]', '', 'kDDInfluenceLocators')"); setParent..; } global proc MASHinfluenceTransformListWidgetUpdateQt(string $nodeName ) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; string $parent = `setParent -q`; python("import MASHsingleInputQtWidget"); python("MASHlistQtWidget.update_qt_widget('" + $parent + "', '" + $nodeName + "', 'transform', 'guideMatrices', 'worldMatrix[0]', '', 'kDDInfluenceLocators')"); }