// =========================================================================== // 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 MASHcheckChannelRandomType ( string $nodeName ) { if ( `objExists $nodeName` == 0 ) return; string $nodeAttr = $nodeName + ".dynamicsChannelName"; int $value = `getAttr $nodeAttr`; //fixed if ($value == 0 || $value == 1 || $value == 2 || $value == 3 || $value == 4 || $value == 5 || $value == 6 || $value == 8 || $value == 11 || $value == 12 || $value == 13 || $value == 14 || $value == 15) { // Doubles editorTemplate -dimControl $nodeName "startVector" true; editorTemplate -dimControl $nodeName "varianceVectorMin" true; editorTemplate -dimControl $nodeName "varianceVectorMax" true; editorTemplate -dimControl $nodeName "startValue" false; editorTemplate -dimControl $nodeName "varianceMin" false; editorTemplate -dimControl $nodeName "varianceMax" false; } else { // Vectors editorTemplate -dimControl $nodeName "startVector" false; editorTemplate -dimControl $nodeName "varianceVectorMin" false; editorTemplate -dimControl $nodeName "varianceVectorMax" false; editorTemplate -dimControl $nodeName "startValue" true; editorTemplate -dimControl $nodeName "varianceMin" true; editorTemplate -dimControl $nodeName "varianceMax" true; } // print $value; if ($value == 0) { editorTemplate -dimControl $nodeName "constraintChannelName" false; } else { editorTemplate -dimControl $nodeName "constraintChannelName" true; } $nodeAttr = $nodeName + ".constraintChannelName"; int $constraintChannel = `getAttr $nodeAttr`; // constraint vectors if ($constraintChannel > 4 && $constraintChannel < 9 || $constraintChannel > 14) { editorTemplate -dimControl $nodeName "startVector" false; editorTemplate -dimControl $nodeName "varianceVectorMin" false; editorTemplate -dimControl $nodeName "varianceVectorMax" false; editorTemplate -dimControl $nodeName "startValue" true; editorTemplate -dimControl $nodeName "varianceMin" true; editorTemplate -dimControl $nodeName "varianceMax" true; } } global proc AEMASH_ChannelRandomTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'kChannelRandom')") editorTemplate -endLayout; editorTemplate -bn; editorTemplate -label (getPluginResource("MASH", "kChannelName")) -addControl "dynamicsChannelName" "MASHcheckChannelRandomType"; editorTemplate -label (getPluginResource("MASH", "kConstraintChannelName")) -addControl "constraintChannelName" "MASHcheckChannelRandomType"; editorTemplate -label (getPluginResource("MASH", "kStartValue")) -addControl "startValue"; editorTemplate -label (getPluginResource("MASH", "kStartValue")) -addControl "startVector"; editorTemplate -label (getPluginResource("MASH", "kVarianceMinimum")) -addControl "varianceMin"; editorTemplate -label (getPluginResource("MASH", "kVarianceMaximum")) -addControl "varianceMax"; editorTemplate -label (getPluginResource("MASH", "kVarianceMinimum")) -addControl "varianceVectorMin"; editorTemplate -label (getPluginResource("MASH", "kVarianceMaximum")) -addControl "varianceVectorMax"; editorTemplate -label (getPluginResource("MASH", "kRandSeed")) -addControl "randomSeed"; 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 -beginLayout (getPluginResource("MASH", "kFalloffObject")) -collapse 1; editorTemplate -callCustom "MASHfalloffButtons" "MASHfalloffButtonsEdit" ""; editorTemplate -endLayout; editorTemplate -endLayout; AEdependNodeTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }