6 #include <assimp/cimport.h>
7 #include <assimp/scene.h>
8 #include <assimp/postprocess.h>
10 void print_materials(struct aiMaterial** materials, unsigned int num_materials)
14 for (i = 0; i < num_materials; i++)
16 printf("Material: %d %d\n", materials[i]->mNumProperties, materials[i]->mNumAllocated);
20 void print_node(const struct aiNode* node)
24 printf("%s: %d %d [", node->mName.data, node->mNumMeshes, node->mNumChildren);
25 for (i = 0; i < node->mNumMeshes; i++)
27 printf("%d ", node->mMeshes[i]);
31 for (i = 0; i < node->mNumChildren; i++)
33 print_node(node->mChildren[i]);
37 int main(int argc, char **argv)
39 const struct aiScene* scene = NULL;
40 const struct aiNode* node = NULL;
42 scene = aiImportFile("/home/jsancho/Imágenes/fleurOptonl.blend", aiProcessPreset_TargetRealtime_MaxQuality);
45 print_materials(scene->mMaterials, scene->mNumMaterials);
48 node = scene->mRootNode;
49 printf("Node:\n parent: %d\n children: %d\n meshes: %d\n", node->mParent, node->mNumChildren, node->mNumMeshes);
50 printf(" transformation: %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f\n", node->mTransformation.a1, node->mTransformation.a2, node->mTransformation.a3, node->mTransformation.a4, node->mTransformation.b1, node->mTransformation.b2, node->mTransformation.b3, node->mTransformation.b4, node->mTransformation.c1, node->mTransformation.c2, node->mTransformation.c3, node->mTransformation.c4, node->mTransformation.d1, node->mTransformation.d2, node->mTransformation.d3, node->mTransformation.d4);