// =========================================================================== // 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: // AEextrudeTemplate // // Description Name; // Creates the attribute editor controls for the extrude node // // Input Value: // nodeName // // Output Value: // None // global proc extrudeTypeControls( string $nodeName ) { string $typeAttrName = $nodeName + ".extrudeType"; int $typeValue = `getAttr $typeAttrName`; if ( $typeValue == 0 ) { // distance extrude type editorTemplate -dimControl $nodeName "useProfileNormal" false; editorTemplate -dimControl $nodeName "fixedPath" true; editorTemplate -dimControl $nodeName "length" false; editorTemplate -dimControl $nodeName "degreeAlongLength" false; // for direction dimming useProfileNormalControls( $nodeName ); } else if ( $typeValue == 1 ) { // flat extrude type editorTemplate -dimControl $nodeName "useProfileNormal" true; editorTemplate -dimControl $nodeName "fixedPath" false; editorTemplate -dimControl $nodeName "direction" true; editorTemplate -dimControl $nodeName "length" true; editorTemplate -dimControl $nodeName "degreeAlongLength" true; } else { // tube extrude type editorTemplate -dimControl $nodeName "useProfileNormal" false; editorTemplate -dimControl $nodeName "fixedPath" false; editorTemplate -dimControl $nodeName "direction" true; editorTemplate -dimControl $nodeName "length" true; editorTemplate -dimControl $nodeName "degreeAlongLength" true; // for direction dimming useProfileNormalControls( $nodeName ); } // for pivot dimming useComponentPivotControls( $nodeName ); } global proc useProfileNormalControls( string $nodeName ) { int $useNormalValue = 1; string $needUseDir = $nodeName + ".extrudeType"; int $useDir = `getAttr $needUseDir`; if( 0 == $useDir ) { string $useNormalAttrName = $nodeName + ".useProfileNormal"; $useNormalValue = `getAttr $useNormalAttrName`; } if ( $useNormalValue == 0 ) { // need to specify a direction editorTemplate -dimControl $nodeName "direction" false; } else { // no need to specify a direction since using profile normal editorTemplate -dimControl $nodeName "direction" true; } } global proc useComponentPivotControls( string $nodeName ) { string $usePivotAttrName = $nodeName + ".useComponentPivot"; int $usePivotValue = `getAttr $usePivotAttrName`; if ( $usePivotValue == 1 ) { // can't use specified pivot (uses start of path instead) editorTemplate -dimControl $nodeName "pivot" false; } else { // can use specified pivot editorTemplate -dimControl $nodeName "pivot" true; } } global proc AEextrudeTemplate( string $nodeName ) { int $advMod = `licenseCheck -m edit -typ model`; string $profileCurve = (uiRes("m_AEextrudeTemplate.kProfileCurve")); string $pathCurve = (uiRes("m_AEextrudeTemplate.kPathCurve")); editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEextrudeTemplate.kExtrudeHistory")) -collapse false; editorTemplate -callCustom ("AEinputNew \""+$profileCurve+"\"") ("AEinputReplace \""+$profileCurve+"\"") "profile"; editorTemplate -callCustom ("AEinputNew \""+$pathCurve+"\"") ("AEinputReplace \""+$pathCurve+"\"") "path"; editorTemplate -addControl "extrudeType" "extrudeTypeControls"; editorTemplate -beginNoOptimize; editorTemplate -addControl "useComponentPivot" "useComponentPivotControls"; editorTemplate -addControl "useProfileNormal" "useProfileNormalControls"; editorTemplate -endNoOptimize; editorTemplate -addControl "fixedPath"; editorTemplate -addControl "direction"; editorTemplate -addControl "length"; editorTemplate -addControl "pivot"; if( $advMod ) { editorTemplate -addControl "rotation"; editorTemplate -addControl "scale"; } editorTemplate -addControl "degreeAlongLength"; editorTemplate -endLayout; // include/call base class/node attributes AEabstractBaseCreateTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; if( ! $advMod ) { editorTemplate -suppress "rotation"; editorTemplate -suppress "scale"; } }