int CSkeletonCandidate::GetParentSelectedId(int boneCandidateId)
{
	// check if the bone candidate id is valid
	if((boneCandidateId < 0) || (boneCandidateId >= (int)m_vectorBoneCandidate.size())) return -1;

	// get the bone candidate
	CBoneCandidate *pBoneCandidate = m_vectorBoneCandidate[boneCandidateId];

	// get the parent id
	int parentId = pBoneCandidate->GetParentId();

	// loop until we found the selected parent
	while(parentId != -1)
	{
		// get the parent bone candidate
		pBoneCandidate = m_vectorBoneCandidate[parentId];

		// check id we found a selected parent
		if(pBoneCandidate->IsSelected()) return pBoneCandidate->GetSelectedId();

		// get the parent id
		parentId = pBoneCandidate->GetParentId();
	}

	// bone candidate is at root within selected ones
	return -1;
}
void CSkeletonCandidate::GetTranslationAndRotation(int boneCandidateId, float time, CalVector& translation, CalQuaternion& rotation)
{
	// clear the translation and the rotation
	translation.clear();
	rotation.clear();

	// check if the bone candidate id is valid
	if((boneCandidateId < 0) || (boneCandidateId >= (int)m_vectorBoneCandidate.size())) return;

	// get the bone candidate
	CBoneCandidate *pBoneCandidate = m_vectorBoneCandidate[boneCandidateId];

	// get the node of the bone candidate
	CBaseNode *pNode = pBoneCandidate->GetNode();

	// get the parent id
	int parentId = pBoneCandidate->GetParentId();

	// get the node of the parent bone candidate
	CBaseNode *pParentNode = 0;
	if(parentId != -1)
        {
		pParentNode = m_vectorBoneCandidate[parentId]->GetNode();
	}

  // get the translation and rotation of the node
	theExporter.GetInterface()->GetTranslationAndRotation(pNode, pParentNode, time, translation, rotation);
}