// =========================================================================== // 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 AEmakeIllustratorCurvesTemplate( string $nodeName ) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout (uiRes("m_AEmakeIllustratorCurvesTemplate.kFileAttributes")) -collapse 0; editorTemplate -callCustom "AEaiFileNameNew" "AEaiFileNameReplace" "illustratorFilename"; editorTemplate -callCustom "AEaiFileNameReload" "AEaiFileNameReloadReplace" "illustratorFilename"; editorTemplate -addControl "scaleFactor"; editorTemplate -addControl "tolerance"; editorTemplate -suppress "reload"; editorTemplate -endLayout; AEdependNodeTemplate $nodeName; } global proc AEaiFileNameNew (string $fileAttribute) { setUITemplate -pst attributeEditorTemplate; rowLayout -nc 3 aiFileNameLayout; text -label (uiRes("m_AEmakeIllustratorCurvesTemplate.kFileName")) ; textField aiFileNameField; symbolButton -image "navButtonBrowse.png" browserBtn; setParent ..; setUITemplate -ppt; AEaiFileNameReplace $fileAttribute; } global proc AEaiFileNameReplace(string $fileAttribute) { connectControl -fileName aiFileNameField $fileAttribute; string $command = "AEassignAIfilenameCB "+$fileAttribute; symbolButton -e -c ("illustratorCurvesFileBrowser \"" + $command + "\"") browserBtn; } global proc AEaiFileNameReload(string $fileAttribute) { setUITemplate -pst attributeEditorTemplate; rowLayout -nc 3 -cl3 "center" "center" "center" ; text -label ""; button -label (uiRes("m_AEmakeIllustratorCurvesTemplate.kReload")) reloadFileButton; text -label ""; setParent ..; setUITemplate -ppt; AEaiFileNameReloadReplace $fileAttribute; } global proc AEaiFileNameReloadReplace(string $fileAttribute) { // To force reload the same Adobe(R) Illustrator(R) file... // string $forceReloadCmd = "setAttr " + `plugNode $fileAttribute` + ".reload 1"; button -e -c ($forceReloadCmd) reloadFileButton; } global proc illustratorCurvesFileBrowser(string $command) { string $open = (uiRes("m_AEmakeIllustratorCurvesTemplate.kOpen")); fileBrowser($command, $open, "Adobe(R) Illustrator(R)", 0); } global proc AEassignAIfilenameCB( string $fileAttribute, string $filename, string $fileType ) { setAttr $fileAttribute -type "string" $filename; string $currentDir = `workspace -q -dir`; retainWorkingDirectory ($currentDir); }