// =========================================================================== // 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: November, 1999 // // // Procedure Name: // blendGraphEdit // // Description: // Creates a graph editor for the given blend curve. // // // Input Arguments: // $blendName - The name of the curve to show in the editor. // $updateOnly - Whether or not the editor should only update // its selection if the editor already exists. // // Return Value: // None. // global proc blendGraphEdit(string $blendName, int $updateOnly) { string $win = ($blendName + "GraphWindow"); string $form = ($blendName + "GraphForm"); string $ed = ($blendName + "GraphEditor"); string $conn = ($blendName + "FromClipEditor"); string $title = ("Blend: " + $blendName); // If this window already exists, just show it. Otherwise, // return if a window should not be created. if (`window -exists $win`) { if ($updateOnly) selectionConnection -e -select $blendName $conn; else showWindow $win; return; } else if ($updateOnly) return; // Create a selection connection which is used to pass the curve // to the graph editor. if (!`selectionConnection -exists $conn`) selectionConnection $conn; // Create a graph editor inside a form. window -title $title $win; formLayout $form; animCurveEditor -mainListConnection $conn $ed; formLayout -edit -attachForm $ed "left" 0 -attachForm $ed "right" 0 -attachForm $ed "bottom" 0 -attachForm $ed "top" 0 $form; showWindow $win; // Give the blend curve to the editor via the selection connection. selectionConnection -e -select $blendName $conn; }