// =========================================================================== // 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: // AEmakeTextCurvesTemplate // // Description Name; // Creates the attribute editor controls for the makeTextCurves node // // Input Value: // nodeName // // Output Value: // None // global proc AEmakeTextCurvesTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEmakeTextCurvesTemplate.kTextCurvesHistory")) -collapse 0; editorTemplate -addControl "text"; editorTemplate -callCustom "AEmakeTextCurvesNew" "AEmakeTextCurvesReplace" "font"; editorTemplate -endLayout; // include/call base class/node attributes AEabstractBaseCreateTemplate $nodeName; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; } global proc AEmakeTextCurvesNew( string $inputFont ) { setUITemplate -pst attributeEditorTemplate; string $buffer[]; tokenize($inputFont, ".", $buffer); string $attFont = $buffer[1]; columnLayout ($attFont + "Column"); // create the fields rowLayout -cat 3 left 0 -nc 3 fontRowTotalLayout; string $parent = `setParent -q`; // the font text field will not be editable by the user - the // string will come from the popup menu // text -label (uiRes("m_AEmakeTextCurvesTemplate.kFont")); textField -ed false fontField; symbolButton -image "pickMenuIcon.png" fontMenuIconBtn; setParent ..; popupMenu -b 1 -p fontMenuIconBtn -pmc ("createFontPopup " + "-scalable " + " resetFontAttr " + $inputFont + " " + $parent) fontPopupMenu; setParent ..; setUITemplate -ppt; // set up initial values of fields AEmakeTextCurvesReplace( $inputFont ); } global proc AEmakeTextCurvesReplace( string $inputFont ) { // initialize field with font string string $fontString = `getAttr $inputFont`; string $tokens[]; tokenize $fontString "|" $tokens; textField -e -text $tokens[0] fontField; string $parent = `setParent -q`; popupMenu -e -pmc ("createFontPopup " + "-scalable " + " resetFontAttr " + $inputFont + " " + $parent) fontPopupMenu; } global proc resetFontAttr(string $inputFont, string $parent, string $fontName) { // set font field with new text string setParent $parent; optionVar -stringValue textCurvesFont $fontName; string $tokens[]; tokenize $fontName "|" $tokens; textField -e -text $tokens[0] fontField; // set attribute with new font setAttr -type "string" $inputFont $fontName; }