Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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."