// =========================================================================== // 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: 18 April 2001 // // Procedure Name: // art3dPaintStoreBrushSettings // // Description: // Store the current paint effects brush settings into a our backup node // so that we can restore them later. We do this so that we can remember // the last paint effects brush used for paint, smear, or blur. // // Input Arguments: // None. // // Return Value: // None. // global proc art3dPaintStoreBrushSettings() { // Variables containing names of nodes where we store the saved brush // settings // global string $gArt3dPaintLastPaintBrush; global string $gArt3dPaintLastBlurBrush; global string $gArt3dPaintLastSmearBrush; // Names that the default brush had when the saved settings were in place // (e.g. fire1) // global string $gArt3dPaintLastPaintBrushName; global string $gArt3dPaintLastBlurBrushName; global string $gArt3dPaintLastSmearBrushName; // Figure out what type of a brush is currently being used (paint, smear, // or blur) // string $defaultBrush = getDefaultBrush(); int $mode = getAttr( $defaultBrush + ".brushType" ); switch( $mode ) { case 0: // Paint case 4: // ThinLine case 5: // Mesh // Make sure that the brush node exists that we are going to store to // art3dPaintCheckDefaultBrush( "Paint" ); // Remember the name of the current brush // $gArt3dPaintLastPaintBrushName = $defaultBrush; // Copy the node's attributes to our save node // copyNode $defaultBrush $gArt3dPaintLastPaintBrush; break; case 1: // Smear // Make sure that the brush node exists that we are going to store to // art3dPaintCheckDefaultBrush( "Smear" ); // Remember the name of the current brush // $gArt3dPaintLastSmearBrushName = $defaultBrush; // Copy the node's attributes to our save node // copyNode $defaultBrush $gArt3dPaintLastSmearBrush; break; case 2: // Blur // Make sure that the brush node exists that we are going to store to // art3dPaintCheckDefaultBrush( "Blur" ); // Remember the name of the current brush // $gArt3dPaintLastBlurBrushName = $defaultBrush; // Copy the node's attributes to our save node // copyNode $defaultBrush $gArt3dPaintLastBlurBrush; break; default: error ( uiRes("m_art3dPaintRestoreBrushSettings.kCannotSavePFXBrush") ); return; } }