// =========================================================================== // 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. // =========================================================================== // // // Creation Date: 17 feb 1999 // // Procedure Name: // resetBrush // // Description: // This procedure selects those brushes whose name contains // the user supplied string. // // Input Arguments: // None. // // Return Value: // None. // global proc selectBrushesWhoseNameContains() { global string $gTmpPaintPresetLabelField; if( !`window -exists findNamedBrushWin` ) { window -title (uiRes("m_selectBrushesWhoseNameContains.kTitleSelectBrush")) -iconName (uiRes("m_selectBrushesWhoseNameContains.kContains")) -minimizeButton false -maximizeButton false -sizeable false -height 100 findNamedBrushWin; formLayout -nd 100 sbwncForm; $gTmpPaintPresetLabelField = `textFieldGrp -label (uiRes("m_selectBrushesWhoseNameContains.kNameFragement")) tfgg2`; button -label (uiRes("m_selectBrushesWhoseNameContains.kButtonSelectBrushes")) -c "findNamedBrush `textFieldGrp -q -text $gTmpPaintPresetLabelField`" -width 120 -height 26 findNamedBrushButton; button -label (uiRes("m_selectBrushesWhoseNameContains.kButtonSelectStrokes")) -c "findNamedStroke `textFieldGrp -q -text $gTmpPaintPresetLabelField`" -width 120 -height 26 findNamedStrokeButton; button -label (uiRes("m_selectBrushesWhoseNameContains.kButtonClose")) -c "deleteUI -window findNamedBrushWin" -width 120 -height 26 findBrushCloseButton; formLayout -e -af $gTmpPaintPresetLabelField "right" 5 -af $gTmpPaintPresetLabelField "left" 0 -af $gTmpPaintPresetLabelField "top" 5 -an $gTmpPaintPresetLabelField "bottom" -af findNamedBrushButton "top" 33 -af findNamedBrushButton "left" 7 -af findNamedBrushButton "bottom" 5 -an findNamedBrushButton "right" -af findNamedStrokeButton "top" 33 -ac findNamedStrokeButton "left" 7 findNamedBrushButton -af findNamedStrokeButton "bottom" 5 -an findNamedStrokeButton "right" -af findBrushCloseButton "top" 33 -ac findBrushCloseButton "left" 7 findNamedStrokeButton -af findBrushCloseButton "bottom" 5 -af findBrushCloseButton "right" 7 sbwncForm; } showWindow findNamedBrushWin; } global proc findNamedBrush( string $name ) { string $brushes[] = `ls -type brush`; string $brush; // Clear the selection list. select -cl; for ($brush in $brushes) { if (gmatch ($brush, ("*"+$name+"*"))) { select -add $brush; } } } global proc findNamedStroke( string $name ) { string $strokes[] = `ls -type stroke`; string $stroke; string $testName = tolower($name); // Clear the selection list. select -cl; for ($stroke in $strokes) { string $testStroke = tolower($stroke); if (gmatch ($testStroke, ("*"+$testName+"*"))) { select -add $stroke; } } }