//----------------------------------------------------------------------------//
// Create a skeleton candidate instance from the exporter interface           //
//----------------------------------------------------------------------------//
bool CSkeletonCandidate::CreateFromInterfaceFromMaxScriptCall()
{
	int nodeId;

	// clear current content
	Clear();

	CMaxInterface* imax	= static_cast<CMaxInterface*>(theExporter.GetInterface());

	// loop through all nodes in memorized array (that has been passed by Maxscript)
	const int NumNodes = imax->GetNumNodesInTabNodeFromMaxscript();
	for(nodeId = 0; nodeId < NumNodes; nodeId++)
	{
		CBaseNode* basenode = imax->GetNodeFromMaxscriptArray(nodeId);
		if (!basenode) return false;

		// recursively add the node to the skeleton candidate
		if(!AddNode(basenode, -1)) return false;
	}

	return true;
}