// =========================================================================== // 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_ReplicatorTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; python("import MASH.nodeHeaders; MASH.nodeHeaders.addHeader('" + $nodeName + "', 'Replicator')") editorTemplate -endLayout; editorTemplate -label (getPluginResource("MASH", "kReplicants")) -addControl "replicants"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kTransformationSpace")) -addControl "transformationSpace"; editorTemplate -beginLayout (getPluginResource("MASH", "kPos")) -collapse 0; editorTemplate -label (getPluginResource("MASH", "kOffsetPosX")) -addControl "offsetPositionX"; editorTemplate -label (getPluginResource("MASH", "kOffsetPosY")) -addControl "offsetPositionY"; editorTemplate -label (getPluginResource("MASH", "kOffsetPosZ")) -addControl "offsetPositionZ"; AEaddRampControl ($nodeName+".positionRamp"); editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kScale")) -collapse 1; editorTemplate -label (getPluginResource("MASH", "kScaleTogether")) -ann (getPluginResource("MASH", "kScaleTogetherAnn")) -addControl "scaleTogether"; editorTemplate -label (getPluginResource("MASH", "kScaleRepX")) -addControl "scalePointsX"; editorTemplate -label (getPluginResource("MASH", "kScaleRepY")) -addControl "scalePointsY"; editorTemplate -label (getPluginResource("MASH", "kScaleRepZ")) -addControl "scalePointsZ"; AEaddRampControl ($nodeName+".scaleRamp"); editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kRot")) -collapse 1; editorTemplate -label (getPluginResource("MASH", "kRotTogether")) -ann (getPluginResource("MASH", "kRotTogetherAnn")) -addControl "patternRotateTogether"; editorTemplate -label (getPluginResource("MASH", "kRotRepX")) -addControl "rotatePointsX"; editorTemplate -label (getPluginResource("MASH", "kRotRepY")) -addControl "rotatePointsY"; editorTemplate -label (getPluginResource("MASH", "kRotRepZ")) -addControl "rotatePointsZ"; AEaddRampControl ($nodeName+".rotationRamp"); editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kRotAround")) -addControl "rotateAround"; editorTemplate -endLayout; editorTemplate -label (getPluginResource("MASH", "kOffset")) -addControl "offset"; editorTemplate -label (getPluginResource("MASH", "kStepID")) -ann (getPluginResource("MASH", "kStepIDAnn")) -addControl "idIsReplicant"; editorTemplate -beginLayout (getPluginResource("MASH", "kPattern")) -collapse 1; editorTemplate -bn; editorTemplate -label (getPluginResource("MASH", "kAffectPos")) -addControl "patternAffectsPosition"; editorTemplate -label (getPluginResource("MASH", "kAffectRot")) -addControl "patternAffectsRotation"; editorTemplate -label (getPluginResource("MASH", "kAffectScale")) -addControl "patternAffectsScale"; editorTemplate -en; editorTemplate -label (getPluginResource("MASH", "kPattern")) -addControl "patternModulus"; editorTemplate -label (getPluginResource("MASH", "kPatternOffX")) -addControl "patternOffsetX"; editorTemplate -label (getPluginResource("MASH", "kPatternOffY")) -addControl "patternOffsetY"; editorTemplate -label (getPluginResource("MASH", "kPatternOffZ")) -addControl "patternOffsetZ"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kPatternScaleX")) -addControl "patternScaleX"; editorTemplate -label (getPluginResource("MASH", "kPatternScaleY")) -addControl "patternScaleY"; editorTemplate -label (getPluginResource("MASH", "kPatternScaleZ")) -addControl "patternScaleZ"; editorTemplate -addSeparator; editorTemplate -label (getPluginResource("MASH", "kPatternRotX")) -addControl "patternRotationX"; editorTemplate -label (getPluginResource("MASH", "kPatternRotY")) -addControl "patternRotationY"; editorTemplate -label (getPluginResource("MASH", "kPatternRotZ")) -addControl "patternRotationZ"; editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kCurve")) -collapse 1; editorTemplate -callCustom "MASHreplicatorCurveSingleInputBuildQt" "MASHreplicatorCurveSingleInputUpdateQt" ""; editorTemplate -label (getPluginResource("MASH", "kTimeSlideAnim")) -addControl "timeSlide"; editorTemplate -label (getPluginResource("MASH", "kCurveScale")) -addControl "curveScale"; editorTemplate -label (getPluginResource("MASH", "kUpVector")) -addControl "upVector"; editorTemplate -label (getPluginResource("MASH", "kRotOffset")) -addControl "rotationOffset"; editorTemplate -label (getPluginResource("MASH", "kUseCurve")) -addControl "useCurve"; editorTemplate -endLayout; editorTemplate -beginLayout (getPluginResource("MASH", "kDrivenChan")) -collapse 1; editorTemplate -callCustom "AEaddReplicatorButtons" "AEaddReplicatorButtonsEdit" ""; editorTemplate -ccu "MASHcreateInputs" "MASHeditInputs" "driverPositionInPP" (getPluginResource("MASH", "kDrivingPosition")); editorTemplate -ccu "MASHcreateInputs" "MASHeditInputs" "driverRotationInPP" (getPluginResource("MASH", "kDrivingRotation")); editorTemplate -ccu "MASHcreateInputs" "MASHeditInputs" "driverScaleInPP" (getPluginResource("MASH", "kDrivingScale")); editorTemplate -endLayout; 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 -endLayout; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; } global proc AEaddReplicatorButtons ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -bgc (181.0/255.0) (157.0/255.0) (136.0/255.0) -label (getPluginResource("MASH", "kWaiterConnect")) -c ("replicatorButtonCMDS " + $nodeName[0] + " 1") connReplicatorMASHButton; separator -w 100 -h 5 -hr 1 -st "none"; } global proc AEaddReplicatorButtonsEdit ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -e -c ("replicatorButtonCMDS " + $nodeName[0] + " 1") connReplicatorMASHButton; } global proc AEaddReplicatorCurveButtons ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -bgc (181.0/255.0) (157.0/255.0) (136.0/255.0) -label (getPluginResource("MASH", "kCurveConnect")) -c ("replicatorButtonCMDS " + $nodeName[0] + " 2") connReplicatorCurveMASHButton; separator -w 100 -h 5 -hr 1 -st "none"; } global proc AEaddReplicatorCurveButtonsEdit ( string $attr ) { string $nodeName[]; tokenize($attr, ".", $nodeName); button -e -c ("replicatorButtonCMDS " + $nodeName[0] + " 2") connReplicatorCurveMASHButton; } global proc replicatorButtonCMDS (string $nodeName, int $whichCMD) { if ($whichCMD == 1) { string $obj[] = `ls -sl`; if (size($obj) > 0) { if (`nodeType $obj[0]` == "MASH_Waiter") { connectAttr -force ($obj[0]+".inPositionPP") ($nodeName+".driverPositionInPP"); connectAttr -force ($obj[0]+".inRotationPP") ($nodeName+".driverRotationInPP"); connectAttr -force ($obj[0]+".inScalePP") ($nodeName+".driverScaleInPP"); MASHinViewMessage((getPluginResource("MASH", "kWaiterConn")), "Info"); } else { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectAWaiter")), "Warning"); } } else { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectAWaiter")), "Warning"); } } else if ($whichCMD == 2) { string $filter[] = `filterExpand -sm 9`; if (size($filter) > 0) { string $shape[] = `listRelatives -s $filter[0]`; connectAttr -force ($shape[0]+".worldSpace[0]") ($nodeName+".inputCurve"); setAttr ($nodeName+".useCurve") 1; MASHinViewMessage((getPluginResource("MASH", "kCurveConnected")), "Info"); } else { MASHinViewMessage((getPluginResource("MASH", "kPleaseSelectACurve")), "Warning"); } } evalDeferred("updateAE " + $nodeName); } global proc MASHreplicatorCurveSingleInputBuildQt(string $nodeName) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; python("import MASHsingleInputQtWidget"); rowLayout -numberOfColumns 2 -columnWidth2 139 250 replicatorCurveLayout; text -w 105 -h 20 -vis 1 -label (getPluginResource("MASH", "kDDCurve")) -align "right" -font "plainLabelFont" ; //get python to create the widget, include the desired nodeType as an arguement python("MASHsingleInputQtWidget.build_qt_widget('replicatorCurveLayout', '" + $nodeName + "', 'nurbsCurve', 'inputCurve', 'worldSpace', 'ReplicatorEnableCurve')"); setParent..; } global proc MASHreplicatorCurveSingleInputUpdateQt(string $nodeName ) { string $buffer[]; tokenize($nodeName, ".", $buffer); $nodeName = $buffer[0]; python("import MASHsingleInputQtWidget"); python("MASHsingleInputQtWidget.update_qt_widget('replicatorCurveLayout', '" + $nodeName + "', 'nurbsCurve', 'inputCurve', 'worldSpace', 'ReplicatorEnableCurve')"); }