// Copyright (C) 1997-2004 Alias Systems Corp.
// 
// The information in this file is provided for the exclusive use of the
// licensees of Alias.  Such users have the right to use, modify,
// and incorporate this code into other products for purposes authorized
// by the Alias license agreement, without fee.
// 
// ALIAS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
// EVENT SHALL ALIAS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

// *****************************************************************************
//
// its licensors ("Alias").  All rights reserved.  These coded instructions,
// statements, computer programs, and/or related material (collectively, the
// "Material") contain unpublished information proprietary to Alias, which is
// protected by Canadian and US federal copyright law and by international
// treaties.  This Material may not be disclosed to third parties, or be
// copied or duplicated, in whole or in part, without the prior written
// consent of Alias.  ALIAS HEREBY DISCLAIMS ALL WARRANTIES RELATING TO THE
// MATERIAL, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR IMPLIED
// WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.  IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES
// WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY,
// ARISING OUT OF OR RELATED TO THE ACCESS TO, USE OF, OR RELIANCE UPON THE
// MATERIAL.
//
// *****************************************************************************

global proc ikSpringSolver()
//
//	Description:
//		This mel procedure creates an ikSpringSolver node.
//		Additionally, it sets up the callbacks for the solver
//		to appear to remain persistent across (File->New) and
//		(File->Open) operations. After a (File->New) or
//		(File->Open), the callbacks recreate the ikSpringSolver
//		node.
//
//	Note:
//		This method will automatically load the ikSpringSolver plugin
//		necessary.
//
{
	// Check to see if the plug-in is loaded
	//
	if( !`pluginInfo -q -l "ikSpringSolver"` )
	{
		loadPlugin "ikSpringSolver";
	}

	// Now create the node and register the callbacks
	//
	if( !`objExists ikSpringSolver` )
	{
		// Turn off undo
		//
		undoInfo -swf false;

		// We do not wish to disrupt the selection list, so
		// record the active list and restore it after node creation.
		//
		string $sel[] = `ls -sl`;
		eval( "createNode -s -n ikSpringSolver ikSpringSolver" );
		eval( "ikSpringSolverCallbacks" );
		select -r $sel;

		// Restore undo
		//
		undoInfo -swf true;
	}

	// Finally inform solver related UI that the list of
	// available solvers has been modified.
	//
	ikUpdateSolverUI;
}

