{"id":7089,"library":"cmeel-assimp","title":"cmeel-assimp","description":"cmeel-assimp is a Python distribution of the Open-Asset-Importer-Library (Assimp), providing bindings to load and process 3D models from a multitude of file formats. It leverages the cmeel build system to simplify the installation of the underlying C++ library. The current version is 6.0.2, reflecting the latest Assimp releases.","status":"active","version":"6.0.2","language":"en","source_language":"en","source_url":"https://github.com/cmake-wheel/cmeel-assimp.git","tags":["3d","model-loading","graphics","assimp","cmeel"],"install":[{"cmd":"pip install cmeel-assimp","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"cmeel-assimp provides the pyassimp API, so 'pyassimp' is the top-level import. Directly importing 'assimp' will fail.","wrong":"import assimp","symbol":"load","correct":"from pyassimp import load"},{"note":"Post-processing flags are part of the 'pyassimp.postprocess' module.","wrong":"import assimp.postprocess","symbol":"postprocess","correct":"from pyassimp import postprocess"}],"quickstart":{"code":"import os\nfrom pyassimp import load, postprocess\n\n# Create a dummy model file for demonstration\ndummy_model_content = \"\"\"\n# Wavefront .obj file\n# A simple triangle\n\nv 0.0 0.0 0.0\nv 1.0 0.0 0.0\nv 0.0 1.0 0.0\n\nf 1 2 3\n\"\"\"\n\nmodel_path = 'dummy_triangle.obj'\nwith open(model_path, 'w') as f:\n    f.write(dummy_model_content)\n\ntry:\n    # Load a 3D model with basic post-processing\n    # Use aiProcess_Triangulate to ensure all faces are triangles\n    # Use postprocess.aiProcess_GenNormals to generate smooth normals if not present\n    scene = load(model_path, processing=postprocess.aiProcess_Triangulate | postprocess.aiProcess_GenNormals)\n\n    print(f\"Successfully loaded model: {model_path}\")\n    print(f\"Number of meshes in scene: {len(scene.meshes)}\")\n    \n    if scene.meshes:\n        mesh = scene.meshes[0]\n        print(f\"First mesh has {len(mesh.vertices)} vertices and {len(mesh.faces)} faces.\")\n        if mesh.vertices:\n            print(f\"First vertex: {mesh.vertices[0]}\")\n        if mesh.faces:\n            print(f\"First face (indices): {mesh.faces[0]}\")\n    \n    # It's good practice to release the scene explicitly when done\n    scene.release()\n\nexcept Exception as e:\n    print(f\"Error loading model: {e}\")\nfinally:\n    # Clean up the dummy model file\n    if os.path.exists(model_path):\n        os.remove(model_path)\n","lang":"python","description":"Loads a basic Wavefront OBJ file, demonstrates accessing mesh data (vertices and faces), and ensures proper scene release. It includes common post-processing flags for triangulation and normal generation."},"warnings":[{"fix":"For complex scene manipulations or exports after modification, consider using other 3D libraries or a different approach for editing the model data outside of pyassimp's scene structure before re-exporting.","message":"Direct modification of scene data loaded via pyassimp (and thus cmeel-assimp) and subsequent export may not be reflected. The library is primarily designed for importing and reading, not for in-place modification and export.","severity":"gotcha","affected_versions":"All known versions of pyassimp and cmeel-assimp"},{"fix":"Refer to the official pyassimp and Assimp documentation for updated API usage. Ensure your code aligns with the Python interface provided by cmeel-assimp's wrapped Assimp version.","message":"Assimp C++ library versions, particularly around 6.0.0, introduced API changes (e.g., in enums). While cmeel-assimp aims to provide compatible Python bindings, direct usage of underlying C++ Assimp concepts or older Python binding patterns might break.","severity":"breaking","affected_versions":"6.0.0 and newer of the underlying Assimp C++ library; potentially affecting cmeel-assimp 6.0.x"},{"fix":"If 'library not found' errors occur after installation, verify system PATHs or LD_LIBRARY_PATH (Linux) / DYLD_LIBRARY_PATH (macOS) to ensure the Assimp shared library is discoverable. Re-installing in a clean environment or consulting `cmeel` documentation for debugging bundled libraries might be necessary.","message":"Although cmeel-assimp aims to bundle the Assimp C++ shared library, some exotic environments or custom builds might still encounter issues where the shared library (DLL on Windows, .so on Linux, .dylib on macOS) is not found.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure you are importing 'load' or other symbols from `pyassimp`, not `assimp`. For example: `from pyassimp import load`. If the module is not found, verify `pip install cmeel-assimp` ran successfully.","cause":"The user is trying to import 'assimp' directly, or 'pyassimp' was not correctly installed as the interface for cmeel-assimp.","error":"ImportError: No module named pyassimp"},{"fix":"Double-check the file path and name. Ensure the model file is valid and readable. Assimp supports a wide range of formats, but extremely malformed or very new/uncommon formats might not be supported. Try with a known-good model file.","cause":"This error typically indicates that the specified 3D model file either does not exist, is corrupted, or is in an unsupported format, or the underlying Assimp C++ library failed to parse it.","error":"AssimpError: Could not import file 'your_model.obj'"}]}