// =========================================================================== // 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_PythonTemplate(string $nodeName) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Python')") editorTemplate -endLayout; editorTemplate -callCustom "MASHPythonEditorBuildQt" "MASHPythonEditorUpdateQt" ""; editorTemplate -label "Time" -addControl "time"; editorTemplate -beginLayout (getPluginResource("MASH", "kFalloffObject")) -collapse 1; editorTemplate -callCustom "MASHfalloffButtons" "MASHfalloffButtonsEdit" ""; editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kStrength")) -collapse 1; 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 -endLayout; editorTemplate -suppress "stringOn"; editorTemplate -suppress "stringOff"; editorTemplate -suppress "pyScript"; editorTemplate -suppress "enable"; editorTemplate -suppress "inputPoints"; editorTemplate -suppress "translateInPP"; editorTemplate -suppress "axillaryInPP"; editorTemplate -suppress "translateOutPP"; editorTemplate -suppress "axillaryOutPP"; editorTemplate -suppress "strengthPP"; editorTemplate -suppress "nodeState"; editorTemplate -suppress "transformationSpace"; editorTemplate -suppress "frozen"; editorTemplate -suppress "caching"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; MASHsupressLegacyControls; //Enabling this causes problems with PySide Widget display. //AEdependNodeTemplate $nodeName; } global proc MASHPythonEditorBuildQt(string $nodeName) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; python("import MASHpythonEditor"); string $parent = `setParent -q`; //get python to create the widget, include the desired nodeType as an arguement python("MASHpythonEditor.build_qt_widget('" + $parent + "', '" + $nodeName + "', 'pyScript')"); setParent..; } global proc MASHPythonEditorUpdateQt(string $nodeName ) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; string $parent = `setParent -q`; python("MASHpythonEditor.update_qt_widget('" + $parent + "', '" + $nodeName + "', 'pyScript')"); }