// =========================================================================== // 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 sculptMeshCacheRotateStamp() { float $pi = 3.14159; string $tool = `currentCtx`; float $stampRotation = (`sculptMeshCacheCtx -q -stampRotation $tool`); $stampRotation = $stampRotation + $pi * 0.5; if( $stampRotation >= $pi * 2.0 ) $stampRotation = $stampRotation - $pi * 2.0; // Because of precision problem after rotating by 90 degrees 4 times the result is not exactly 360 (that is 0 after modulo) so we have to round it. if( $stampRotation < 0.01 ) $stampRotation = 0; sculptMeshCacheCtx -e -stampRotation $stampRotation $tool; iconTextButton -e -rotation $stampRotation stampFile_IMG; } global proc sculptMeshCacheClearStamp() { sculptMeshCacheCtx -e -stampFile "" -useStampImage 0 `currentCtx`; } global proc sculptMeshCachePickStamp() { ContentBrowserWindow; contentBrowserSetLocation("Examples/Modeling/Sculpting Stamps"); } global proc sculptMeshCacheImportStamp() { global int $gArtSetAttrMapWorkspace; global string $gArtWorkdirectory; // Set the proper image directory. string $imageDir = $gArtWorkdirectory; if ( "" == $imageDir ) { $imageDir = (`workspace -q -rd` + "sourceimages\/" ); } if (`file -q -ex $imageDir`) { if ( 1 == $gArtSetAttrMapWorkspace ) { workspace -dir $imageDir; $gArtSetAttrMapWorkspace = 0; } } string $action = (uiRes("m_sculptMeshCacheProperties.kImport")); string $callback = "sculptMeshCacheImportStampCB"; fileBrowser( $callback, $action, "image", 0 ); // Set the currenrt workspace directory. $gArtWorkdirectory = `workspace -q -dir`; } global proc int sculptMeshCacheImportStampCB( string $fileName, string $fileType ) { // Ask the context to load the file. eval("sculptMeshCacheCtx -e -stampFile \"" + $fileName + "\" `currentCtx`"); string $tool = `currentCtx`; sculptMeshCacheCtx -e -useStampImage 1 $tool; iconTextButton -e -image $fileName stampFile_IMG; // Return true to close the filebrowser. return true; } global proc sculptMeshCacheViewImage() { string $toolName = `currentCtx`; string $stampFile = (`sculptMeshCacheCtx -q -stampFile $toolName`); if( $stampFile != "" ) launchImageApp( $stampFile, 0, 0 ); } global proc sculptMeshCacheRefreshImage() { string $toolName = `currentCtx`; string $stampFile = (`sculptMeshCacheCtx -q -stampFile $toolName`); if( $stampFile != "" ) { sculptMeshCacheCtx -e -stampFile "" `currentCtx`; eval("sculptMeshCacheCtx -e -stampFile \"" + $stampFile + "\" `currentCtx`"); iconTextButton -e -image "" stampFile_IMG; iconTextButton -e -image $stampFile stampFile_IMG; } } global proc sculptMeshCacheSetUseStampSpacing( string $tool, int $use ) { floatSliderGrp -edit -enable $use sculptMeshStampDistance_FSG; sculptMeshCacheCtx -e -useStampDistance $use $tool; } global proc sculptMeshCacheSetUseStampImage( string $tool, int $use ) { sculptMeshCacheCtx -e -useStampImage $use $tool; } global proc sculptMeshCacheSetStampPlacement(string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshStampPlacement_OMG` - 1; sculptMeshCacheCtx -e -stampPlacement $newVal $tool; } global proc sculptMeshCacheSetDirection (string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshDirection_OMG` - 1; sculptMeshCacheCtx -e -direction $newVal $tool; } global proc sculptMeshCacheSetGrabDirection (string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshGrabDirection_OMG` - 1; sculptMeshCacheCtx -e -direction $newVal $tool; } global proc sculptMeshCacheSetPaintMethod(string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshPaintMethod_OMG`; if( $newVal == 1 ) sculptMeshCacheCtx -e -freezesmooth true -freezesmoothandpaint true $tool; if( $newVal == 2 ) sculptMeshCacheCtx -e -freezesmooth true -freezesmoothandpaint false $tool; } global proc sculptMeshCacheSetLayerMethod(string $tool) { int $newVal = 2 - `optionMenuGrp -q -select sculptMeshAffectAllLayers_OMG`; sculptMeshCacheCtx -e -affectAllLayers $newVal $tool; } global proc sculptMeshCacheSetBrushSpace (string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshBrushSpace_OMG` - 1; sculptMeshCacheCtx -e -useScreenSpace $newVal $tool; } global proc sculptMeshCacheRestoreTool(string $toolName) { string $cmd = "setToolTo " + $toolName; evalDeferred $cmd; } global proc sculptMeshCacheSetMirrorMode (string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshMirrorMode_OMG` - 1; string $mode = "none"; switch( $newVal ) { case 1: $mode = "objectx"; break; case 2: $mode = "objecty"; break; case 3: $mode = "objectz"; break; case 4: $mode = "worldx"; break; case 5: $mode = "worldy"; break; case 6: $mode = "worldz"; break; case 7: $mode = "topo"; break; } if( $mode != "topo" ) reflectionSetMode( $mode ); else { // Have to handle topo sym differently, because reflectionSetMode will switch to the selection tool. // (to pick the symmetry edge) and afterwards we want Maya to switch back to the sculpting tool. string $cmd = "sculptMeshCacheRestoreTool( \\\"" + `currentCtx` + "\\\")" ; pickTopoSymmetryEdge($cmd, 0); } } global proc sculptMeshCacheUpdateBlendShapeLists (string $tool) { string $currentBlendShape; string $items[] = `optionMenuGrp -q -ill sculptMeshCloneShapeSource_OMG`; if ( size($items) > 0 ) { $currentBlendShape = `optionMenuGrp -q -value sculptMeshCloneShapeSource_OMG`; deleteUI $items; } string $bsn[] = `ls -type blendShape`; int $selIndex = 0; if ( size($bsn) == 0 ) { optionMenuGrp -e -enable false sculptMeshCloneShapeSource_OMG; string $noBS = (uiRes("m_sculptMeshCacheProperties.kNoneAnnotation3")); menuItem -parent "sculptMeshCloneShapeSource_OMG|OptionMenu" -label $noBS; optionMenuGrp -e -sl 1 sculptMeshCloneShapeSource_OMG; } else { menuItem -parent "sculptMeshCloneShapeSource_OMG|OptionMenu" -label (uiRes("m_sculptMeshCacheProperties.kNoneAnnotation")); optionMenuGrp -e -enable true sculptMeshCloneShapeSource_OMG; for ( $i = 0; $i != size($bsn); $i++ ) { menuItem -parent "sculptMeshCloneShapeSource_OMG|OptionMenu" -label $bsn[$i]; if ( $bsn[$i] == $currentBlendShape ) $selIndex = $i+2; } } if ( $selIndex != 0 ) optionMenuGrp -e -sl $selIndex sculptMeshCloneShapeSource_OMG; else optionMenuGrp -e -sl 1 sculptMeshCloneShapeSource_OMG; sculptMeshCacheSetCloneShapeSource $tool 1; sculptMeshCacheSetCloneTargetSource $tool; } global proc sculptMeshCacheSetCloneShapeSource (string $tool, int $pickTarget) { if ( `optionMenuGrp -q -ni sculptMeshCloneShapeSource_OMG` == 0 ) return; string $currentBlendTarget; string $items[] = `optionMenuGrp -q -ill sculptMeshCloneTargetSource_OMG`; if ( size($items) > 0 ) { $currentBlendTarget = `optionMenuGrp -q -value sculptMeshCloneTargetSource_OMG`; deleteUI $items; } menuItem -parent "sculptMeshCloneTargetSource_OMG|OptionMenu" -label (uiRes("m_sculptMeshCacheProperties.kNoneAnnotation2")); if ( `optionMenuGrp -q -enable sculptMeshCloneShapeSource_OMG` == false ) { optionMenuGrp -e -enable false sculptMeshCloneTargetSource_OMG; optionMenuGrp -e -sl 1 sculptMeshCloneTargetSource_OMG; sculptMeshCacheCtx -e -cloneShapeSource "None" -cloneTargetSource "None" $tool; return; } optionMenuGrp -e -enable true sculptMeshCloneTargetSource_OMG; string $newVal = `optionMenuGrp -q -value sculptMeshCloneShapeSource_OMG`; if ( $newVal == "" || `optionMenuGrp -q -select sculptMeshCloneShapeSource_OMG` == 1 ) { sculptMeshCacheCtx -e -cloneShapeSource "None" -cloneTargetSource "None" $tool; return; } string $targets[] = `listAttr -m ($newVal+".w")`; int $selIndex = 0; for ( $i = 0; $i != size($targets); $i++ ) { menuItem -parent "sculptMeshCloneTargetSource_OMG|OptionMenu" -label $targets[$i]; if ( $targets[$i] == $currentBlendTarget ) $selIndex = $i+2; } if ( $selIndex != 0 ) optionMenuGrp -e -sl $selIndex sculptMeshCloneTargetSource_OMG; else { if ( $pickTarget && size($targets) > 0 ) optionMenuGrp -e -sl 2 sculptMeshCloneTargetSource_OMG; else optionMenuGrp -e -sl 1 sculptMeshCloneTargetSource_OMG; } sculptMeshCacheCtx -e -cloneShapeSource $newVal $tool; } global proc sculptMeshCacheSetCloneTargetSource (string $tool) { if ( `optionMenuGrp -q -ni sculptMeshCloneTargetSource_OMG` == 0 ) return; string $newVal = `optionMenuGrp -q -value sculptMeshCloneTargetSource_OMG`; sculptMeshCacheCtx -e -cloneTargetSource $newVal $tool; } global proc sculptMeshCacheSetCloneMethod (string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshCloneMethod_OMG` - 1; sculptMeshCacheCtx -e -cloneMethod $newVal $tool; } proc setOptionMenuGrpValueSafely( string $omg, string $value) { string $list[] = `optionMenuGrp -q -ils $omg`; for ( $i = 0; $i < size($list); $i++ ) { if ( $value == `menuItem -q -l $list[$i]` ) { int $j = $i+1; optionMenuGrp -e -sl $j $omg; return; } } string $parent = $omg+"|OptionMenu"; menuItem -parent $parent -label $value; optionMenuGrp -e -v $value $omg; } global proc sculptMeshCacheUpdateCloneSourceControls(string $tool) { string $currentBlendShape = `sculptMeshCacheCtx -q -cloneShapeSource $tool`; string $currentBlendShapeTarget = `sculptMeshCacheCtx -q -cloneTargetSource $tool`; setOptionMenuGrpValueSafely( "sculptMeshCloneShapeSource_OMG", $currentBlendShape ); setOptionMenuGrpValueSafely( "sculptMeshCloneTargetSource_OMG", $currentBlendShapeTarget ); } global proc sculptMeshCacheSetFalloffType (string $tool) { int $newVal = `optionMenuGrp -q -select sculptMeshFalloffType_OMG` - 1; sculptMeshCacheCtx -e -falloffType $newVal $tool; } global proc sculptMeshCacheMirrorValue() { string $text = (uiRes("m_sculptMeshCacheProperties.kMirrorOff1")); global float $gDefaultTextBGC[]; float $bgcol[] = { $gDefaultTextBGC[0], $gDefaultTextBGC[1], $gDefaultTextBGC[2] }; if (`symmetricModelling -q -s` && (`symmetricModelling -q -about` != "topo" || `symmetricModelling -q -topoSymmetry` != "")) { $text = reflectionGetModeString(); // unified Maya highlight color #5285A6 $bgcol[0] = 0.322; $bgcol[1] = 0.52; $bgcol[2] = 0.65; } textField -e -tx $text -bgc $bgcol[0] $bgcol[1] $bgcol[2] symModelingTextSculpt; } global proc sculptMeshCacheProperties( ) { source "falloffUtility.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; string $currCmd = "sculptMeshCacheCtx"; string $falloffName = "sculptFalloffCurve"; initCurvePreset(); global string $gCurvePresets[]; global int $gMaxCustomCurveSize; setUITemplate -pushTemplate OptionsTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true sculptMeshCache; frameLayout -label (uiRes("m_sculptMeshCacheProperties.kBrushSection")) -labelVisible true -collapsable false; rowLayout -numberOfColumns 2 -columnWidth 1 50 -columnWidth 2 20 -adjustableColumn 1 -rowAttach 2 "top" 0; floatSliderGrp -field true -pre 3 -cw 1 126 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kFalloffSize")) -annotation (uiRes("m_sculptMeshCacheProperties.kFalloffSizeAnnotation")) -cc ( ("sculptMeshCacheCtx -e -size #1 " + $currContext) ) sculptMeshFalloffSize_FSG; iconTextCheckBox -width 22 -height 22 -style "iconOnly" -image "nodeGrapherUnpinnedLarge.png" -selectionImage "nodeGrapherPinnedLarge.png" -annotation (uiRes("m_sculptMeshCacheProperties.kUseGlobalSizeAnnotation")) -onCommand ("sculptMeshCacheCtx -e -useGlobalSize false " + $currContext) -offCommand ("sculptMeshCacheCtx -e -useGlobalSize true " + $currContext) sculptMeshRemember_ITCB; setParent ..; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kFalloffSizeUnits")) -cc (("sculptMeshCacheSetBrushSpace(\"" + $currContext + "\");")) sculptMeshBrushSpace_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kWorldSpace")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kScreenSpace")); floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kFalloffStrength")) -annotation (uiRes("m_sculptMeshCacheProperties.kFalloffStrengthAnnotation")) -cc ( ("sculptMeshCacheCtx -e -strength #1 " + $currContext) ) sculptMeshFalloffStrength_FSG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kInvert")) -annotation (uiRes("m_sculptMeshCacheProperties.kInvertAnnotation")) -cc ( ("sculptMeshCacheCtx -e -inverted #1 " + $currContext) ) sculptMeshInvert_CBG; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kAffectAllLayers")) -annotation (uiRes("m_sculptMeshCacheProperties.kAffectAllLayersAnnotation")) -cc (("sculptMeshCacheSetLayerMethod(\"" + $currContext + "\");")) sculptMeshAffectAllLayers_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kAffectAll")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kAffectCurrent")); checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kTwist")) -annotation (uiRes("m_sculptMeshCacheProperties.kTwistAnnotation")) -cc ( ("sculptMeshCacheCtx -e -grabTwist #1 " + $currContext) ) sculptMeshTwist_CBG; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kPaintMethod")) -annotation (uiRes("m_sculptMeshCacheProperties.kPaintMethodAnnotation")) -cc (("sculptMeshCacheSetPaintMethod(\"" + $currContext + "\");")) sculptMeshPaintMethod_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kPMPaint")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kPMSmooth")); checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kLockShellBorder")) -cc ( ("sculptMeshCacheCtx -e -lockShellBorder #1 " + $currContext) ) sculptMeshLockShellBorder_CBG; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kDirection")) -cc (("sculptMeshCacheSetDirection(\"" + $currContext + "\");")) sculptMeshDirection_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kNormal")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kAvgNormal")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kVNormal")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kForward")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kRight")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kX")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kY")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kZ")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kCamera")); // When in grab mode, the direction values take a different meaning. // So we will create a separate drop-down just for grab. optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kGrabDirection")) -cc (("sculptMeshCacheSetGrabDirection(\"" + $currContext + "\");")) sculptMeshGrabDirection_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kGrabScreen")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kGrabNormal")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kGrabAvgNormal")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kXY")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kXZ")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kYZ")); rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 symm_ROW; text -label (uiRes("m_sculptMeshCacheProperties.kMirrorMode")); formLayout -vis 1 symmetryIcons; string $symModelingBtn = `iconTextButton -w 17 -h 22 -image ("popupMenuIcon.png") -annotation (uiRes("m_sculptMeshCacheProperties.kSetSymmetricModeling")) symModelingBtn`; string $symModelingPopMenu = `popupMenu -b 1 -p $symModelingBtn`; menu -e -pmc ("reflectionBuildMenu " + $symModelingPopMenu) $symModelingPopMenu; string $symModelingToggleMenu = `popupMenu -b 2 -p $symModelingBtn`; menu -e -pmc ("reflectionToggle") $symModelingToggleMenu; string $symModelingTextSculpt = `textField -ed false -width 100 -height 22 -tx (uiRes("m_sculptMeshCacheProperties.kMirrorOff")) -annotation (uiRes("m_sculptMeshCacheProperties.kSymModelingAnnot")) -drawInactiveFrame true symModelingTextSculpt`; scriptJob -parent symModelingTextSculpt -event "symmetricModellingOptionsChanged" ("sculptMeshCacheMirrorValue"); scriptJob -parent symModelingTextSculpt -event "polyTopoSymmetryValidChanged" ("sculptMeshCacheMirrorValue"); // The symmetry setting appears to be saved in the prefs // make sure the initial value in the UI corresponds with the saved value. evalDeferred( "sculptMeshCacheMirrorValue" ); setParent ..; formLayout -e -af symModelingTextSculpt right 1 -ac symModelingBtn right 1 symModelingTextSculpt symmetryIcons; setParent ..; rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 flood_ROW; text -label ""; button -label (uiRes("m_sculptMeshCacheProperties.kFlood")) -annotation (uiRes("m_sculptMeshCacheProperties.kFloodButtonAnnotation")) -width 80 -command ("sculptMeshFlood") sculptMeshFlood_BTN; setParent ..; rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 unmaskAll_ROW; text -label ""; button -label (uiRes("m_sculptMeshCacheProperties.kUnmaskAllButton")) -annotation (uiRes("m_sculptMeshCacheProperties.kUnmaskAllButtonAnnotation")) -width 80 -command ("sculptMeshUnmaskAll") unmaskAll_BTN; setParent ..; rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 invertMask_ROW; text -label ""; button -label (uiRes("m_sculptMeshCacheProperties.kInvertMaskButton")) -annotation (uiRes("m_sculptMeshCacheProperties.kInvertMaskButtonAnnotation")) -width 80 -command ("sculptMeshInvertMask") invertMask_BTN; setParent ..; columnLayout cloneControls_COL; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kCloneShapeSource")) -cc (("sculptMeshCacheSetCloneShapeSource(\"" + $currContext + "\", 0);")) -annotation (uiRes("m_sculptMeshCacheProperties.kCloneShapeSourceAnnotation")) sculptMeshCloneShapeSource_OMG; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kCloneTargetSource")) -cc (("sculptMeshCacheSetCloneTargetSource(\"" + $currContext + "\");")) -annotation (uiRes("m_sculptMeshCacheProperties.kCloneTargetSourceAnnotation")) sculptMeshCloneTargetSource_OMG; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kCloneMethod")) -cc ( ("sculptMeshCacheSetCloneMethod(\"" + $currContext + "\");")) -annotation (uiRes("m_sculptMeshCacheProperties.kCloneMethodAnnotation")) sculptMeshCloneMethod_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kCloneMethodCopy")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kCloneMethodAdd")); checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kCloneHideSource")) -cc ( ("sculptMeshCacheCtx -e -cloneHideSource #1 " + $currContext) ) -annotation (uiRes("m_sculptMeshCacheProperties.kCloneHideSourceAnnotation")) sculptMeshCloneHideSource_CBG; sculptMeshCacheUpdateBlendShapeLists $currContext; rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 floodClone_ROW; text -label ""; button -label (uiRes("m_sculptMeshCacheProperties.kFloodClone")) -annotation (uiRes("m_sculptMeshCacheProperties.kFloodCloneButtonAnnotation")) -width 80 -command ("sculptMeshFlood") sculptMeshFloodClone_BTN; setParent ..; setParent ..; scriptJob -permanent -parent cloneControls_COL -event "sculptMeshCacheBlendShapeListChanged" ("sculptMeshCacheUpdateBlendShapeLists "+$currContext+";"); scriptJob -permanent -parent cloneControls_COL -event "sculptMeshCacheCloneSourceChanged" ("sculptMeshCacheUpdateCloneSourceControls "+$currContext+";"); rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 unfreezeAll_ROW; text -label ""; string $cmd = "SculptMeshUnfreezeAll"; button -label (uiRes("m_sculptMeshCacheProperties.kUnfreezeAllButton")) -annotation (getRunTimeCommandAnnotation($cmd)) -width 80 -command ($cmd) unfreezeAll_BTN; setParent ..; rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0 invertFreeze_ROW; text -label ""; $cmd = "SculptMeshInvertFreeze"; button -label (uiRes("m_sculptMeshCacheProperties.kInvertFrozenButton")) -annotation (getRunTimeCommandAnnotation($cmd)) -width 80 -command ($cmd) invertFreeze_BTN; setParent ..; separator grabSeparator; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kGrabSilhouette")) -cc ( ("sculptMeshCacheCtx -e -grabSilhouette #1 " + $currContext) ) sculptMeshGrabSilhouette_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kFollowPath")) -cc ( ("sculptMeshCacheCtx -e -grabFollowPath #1 " + $currContext) ) sculptMeshFollowPath_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kConstrainToSurface")) -cc ( ("sculptMeshCacheCtx -e -constrainToSurface #1 " + $currContext) ) sculptMeshConstrainToSurface_CBG; separator steadyStrokeSeparator; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kUpdatePlane")) -annotation (uiRes("m_sculptMeshCacheProperties.kUpdatePlaneAnnotation")) -cc ( ("sculptMeshCacheCtx -e -updatePlane #1 " + $currContext) ) sculptMeshUpdatePlane_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kWholeStroke")) -annotation (uiRes("m_sculptMeshCacheProperties.kWholeStrokeAnnotation")) -cc ( ("sculptMeshCacheCtx -e -wholeStroke #1 " + $currContext) ) sculptMeshWholeStroke_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kUseStampDist")) -annotation (uiRes("m_sculptMeshCacheProperties.kUseSpacingAnnotation")) -cc ( ("sculptMeshCacheSetUseStampSpacing (\"" + $currContext + "\", #1);") ) sculptMeshUseStampSpacing_CBG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 1000 -cc ( ("sculptMeshCacheCtx -e -stampDistance #1 " + $currContext) ) sculptMeshStampDistance_FSG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100 -label (uiRes("m_sculptMeshCacheProperties.kBuildUpRate")) -annotation (uiRes("m_sculptMeshCacheProperties.kBuildUpRateAnnotation")) -cc ( ("sculptMeshCacheCtx -e -buildUpRate #1 " + $currContext) ) sculptMeshBuildUp_FSG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kSteadyStroke")) -annotation (uiRes("m_sculptMeshCacheProperties.kSteadyStrokeAnnotation")) -cc ( ("sculptMeshCacheCtx -e -uss #1 " + $currContext) ) useSteadyStroke_CBG; floatSliderGrp -field true -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kSteadyStrokeDistance")) -cc ( ("sculptMeshCacheCtx -e -ssd #1 " + $currContext) ) steadyStrokeDistance_ISG; frameLayout -label (uiRes("m_sculptMeshCacheProperties.kFalloffSection")) -labelVisible true -collapsable true -collapse true; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kFalloffType")) -cc (("sculptMeshCacheSetFalloffType(\"" + $currContext + "\");")) sculptMeshFalloffType_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kFalloffHybrid")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kFalloffSurface")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kFalloffVolume")); rowLayout -nc 5 -columnWidth 3 140; text -label (uiRes("m_sculptMeshCacheProperties.kFalloffCurve")); falloffCurve -w 150 -h 165 -cc("curveChanged( \"" + $currCmd + "\",\"" + $currContext + "\", \"#1\")") sculptFalloffCurve; setUITemplate -popTemplate; columnLayout; iconTextButton -width 23 -height 23 -image "makeBigger.png" -style "iconAndTextHorizontal" -command (("makeLargeCurveWidget(\"" + $currCmd + "\",\"" + $currContext + "\",\"" + $falloffName + "\");")); checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kSnapToGrid")) -cc (("snapToGridChanged(#1, \"" + $falloffName + "\")")) useSnapToGrid_CBG; button -label (uiRes("m_sculptMeshCacheProperties.kResetCurveButton")) -width 130 -command (("resetCurve( \"" + $currCmd + "\",\"" + $currContext + "\")")); button -label (uiRes("m_sculptMeshCacheProperties.kSaveCurveButton")) -width 130 -command (("saveCustomCurve(\"" + $currCmd + "\")")); setParent ..; setUITemplate -pushTemplate OptionsTemplate; setParent ..; rowLayout -nc 2; int $presetCellSize1 = 23; text -label (uiRes("m_sculptMeshCacheProperties.kFalloffCurvePreset")) falloffPresetsText; int $sz = size($gCurvePresets); gridLayout -numberOfColumns $sz -cellWidthHeight $presetCellSize1 $presetCellSize1 falloffProfilePresetsGrid; for($i = 0; $i < $sz; ++$i) { formLayout; falloffCurve -backgroundColor 0.51 0.51 0.51 -h 20 -w 20 -asString $gCurvePresets[$i] -cc ( ("curveChanged( \"" + $currCmd + "\",\"" + $currContext + "\", \"#1\")") ) -readOnly true; setParent ..; } setParent ..; setParent ..; rowLayout -nc 2; text -label (uiRes("m_sculptMeshCacheProperties.kFalloffCurveCustom")) falloffCustomText; gridLayout -numberOfColumns $gMaxCustomCurveSize -cellWidthHeight $presetCellSize1 $presetCellSize1 falloffProfileCustomGrid; for($i = 0 ; $i<$gMaxCustomCurveSize; $i++) { string $falloffCurveName = "customCurve" + $i; formLayout; falloffCurve -backgroundColor 0.51 0.51 0.51 -h 20 -w 20 -asString "" -readOnly true -customCurveWidget true -cc ( ("customCurveOnClick( \"" + $currCmd + "\",\"" + $currContext + "\", \"#1\"," + $i + ")") ) $falloffCurveName; setParent ..; } setParent ..; setParent ..; setParent ..; frameLayout -label (uiRes("m_sculptMeshCacheProperties.kStylusSection")) -labelVisible true -collapsable true -collapse true stylusFrameLayout; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kMinSize")) -cc ( ("sculptMeshCacheCtx -e -minSize #1 " + $currContext) ) sculptMeshMinSize_FSG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kMinStrength")) -cc ( ("sculptMeshCacheCtx -e -minStrength #1 " + $currContext) ) sculptMeshMinStrength_FSG; setParent ..; frameLayout -label (uiRes("m_sculptMeshCacheProperties.kStampSection")) -labelVisible true -collapsable true -collapse true stampFrameLayout; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kUseStamp")) -cc ( ("sculptMeshCacheSetUseStampImage (\"" + $currContext + "\", #1);") ) sculptMeshUseStamp_CBG; rowLayout -numberOfColumns 3 -columnWidth 1 135 -rowAttach 2 "top" 0; text -label (uiRes("m_sculptMeshCacheProperties.kStampImage")); iconTextButton -style "iconAndTextVertical" -width 96 -height 96 -scaleIcon -useAlpha 0 -doubleClickCommand ("sculptMeshCachePickStamp") stampFile_IMG; columnLayout; button -label (uiRes("m_sculptMeshCacheProperties.kImportButton")) -command ("sculptMeshCacheImportStamp") importStamp_BTN; button -label (uiRes("m_sculptMeshCacheProperties.kPickButton")) -command ("sculptMeshCachePickStamp") pickStamp_BTN; setParent ..; setParent ..; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kStampOrientToStroke")) -cc ( ("sculptMeshCacheCtx -e -stampOrientToStroke #1 " + $currContext) ) sculptMeshStampOrientToStroke_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kFlipHorizonatlly")) -cc ( ("sculptMeshCacheCtx -e -stampFlipX #1 " + $currContext) ) flipStampX_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kFlipVertically")) -cc ( ("sculptMeshCacheCtx -e -stampFlipY #1 " + $currContext) ) flipStampY_CBG; rowLayout -numberOfColumns 2 -columnWidth 1 132 -columnWidth 2 80 -rowAttach 2 "top" 0; text -label (uiRes("m_sculptMeshCacheProperties.kDummy")); button -label (uiRes("m_sculptMeshCacheProperties.kRotateStampButton")) -height 20 -width 80 -command ("sculptMeshCacheRotateStamp") rotateStamp_BTN; setParent ..; optionMenuGrp -label (uiRes("m_sculptMeshCacheProperties.kStampPlacement")) -cc (("sculptMeshCacheSetStampPlacement(\"" + $currContext + "\");")) sculptMeshStampPlacement_OMG; menuItem -label (uiRes("m_sculptMeshCacheProperties.kPlacementPath")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kPlacementCenter")); menuItem -label (uiRes("m_sculptMeshCacheProperties.kPlacementSide")); frameLayout -labelVisible false -collapsable false; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kStampRandomization")) -cc ( ("sculptMeshCacheCtx -e -stampRandomization #1 " + $currContext) ) sculptMeshStampRandomization_CBG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kStampRandomizeRotation")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizeRotation #1 " + $currContext) ) sculptMeshStampRandomizeRotation_FSG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kStampRandomizeScale")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizeScale #1 " + $currContext) ) sculptMeshStampRandomizeScale_FSG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kStampRandomizePosX")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizePosX #1 " + $currContext) ) sculptMeshStampRandomizePosX_FSG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kStampRandomizePosY")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizePosY #1 " + $currContext) ) sculptMeshStampRandomizePosY_FSG; floatSliderGrp -field true -pre 3 -min 0 -max 100 -fieldMaxValue 100000 -label (uiRes("m_sculptMeshCacheProperties.kStampRandomizeStrength")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizeStrength #1 " + $currContext) ) sculptMeshStampRandomizeStrength_FSG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kStampRandomizeFlipX")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizeFlipX #1 " + $currContext) ) sculptMeshStampRandomizeFlipX_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kStampRandomizeFlipY")) -cc ( ("sculptMeshCacheCtx -e -stampRandomizeFlipY #1 " + $currContext) ) sculptMeshStampRandomizeFlipY_CBG; setParent ..; setParent ..; frameLayout -label (uiRes("m_sculptMeshCacheProperties.kDisplaySection")) -labelVisible true -collapsable true -collapse true; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kOrientBrush")) -cc ( ("sculptMeshCacheCtx -e -orientToSurface #1 " + $currContext) ) sculptMeshOrient_CBG; checkBoxGrp -label1 (uiRes("m_sculptMeshCacheProperties.kShowFrozen")) -cc ( ("sculptMeshCacheCtx -e -displayFrozen #1 -displayMask #1 " + $currContext) ) sculptMeshShowFrozen_CBG; frameLayout -label (uiRes("m_sculptMeshCacheProperties.kWireframeDisplay")) -collapsable false; checkBoxGrp -label (uiRes("m_sculptMeshCacheProperties.kShowWireframe")) -cc ( ("sculptMeshCacheCtx -e -displayWireframe #1 " + $currContext) ) sculptMeshShowWireframe_CBG; floatSliderGrp -label (uiRes("m_sculptMeshCacheProperties.kWireframeAlpha")) -cc ( ("sculptMeshCacheCtx -e -wireframeAlpha #1 " + $currContext) ) -field true -minValue 0.1 -maxValue 1.0 sculptMeshWireframeAlpha_FSG; colorSliderGrp -label (uiRes("m_sculptMeshCacheProperties.kWireframeColor")) -cc ( "setSculptMeshCacheWireframeColor;" ) sculptMeshWireframeColor_CSG; setParent ..; setParent ..; setParent ..; setUITemplate -popTemplate; popupMenu -parent stampFile_IMG -button 3 stampImagePopupMenu; setParent -menu stampImagePopupMenu; menuItem -label (uiRes("m_sculptMeshCacheProperties.kViewImage")) -command ("sculptMeshCacheViewImage"); menuItem -label (uiRes("m_sculptMeshCacheProperties.kRefreshImage")) -command ("sculptMeshCacheRefreshImage"); menuItem -divider true; menuItem -label (uiRes("m_sculptMeshCacheProperties.kImportStamp")) -command ("sculptMeshCacheImportStamp"); menuItem -label (uiRes("m_sculptMeshCacheProperties.kPickStamp")) -command ("sculptMeshCachePickStamp"); menuItem -divider true; menuItem -label (uiRes("m_sculptMeshCacheProperties.kClearStamp")) -command ("sculptMeshCacheClearStamp"); setParent ..; } global proc saveCustomCurve(string $currCmd) { global int $gCurrCustomIndex; int $customInsertSlot = findCustomInsertSlot($currCmd); string $ccName = "customCurve" + $customInsertSlot; string $cFalloffCurve = `falloffCurve -q -asString sculptFalloffCurve`; updateCustomOptionVar($customInsertSlot,$cFalloffCurve); falloffCurve -e -asString `falloffCurve -q -asString sculptFalloffCurve` $ccName; $gCurrCustomIndex = -1; }