コード例 #1
0
void Model::FindMeshes( KFbxNode *root ) {
	if( root ) {
		for(int i = 0; i < root->GetChildCount(); i++) {
			KFbxNode *pood = root->GetChild(i);
			int ac = pood->GetNodeAttributeCount();
			for( int j = 0; j < ac; j++ ) {
				KFbxNodeAttribute* poody = pood->GetNodeAttributeByIndex(j);
				if( poody->GetAttributeType() == KFbxNodeAttribute::eMESH ) {
					printf( " found a mesh !\n" );
					MeshNodes.push_back( pood );
					KFbxGeometryConverter converter(pood->GetFbxSdkManager());

					printf( " triangulating...\n" );
					converter.TriangulateInPlace(pood);

					
					
					//return pood;
				}
				
			}

			FindMeshes(pood);
			//return DumbRecursiveSearch( pood );
		}
	} 
}
コード例 #2
0
KFbxNodeAttribute::EAttributeType GetNodeAttributeType(KFbxNode* pNode)
{
	KFbxNodeAttribute* nodeAtt = pNode->GetNodeAttribute();
	if( nodeAtt != NULL )
		return nodeAtt->GetAttributeType();
	return KFbxNodeAttribute::eNULL;
}
コード例 #3
0
ファイル: fbxparser.cpp プロジェクト: jlcox5/Frost
// Print an attribute
void FBXParser::printAttribute(KFbxNodeAttribute const & pAttribute) const{
  if(!&pAttribute){ return; }

  KString typeName = getAttributeTypeName(pAttribute.GetAttributeType());
  KString attrName = pAttribute.GetName();
  printTabs();
  cout << "<attribute type= " << typeName.Buffer() << " name= " << attrName.Buffer();
  cout << "/>" << endl;
}
コード例 #4
0
ファイル: FBXLoader.cpp プロジェクト: antoinechene/FPS-openGL
void	FBXLoader::PrintNode(KFbxNode* pNode, Node* node)
{
	KFbxNodeAttribute*	Patt;
	fbxDouble3		trans;
	fbxDouble3		rot;
	fbxDouble3		scale;
	const char*		nodeName;
	int			i;
	int			j;
	Node*			Child;
	Object*			obj;

	if (pNode == NULL)
		return;

	nodeName = pNode->GetName();
	trans = pNode->LclTranslation.Get();
	rot = pNode->LclRotation.Get();
	scale = pNode->LclScaling.Get();
	node->SetName(nodeName);
	node->SetTrans(trans);
	node->SetRot(rot);
	node->SetScale(scale);
	i = 0;
	while (i < pNode->GetNodeAttributeCount())
	{
		Patt = pNode->GetNodeAttributeByIndex(i);
		obj = GetAttributeTypeName(pNode, Patt->GetAttributeType());
		this->DisplayPivotsAndLimits(pNode, node);
		if (obj != NULL)
			node->AddObject(obj);
		++i;
	}
	j = 0;
	while (j < pNode->GetChildCount())	//fiston
	{
		Child = new Node();
		Child->SetFather(node);
		node->AddChild(Child);
		this->PrintNode(pNode->GetChild(j), Child);
		++j;
	}
}