Merge pull request #1810 from mesilliac/info_more_mesh_info

assimp_cmd info: list meshes and print basic mesh stats.
pull/1819/head^2
Kim Kulling 2018-03-01 00:10:12 +01:00 committed by GitHub
commit 3dde8d3496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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]
)
;
// 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;
for(unsigned int i = 0;i < scene->mNumMaterials; ++i) {
aiString name;
@ -340,6 +363,7 @@ int Assimp_Info (const char* const* params, unsigned int num)
printf("\n");
}
// textures
total=0;
for(unsigned int i = 0;i < scene->mNumMaterials; ++i) {
aiString name;
@ -369,6 +393,7 @@ int Assimp_Info (const char* const* params, unsigned int num)
printf("\n");
}
// animations
total=0;
for(unsigned int i = 0;i < scene->mNumAnimations; ++i) {
if (scene->mAnimations[i]->mName.length) {
@ -379,6 +404,7 @@ int Assimp_Info (const char* const* params, unsigned int num)
printf("\n");
}
// node hierarchy
printf("\nNode hierarchy:\n");
unsigned int cline=0;
PrintHierarchy(scene->mRootNode,20,1000,cline,verbose);