How to use the pyassimp.core function in pyassimp

To help you get started, we’ve selected a few pyassimp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github assimp / assimp / port / PyAssimp / sample.py View on Github external
def main(filename=None):
    filename = filename or DEFAULT_MODEL
    
    print "Reading model", filename
    scene = pyassimp.load(filename)
    
    #the model we load
    print "MODEL:", filename
    print
    
    #write some statistics
    print "SCENE:"
    print "  meshes:", len(scene.meshes)
    print "  materials:", len(scene.materials)
    print "  textures:", len(scene.textures)
    print
    
    print "NODES:"
    recur_node(scene.rootnode)

    print
github assimp / assimp / port / PyAssimp / sample.py View on Github external
for index, material in enumerate(scene.materials):
        print("  MATERIAL (id:" + str(index+1) + ")")
        for key, value in material.properties.items():
            print "    %s: %s" % (key, value)
    print
    
    print "TEXTURES:"
    for index, texture in enumerate(scene.textures):
        print "  TEXTURE", index+1
        print "    width:", texture.width
        print "    height:", texture.height
        print "    hint:", texture.achformathint
        print "    data (size):", len(texture.data)
   
    # Finally release the model
    pyassimp.release(scene)

    print "Finished parsing the model."