// =========================================================================== // 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 MASHsetUpCachingUI (string $nodeName) { if(`window -q -ex mashCache`) deleteUI mashCache; // check if window is already open & delete it window -t "MASH Cache Creator" -sizeable 1 -tlb 0 mashCache; columnLayout -cat "left" 50 -w 400 -h 180 coll ; separator -w 476 -h 10 -hr 1 -st "single"; separator -w 476 -h 5-hr 1 -st "none"; checkBoxGrp -numberOfCheckBoxes 3 -label (getPluginResource("MASH", "kTransform")) -labelArray3 (getPluginResource("MASH", "kPos")) (getPluginResource("MASH", "kRot")) (getPluginResource("MASH", "kScale")) -v1 1 mCacheTransCbox; checkBoxGrp -numberOfCheckBoxes 2 -label (getPluginResource("MASH", "kUtility")) -labelArray2 (getPluginResource("MASH", "kID")) (getPluginResource("MASH", "kVisibility")) mCacheUtilsCbox; separator -w 476 -h 10 -hr 1 -st "single"; separator -w 476 -h 5-hr 1 -st "none"; float $minTime = `playbackOptions -q -minTime`; float $maxTime = `playbackOptions -q -maxTime`; intFieldGrp -numberOfFields 2 -label (getPluginResource("MASH", "kStart")) -extraLabel (getPluginResource("MASH", "kEnd")) -value1 $minTime -value2 $maxTime mashCacheSEFrame; separator -w 476 -h 10 -hr 1 -st "single"; separator -w 476 -h 5-hr 1 -st "none"; string $command = ("import MASH.singleChannelCache as scc; reload(scc); cacher=scc.SimpleCache('"+$nodeName+"'); cacher.createCaches()"); button -w 476 -h 30 -label (getPluginResource("MASH", "kCreateCaches")) -command ("python(\""+$command+"\")"); //button -w 476 -h 30 -label (getPluginResource("MASH", "kCreateCaches")) -command ("createMashCaches(\""+$nodeName+"\")"); separator -w 476 -h 5-hr 1 -st "none"; button -w 476 -h 30 -label (getPluginResource("MASH", "kDeleteCaches")) -command ("binMashCaches(\""+$nodeName+"\")"); showWindow mashCache; window -e -w 576-h 180 mashCache; } //DISCONNECT CACHES global proc binMashCaches (string $nodeName) { string $waiter[]; tokenize($nodeName, ".", $waiter); if (size($waiter) == 0) { MASHinViewMessage((getPluginResource("MASH", "kPleaseTryAgain")), "Error"); } int $posEnable = `checkBoxGrp -q -v1 mCacheTransCbox`; int $rotEnable = `checkBoxGrp -q -v2 mCacheTransCbox`; int $scaleEnable = `checkBoxGrp -q -v3 mCacheTransCbox`; int $idEnable = `checkBoxGrp -q -v1 mCacheUtilsCbox`; int $visEnable = `checkBoxGrp -q -v2 mCacheUtilsCbox`; //POSITION if ($posEnable == 1) { string $source = `connectionInfo -sfd ($waiter[0]+".cacheInArrayPP")`; if (size($source) > 0) { disconnectAttr $source ($waiter[0]+".cacheInArrayPP"); } setAttr ($waiter[0]+".enablePosCache") 0; } //ROTATION if ($rotEnable == 1) { string $source = `connectionInfo -sfd ($waiter[0]+".cacheRotationPP")`; if (size($source) > 0) { disconnectAttr $source ($waiter[0]+".cacheRotationPP"); } setAttr ($waiter[0]+".enableRotCache") 0; } //SCALE if ($scaleEnable == 1) { string $source = `connectionInfo -sfd ($waiter[0]+".cacheScalePP")`; if (size($source) > 0) { disconnectAttr $source ($waiter[0]+".cacheScalePP"); } setAttr ($waiter[0]+".enableScaleCache") 0; } //ID if ($idEnable == 1) { string $source = `connectionInfo -sfd ($waiter[0]+".cacheIdPP")`; if (size($source) > 0) { disconnectAttr $source ($waiter[0]+".cacheIdPP"); } setAttr ($waiter[0]+".enableIdCache") 0; } //VISIBILITY if ($visEnable == 1) { string $source = `connectionInfo -sfd ($waiter[0]+".cacheVisibilityPP")`; if (size($source) > 0) { disconnectAttr $source ($waiter[0]+".cacheVisibilityPP"); } setAttr ($waiter[0]+".enableVisCache") 0; } updateAE $waiter[0]; }