// =========================================================================== // 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. // =========================================================================== // // // Creation Date: June 3, 1997 // // Procedure Name: // AEnewMessage // // Description Name; // Creates a textFieldButtonGrp for a TattributeMessage for // the attribute editor // If the node is mental ray shader, // creates a different kinds of controls. // // Input Value: // plug name, attribute name, and changedCommand // // Output Value: // Returns the name of the newly created textFieldButtonGrp // global proc string AEnewMessage(string $plugName, string $attrName, string $changedCommand ) { string $buffer[]; tokenize($plugName, ".", $buffer); string $node = (size($buffer) > 0) ? $buffer[0] : ""; // special control for mental ray node if( isClassified($node, "rendernode/mentalray") ) { return AEmentalrayNewMessage($plugName, $attrName, $changedCommand); } string $createdControl = `textFieldButtonGrp -l $attrName`; string $connections[] = `listConnections $plugName`; textFieldButtonGrp -e -tx $connections[0] $createdControl; if ($connections[0] != "") { textFieldButtonGrp -e -eb true -bl " > " -bc ("showEditor "+$connections[0]) $createdControl; } else { textFieldButtonGrp -e -eb false -bc "" $createdControl; } // connect the control string $cmd = "AEupdateMessage \""+$createdControl+"\" \""+$plugName+"\""; scriptJob -p $createdControl -rp -ac $plugName $cmd; // only make the text field editable if there is a changedCommand // to handle it if ($changedCommand != "") { $cmd = $changedCommand+" \""+$node+"\""; textFieldButtonGrp -e -ed true -cc $cmd $createdControl; } else { textFieldGrp -e -ed false $createdControl; } return $createdControl; }