Skip to main content

Minimal Python Bindings for ASSIMP Library using C-API

Project description

assimp-py

Build PyPI

Minimal Python Bindings for ASSIMP Library using C-API

Example Program

import assimp_py

# -- loading the scene
process_flags = (
    assimp_py.Process_Triangulate | assimp_py.Process_CalcTangentSpace
)
scene = assimp_py.ImportFile("models/planet/planet.obj", process_flags)

# -- getting data
for m in scene.meshes:
    # -- getting vertex data
    # vertices are guaranteed to exist
    verts = m.vertices

    # other components must be checked for None
    normals = [] or m.normals
    texcoords = [] or m.texcoords
    tangents = [] or m.tangents
    bitangent = [] or m.bitangents

    # -- getting materials
    # mat is a dict consisting of assimp material properties
    mat = scene.materials[m.material_index]

    # -- getting color
    diffuse_color = mat["COLOR_DIFFUSE"]

    # -- getting textures
    diffuse_tex = mat["TEXTURES"][assimp_py.TextureType_DIFFUSE]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

assimp_py-1.0.2.tar.gz (407.9 kB view hashes)

Uploaded Source

Built Distributions

assimp_py-1.0.2-cp38-cp38-win_amd64.whl (227.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

assimp_py-1.0.2-cp38-cp38-manylinux2010_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

assimp_py-1.0.2-cp38-cp38-macosx_10_14_x86_64.whl (350.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

assimp_py-1.0.2-cp37-cp37m-win_amd64.whl (227.1 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

assimp_py-1.0.2-cp37-cp37m-manylinux2010_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

assimp_py-1.0.2-cp37-cp37m-macosx_10_14_x86_64.whl (350.3 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

assimp_py-1.0.2-cp36-cp36m-win_amd64.whl (227.1 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

assimp_py-1.0.2-cp36-cp36m-manylinux2010_x86_64.whl (5.6 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

assimp_py-1.0.2-cp36-cp36m-macosx_10_14_x86_64.whl (350.3 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page