// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // AEplace3dTextureTemplate // // Description Name; // Creates the attribute editor controls for the place3dTexture Node // // Input Value: // nodeName // // Output Value: // None // global proc AEplace3dTextureTemplate ( string $nodeName ) { AEswatchDisplay $nodeName; editorTemplate -beginScrollLayout; // include/call base class/node attributes AEtransformMain $nodeName; editorTemplate -beginLayout (uiRes("m_AEplace3dTextureTemplate.kThreeDTexturePlacementAttr")) -collapse 0; editorTemplate -callCustom "PSmakePlacement" "PSreplacePlacement" ""; editorTemplate -endLayout; AEtransformNoScroll $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; } global proc PSmakePlacement (string $pName) { string $realName[]; tokenize ($pName, ".", $realName); setUITemplate -pst attributeEditorTemplate; rowLayout -nc 2; text -label ""; button -label (uiRes("m_AEplace3dTextureTemplate.kInteractivePlacement")) -c ("PSinvokePlacement "+ $realName[0]) placButton; setParent ..; rowLayout -nc 2; text -label ""; button -label (uiRes("m_AEplace3dTextureTemplate.kFitToGroupBBox")) -c ("PSfitPlacementToGroup "+ $realName[0]) fitButton; setParent ..; setUITemplate -ppt; } global proc PSreplacePlacement (string $pName) { string $realName[]; tokenize ($pName, ".", $realName); button -e -c ("PSinvokePlacement "+ $realName[0]) placButton; button -e -c ("PSfitPlacementToGroup "+ $realName[0]) fitButton; } // // Procedure Name: // PSInvokePlacement // global proc PSinvokePlacement (string $pName) { AEmakePlacementActive( $pName ); setToolTo shadingProjectionContext; } // // Procedure Name: // PSfitPlacementToGroup // global proc PSfitPlacementToGroup (string $pName) { string $ctx = `currentCtx`; if( $ctx != "shadingProjectionContext" ) PSinvokePlacement( $pName ); else AEmakePlacementActive( $pName ); projectionManip -fb; } // // Procedure Name: // AEmakePlacementActive // global proc AEmakePlacementActive( string $pName ) { // Select it in the scene graph. // select -r $pName; }