// =========================================================================== // 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. // =========================================================================== // // provided at the time of installation or download, or which otherwise accompanies // // Procedures specifying the UI layout for ilrLuaNode // in Maya's Attribute Editor // global proc AEassignScriptFileCB(string $fileAttr, string $filename, string $fileType) { setAttr $fileAttr -type "string" $filename; } global proc AEscriptFileBrowser(string $cmd) { string $workspace = `workspace -q -fn`; setWorkingDirectory $workspace "image" "turtle"; fileBrowser($cmd, "Open", "lua", 0); } global proc AEscriptFileNew(string $fileAttr) { setUITemplate -pst attributeEditorTemplate; rowLayout -nc 3 scriptFileLayout; text -l "Script File"; textField scriptFileField; symbolButton -image "navButtonBrowse.xpm" browser; setParent ..; setUITemplate -ppt; AEscriptFileReplace $fileAttr; } global proc AEscriptFileReplace(string $fileAttr) { connectControl -fileName scriptFileField $fileAttr; string $command = "AEassignScriptFileCB "+" "+$fileAttr; button -e -c ("AEscriptFileBrowser \"" + $command + "\"" ) browser; } global proc AEilrLuaNodeTemplate(string $node) { editorTemplate -beginScrollLayout; editorTemplate -beginLayout "LUA Attributes" -collapse false; editorTemplate -callCustom "AEscriptFileNew" "AEscriptFileReplace" "file"; editorTemplate -label "Input 1" -adc "input1"; editorTemplate -label "Input 2" -adc "input2"; editorTemplate -label "Input 3" -adc "input3"; editorTemplate -label "Input 4" -adc "input4"; editorTemplate -label "Input 5" -adc "input5"; editorTemplate -endLayout; // include/call base class/node attributes AEdependNodeTemplate $node; // suppressed attributes editorTemplate -s "version"; editorTemplate -addExtraControls; editorTemplate -endScrollLayout; }