// =========================================================================== // 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 MASHcheckCurveType ( string $nodeName ) { if ( `objExists $nodeName` == 0 ) return; string $nodeAttr = $nodeName + ".proportionalMulti"; int $propMulti = `getAttr $nodeAttr`; $nodeAttr = $nodeName + ".parametricLength"; int $ignoreStep = `getAttr $nodeAttr`; $nodeAttr = $nodeName + ".equalSpacing"; int $equalSpacing = `getAttr $nodeAttr`; if ($equalSpacing && $propMulti) { editorTemplate -dimControl $nodeName "parametricLength" true; } else { editorTemplate -dimControl $nodeName "parametricLength" false; } if ($ignoreStep) { editorTemplate -dimControl $nodeName "equalSpacing" true; } else { editorTemplate -dimControl $nodeName "equalSpacing" false; } if ($ignoreStep && $propMulti) { editorTemplate -dimControl $nodeName "equalSpacing" true; } else { editorTemplate -dimControl $nodeName "equalSpacing" false; } if ($propMulti && !$ignoreStep) { editorTemplate -dimControl $nodeName "equalSpacing" false; } else { editorTemplate -dimControl $nodeName "equalSpacing" true; } if ($ignoreStep) { editorTemplate -dimControl $nodeName "timeStep" true; } else { editorTemplate -dimControl $nodeName "timeStep" false; } } global proc AEMASH_CurveTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Curve')") editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kCurveRollDown")) -collapse 0; editorTemplate -callCustom "MASHcurveListWidgetBuildQt" "MASHcurveListWidgetUpdateQt" ""; editorTemplate -callCustom "MASHaimCurveSingleInputBuildQt" "MASHaimCurveInputUpdateQt" ""; editorTemplate -endLayout; editorTemplate -label (getPluginResource("MASH", "kTransformationSpace")) -addControl "transformationSpace"; editorTemplate -label (getPluginResource("MASH", "kCurveStep")) -addControl "timeStep"; editorTemplate -label (getPluginResource("MASH", "kTimeSlideAnim")) -addControl "timeSlide"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kTimeStepVar")) -addControl "timeStepVar"; editorTemplate -label (getPluginResource("MASH", "kVelocityRandom")) -addControl "velocityVariation"; editorTemplate -label (getPluginResource("MASH", "kVelocityNoise")) -addControl "velocityNoise"; editorTemplate -label (getPluginResource("MASH", "kNoiseScale")) -addControl "velocityNoiseScale"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kOffsetAlongCurve")) -addControl "offsetAlongCurve"; editorTemplate -label (getPluginResource("MASH", "kClipStart")) -addControl "clipStart"; editorTemplate -label (getPluginResource("MASH", "kClipEnd")) -addControl "clipEnd"; editorTemplate -label (getPluginResource("MASH", "kUpVector")) -addControl "upVector"; editorTemplate -label (getPluginResource("MASH", "kRollAmount")) -addControl "curveRoll"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kProportionalCounts")) -ann (getPluginResource("MASH", "kProportionalCountsAnn")) -addControl "proportionalMulti" "MASHcheckCurveType"; editorTemplate -label (getPluginResource("MASH", "kEqualSpacing")) -ann (getPluginResource("MASH", "kEqualSpacingAnn")) -addControl "equalSpacing" "MASHcheckCurveType"; editorTemplate -label (getPluginResource("MASH", "kCurveLengthAffectsSpeed")) -ann (getPluginResource("MASH", "kCurveLengthAffectsSpeedAnn")) -addControl "curveLengthAffectsSpeed"; editorTemplate -addSeparator; editorTemplate -bn; editorTemplate -label (getPluginResource("MASH", "kIgnoreStep")) -ann (getPluginResource("MASH", "kIgnoreStepAnn")) -addControl "parametricLength" "MASHcheckCurveType"; editorTemplate -label (getPluginResource("MASH", "kCalculateRotation")) -addControl "calculateRotation"; editorTemplate -label (getPluginResource("MASH", "kStopAtEndOfCurve")) -addControl "stopAtEnd"; editorTemplate -label (getPluginResource("MASH", "kTime")) -addControl "time"; editorTemplate -en; 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; AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; editorTemplate -suppress "inIterations"; editorTemplate -suppress "outAgePP"; editorTemplate -suppress "localMode"; editorTemplate -suppress "curveScale"; editorTemplate -suppress "aimCurve"; editorTemplate -suppress "aimCurve"; editorTemplate -suppress "stringOn"; editorTemplate -suppress "stringOff"; editorTemplate -suppress "strengthPP"; editorTemplate -suppress "SimpleValue"; editorTemplate -suppress "SimpleUEnvelope"; editorTemplate -suppress "inputCurve"; editorTemplate -suppress "inCurves"; editorTemplate -suppress "translateOutPP"; editorTemplate -suppress "translateInPP"; MASHsupressLegacyControls; } global proc MASHcurveListWidgetBuildQt(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 + "', 'nurbsCurve,bezierCurve', 'inCurves', 'worldSpace[0],worldSpace[0]', '', 'kDDInputCurves')"); setParent..; } global proc MASHcurveListWidgetUpdateQt(string $nodeName ) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; string $parent = `setParent -q`; python("import MASHlistQtWidget"); python("MASHlistQtWidget.update_qt_widget('" + $parent + "', '" + $nodeName + "', 'nurbsCurve,bezierCurve', 'inCurves', 'worldSpace[0],worldSpace[0]', '', 'kDDInputCurves')"); } global proc MASHaimCurveSingleInputBuildQt(string $nodeName) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; python("import MASHsingleInputQtWidget"); rowLayout -numberOfColumns 2 -columnWidth2 139 250 aimCurveLay; text -w 105 -h 20 -vis 1 -label (getPluginResource("MASH", "kDDAimCurve")) -align "right" -font "plainLabelFont" ; //get python to create the widget, include the desired nodeType as an arguement python("MASHsingleInputQtWidget.build_qt_widget('aimCurveLay', '" + $nodeName + "', 'nurbsCurve', 'aimCurve', 'worldSpace', '')"); setParent..; } global proc MASHaimCurveInputUpdateQt(string $nodeName ) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; python("import MASHsingleInputQtWidget"); python("MASHsingleInputQtWidget.update_qt_widget('aimCurveLay', '" + $nodeName + "', 'nurbsCurve', 'aimCurve', 'worldSpace', '')"); }