// =========================================================================== // 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: // doCreateBindingSet // // Description: // Create or update a template binding set for a container // // Input Arguments: // $version: The version of this option box. Used to know how to // interpret the $args array. // // $args: // Version 1: // $args[0] = $updateMode (updating existing bindingSet? 0 = no, 1 = yes) // $args[1] = $updateForce (update replaces existing entries? 0 = no, 1 = yes) // global proc doCreateBindingSet( int $version, string $args[] ) // // { global string $gPinnedContainerForBindingSetCmd; int $updateMode = $args[0]; int $updateForce = $args[1]; // If the user invokes the operation from the // "Asset Editor", this global variable will be set. Otherwise, // use the selected container. // string $container = $gPinnedContainerForBindingSetCmd; // Reset global $gPinnedContainerForBindingSetCmd = ""; if ($container == "") { string $sel[] = `ls -sl -containers`; if (size($sel) > 0) { $container = $sel[0]; } else { $sel = `ls -sl`; $container = `container -q -findContainer $sel`; if (size($container) == 0) { error((uiRes("m_doCreateBindingSet.kMustSelectContainer"))); } } } // Perform the autobind using the passed arguments containerCreateBindingSet($container, "", $updateMode, $updateForce); }