// =========================================================================== // 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 MASHcheckTimeType ( string $nodeName ) { if ( `objExists $nodeName` == 0 ) return; string $nodeAttr = $nodeName + ".limitLoops"; int $value = `getAttr $nodeAttr`; $nodeAttr = $nodeName + ".randomStagger"; int $stagger = `getAttr $nodeAttr`; $nodeAttr = $nodeName + ".simulateTime"; int $simTime = `getAttr $nodeAttr`; $nodeAttr = $nodeName + ".strengthMode"; int $strengthMode = `getAttr $nodeAttr`; //limit loops if ($value) { editorTemplate -dimControl $nodeName "numberOfLoops" false; } else { editorTemplate -dimControl $nodeName "numberOfLoops" true; } //sim time if ($simTime) { editorTemplate -dimControl $nodeName "simStartFrame" false; } else { editorTemplate -dimControl $nodeName "simStartFrame" true; } //strength if ($strengthMode != 1) { editorTemplate -dimControl $nodeName "Envelope" false; editorTemplate -dimControl $nodeName "randEnvelope" false; editorTemplate -dimControl $nodeName "StepEnvelope" false; editorTemplate -dimControl $nodeName "mColour" false; editorTemplate -dimControl $nodeName "mapDirection" false; } else { editorTemplate -dimControl $nodeName "Envelope" true; editorTemplate -dimControl $nodeName "randEnvelope" true; editorTemplate -dimControl $nodeName "StepEnvelope" true; editorTemplate -dimControl $nodeName "mColour" true; editorTemplate -dimControl $nodeName "mapDirection" true; } } global proc AEMASH_TimeTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Time')") editorTemplate -endLayout; editorTemplate -label (getPluginResource("MASH", "kAnimStart")) -addControl "animationStart"; editorTemplate -label (getPluginResource("MASH", "kAnimEnd")) -addControl "animationEnd"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kStaggerFrames")) -addControl "staggerFrames"; editorTemplate -label (getPluginResource("MASH", "kRandStagger")) -addControl "randomStagger" "MASHcheckTimeType"; editorTemplate -label (getPluginResource("MASH", "kRandSeed")) -addControl "randomSeed"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kLimitLoops")) -addControl "limitLoops" "MASHcheckTimeType"; editorTemplate -label (getPluginResource("MASH", "kLoopNum")) -addControl "numberOfLoops"; editorTemplate -addSeparator; editorTemplate -bn; editorTemplate -label (getPluginResource("MASH", "kRoundNumbers")) -addControl "roundTime"; editorTemplate -label (getPluginResource("MASH", "kUseVelocity")) -addControl "enableVelocity"; editorTemplate -label (getPluginResource("MASH", "kSimTime")) -addControl "simulateTime" "MASHcheckTimeType"; editorTemplate -en; editorTemplate -label (getPluginResource("MASH", "kSimStart")) -addControl "simStartFrame"; editorTemplate -label (getPluginResource("MASH", "kTimeScale")) -addControl "timeScale"; editorTemplate -label (getPluginResource("MASH", "kTimeScaleRandom")) -addControl "timeScaleRandom"; editorTemplate -label (getPluginResource("MASH", "kTimeOffset")) -addControl "timeOffset"; editorTemplate -label (getPluginResource("MASH", "kTime")) -addControl "time"; editorTemplate -beginLayout (getPluginResource("MASH", "kStrAndFalloff")) -collapse 1; editorTemplate -label (getPluginResource("MASH", "kstrengthMode")) -addControl "strengthMode" "MASHcheckTimeType"; editorTemplate -beginLayout (getPluginResource("MASH", "kFalloffObject")) -collapse 1; editorTemplate -callCustom "MASHfalloffButtons" "MASHfalloffButtonsEdit" ""; editorTemplate -endLayout; 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; AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; editorTemplate -suppress "grpsize"; editorTemplate -suppress "Envelope"; editorTemplate -suppress "Envelope"; editorTemplate -suppress "randEnvelope"; editorTemplate -suppress "StepEnvelope"; editorTemplate -suppress "falloffX"; editorTemplate -suppress "falloffY"; editorTemplate -suppress "falloffZ"; editorTemplate -suppress "inputPoints"; editorTemplate -suppress "inMapMatrix"; editorTemplate -suppress "strengthPP"; editorTemplate -suppress "stringOff"; editorTemplate -suppress "stringOn"; editorTemplate -suppress "inFrames"; }