assimp_cmd info: list meshes and print basic mesh stats.

pull/1810/head
Tommy 2018-02-25 09:34:14 +01:00
parent 9287adb735
commit e7736022c8
1 changed files with 26 additions and 0 deletions

View File

@ -329,6 +329,29 @@ int Assimp_Info (const char* const* params, unsigned int num)
special_points[2][0],special_points[2][1],special_points[2][2] special_points[2][0],special_points[2][1],special_points[2][2]
) )
; ;
// meshes
if (scene->mNumMeshes) {
printf("\nMeshes: (name) [vertices / bones / faces | primitive_types]\n");
}
for (unsigned int i = 0; i < scene->mNumMeshes; ++i) {
const aiMesh* mesh = scene->mMeshes[i];
printf(" %d (%s)", i, mesh->mName.C_Str());
printf(
": [%d / %d / %d |",
mesh->mNumVertices,
mesh->mNumBones,
mesh->mNumFaces
);
const unsigned int ptypes = mesh->mPrimitiveTypes;
if (ptypes & aiPrimitiveType_POINT) { printf(" point"); }
if (ptypes & aiPrimitiveType_LINE) { printf(" line"); }
if (ptypes & aiPrimitiveType_TRIANGLE) { printf(" triangle"); }
if (ptypes & aiPrimitiveType_POLYGON) { printf(" polygon"); }
printf("]\n");
}
// materials
unsigned int total=0; unsigned int total=0;
for(unsigned int i = 0;i < scene->mNumMaterials; ++i) { for(unsigned int i = 0;i < scene->mNumMaterials; ++i) {
aiString name; aiString name;
@ -340,6 +363,7 @@ int Assimp_Info (const char* const* params, unsigned int num)
printf("\n"); printf("\n");
} }
// textures
total=0; total=0;
for(unsigned int i = 0;i < scene->mNumMaterials; ++i) { for(unsigned int i = 0;i < scene->mNumMaterials; ++i) {
aiString name; aiString name;
@ -369,6 +393,7 @@ int Assimp_Info (const char* const* params, unsigned int num)
printf("\n"); printf("\n");
} }
// animations
total=0; total=0;
for(unsigned int i = 0;i < scene->mNumAnimations; ++i) { for(unsigned int i = 0;i < scene->mNumAnimations; ++i) {
if (scene->mAnimations[i]->mName.length) { if (scene->mAnimations[i]->mName.length) {
@ -379,6 +404,7 @@ int Assimp_Info (const char* const* params, unsigned int num)
printf("\n"); printf("\n");
} }
// node hierarchy
printf("\nNode hierarchy:\n"); printf("\nNode hierarchy:\n");
unsigned int cline=0; unsigned int cline=0;
PrintHierarchy(scene->mRootNode,20,1000,cline,verbose); PrintHierarchy(scene->mRootNode,20,1000,cline,verbose);