// =========================================================================== // 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: 2001 // // // // // // applyAttrPreset node presetName blend // // // None. // // // Applies the specified preset to the node using the blend amount. // // // None. // // // // replace settings for nurbsSphere1 with tformPreset2 settings // applyAttrPreset nurbSphere1 tformPreset2 1; // // blend in 50% the settings of tformPreset2 into nurbsSphere1 // applyAttrPreset nurbSphere1 tformPreset2 0.5; // // global string $gAEAttrPresetCurrentTarget = ""; global float $gAEAttrPresetBlend = 1; global proc applyAttrPreset( string $node, string $presetName, float $blend ) { global string $gAEAttrPresetCurrentTarget; global float $gAEAttrPresetBlend; string $ntype = `nodeType $node`; string $ppath = `internalVar -userPrefDir`; if( size( match( ".mel", $presetName ) ) > 0){ // assume a full path passed in if mel extension(factory presets) $ppath = $presetName; } else { $ppath = substitute( "prefs", $ppath, "presets/attrPresets"); $ppath = $ppath + $ntype + "/" + $presetName + ".mel"; } if( `file -q -ex $ppath` ){ $gAEAttrPresetCurrentTarget = $node; $gAEAttrPresetBlend = $blend; eval ( "source \"" + $ppath + "\"" ); // update the attribute editor Notes area explicitly // updateAENotes( $node, "notes" ); } else { string $msgFormat = (uiRes("m_applyAttrPreset.kNoPresetForNode")); warning( `format -s $presetName -s $ntype $msgFormat` ); } }