diff options
Diffstat (limited to 'scripts/shaveCursorCtxCommonValues.mel')
| -rw-r--r-- | scripts/shaveCursorCtxCommonValues.mel | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/shaveCursorCtxCommonValues.mel b/scripts/shaveCursorCtxCommonValues.mel new file mode 100644 index 0000000..9e3cba5 --- /dev/null +++ b/scripts/shaveCursorCtxCommonValues.mel @@ -0,0 +1,49 @@ +// Shave and a Haircut +// (c) 2019 Epic Games +// US Patent 6720962 + +global string $shaveCursorCtxCommonValues_fileVersion = "$Revision$"; + + +// +// This is a common values script for all shaveCursorCtx-based tools. +// +global proc shaveCursorCtxCommonValues(string $toolName) +{ + toolPropertySetCommon($toolName, "", ""); + shaveCursorCtx_updateCommonPropertySheet(); + toolPropertySelect shaveCursor; +} + + +global proc shaveCursorCtx_updateCommonPropertySheet() +{ + string $parent = (`toolPropertyWindow -q -location` + "|shaveCursor"); + + if (`layout -q -exists $parent`) + { + setParent $parent; + + string $ctx = `currentCtx`; + string $class = `contextInfo -q -c $ctx`; + string $ctxCmd = $class + "Ctx"; + + if (`floatSliderGrp -exists shaveCursorSize`) + { + float $size = eval($ctxCmd + " -q -brushSize " + $ctx); + floatSliderGrp -e -v $size shaveCursorSize; + } + + if (`floatSliderGrp -exists shaveCursorStren`) + { + float $s = eval($ctxCmd + " -q -brushStren " + $ctx); + floatSliderGrp -e -v $s shaveCursorStren; + } + + if (`checkBoxGrp -exists shaveCursorEnableFalloff`) + { + int $enable = eval($ctxCmd + " -q -enableFalloff " + $ctx); + checkBoxGrp -e -v1 $enable shaveCursorEnableFalloff; + } + } +} |