// =========================================================================== // 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 brushStartSetup( string $brushNode, int $persp ) { string $bscale = $brushNode + ".globalScale"; float $val = getAttr( $bscale ); if( $persp ) { int $sW = getAttr($brushNode + ".screenspaceWidth"); $persp = !$sW; } float $scalefac; if( $persp ) { $scalefac = getAttr( "strokeGlobals.sceneScale" ); } else { $scalefac = getAttr( "strokeGlobals.canvasScale" ); } int $forceRealLights = getAttr( "strokeGlobals.forceRealLights" ); int $forceDepth = getAttr( "strokeGlobals.forceDepth" ); if( $scalefac < .00001 ) { $scalefac = .00001; } setAttr( $bscale, $val * $scalefac ); if( $forceRealLights ) { setAttr( $brushNode + ".realLights", 1 ); } if( $forceDepth ) { setAttr( $brushNode + ".depth", 1 ); } }