Occasional fork of tinyobjloader
Project description
tinyobjloader, Wavefront .obj loader
tinyobjloader
is a python wrapper for C++ wavefront .obj loader.
tinyobjloader
is rather fast and feature rich than other pure python version of .obj loader.
Install
You can install tinyobjloader
with pip.
$ pip install tinyobjloader
Quick tutorial
import sys
import tinyobjloader
# Create reader.
reader = tinyobjloader.ObjReader()
filename = "cornellbox.obj"
# Load .obj(and .mtl) using default configuration
ret = reader.ParseFromFile(filename)
if ret == False:
print("Warn:", reader.Warning())
pint("Err:", reader.Error())
print("Failed to load : ", filename)
sys.exit(-1)
if reader.Warning():
print("Warn:", reader.Warning())
attrib = reader.GetAttrib()
print("attrib.vertices = ", len(attrib.vertices))
print("attrib.normals = ", len(attrib.normals))
print("attrib.texcoords = ", len(attrib.texcoords))
materials = reader.GetMaterials()
print("Num materials: ", len(materials))
for m in materials:
print(m.name)
print(m.diffuse)
shapes = reader.GetShapes()
print("Num shapes: ", len(shapes))
for shape in shapes:
print(shape.name)
print("num_indices = {}".format(len(shape.mesh.indices)))
More detailed usage
Please take a look at python/sample.py
file in tinyobjloader git repo.
https://github.com/syoyo/tinyobjloader/blob/master/python/sample.py
How to build
Using cibuildwheel
is an recommended way to build a python module.
See $tinyobjloader/azure-pipelines.yml for details.
Developer build
Edit setup.py
and uncomment Developer option
lines
Assume pip is installed.
$ pip install pybind11
$ python setup.py build
License
MIT license.
TODO
- Writer saver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tinymetabobjloader-2.0.0a0.tar.gz
(27.5 kB
view hashes)
Built Distributions
Close
Hashes for tinymetabobjloader-2.0.0a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 008c2ed502a02bf3cd4efd34e9e651b48571d13fbd55955e629b67394ea2bebd |
|
MD5 | 4b8ebb7417d7046da3f244434acc7cfa |
|
BLAKE2b-256 | c7c119b1331d2525fd601bf6e63ec7916d32358b64c5f2afb0d6c47c75d48bf8 |
Close
Hashes for tinymetabobjloader-2.0.0a0-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e0d9d9c6fa1d53e0a26c1646eaf4ca2c7b4ad8b9b0fda3f85812875796d540a |
|
MD5 | c321f21846355d8d80685c6301a70f31 |
|
BLAKE2b-256 | da8d361411099f15aae38272e64a48fd920ecbbbf3f67b3d415cfbe9116e57e7 |
Close
Hashes for tinymetabobjloader-2.0.0a0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 219b025e85c6af96947f598ce2e8b460c2cb213b646605aad16bb733b65cba0f |
|
MD5 | b485e9447607f0eba7d31e9267e0b503 |
|
BLAKE2b-256 | 90e9a10c12ebe5f26e9c70b43a7e5fa9b126c4ac207e1fdb4d4b3955cc5e0b35 |
Close
Hashes for tinymetabobjloader-2.0.0a0-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d24ba9230b549eb607de33195276f3182f7ebc62de25bfa0069f9088fe649a |
|
MD5 | e443b271edf2847e8ca53e4d7be7ab6f |
|
BLAKE2b-256 | b4ececa48ac85f91bce02e1b8037d1ce6f053b861311273f20782ec47f911a26 |
Close
Hashes for tinymetabobjloader-2.0.0a0-pp36-pypy36_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a97c9f5d33f99d88f7211cf4efcf8861f1716864085af4bfe780d341819b4ea5 |
|
MD5 | 3508e2fb8298cb9610bc7a4d5e9ef1a9 |
|
BLAKE2b-256 | 5eee28c5468a3bf54431472bed96d2dba5b0af6e9de3484c806405b17ac80d56 |
Close
Hashes for tinymetabobjloader-2.0.0a0-pp27-pypy_73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 717bd3d89cb3d96414165b139664bccbfcbc799d1aca255a38cd1ee824e57020 |
|
MD5 | 81a0779fcafbe80b64a3e0330800075f |
|
BLAKE2b-256 | 79afeeed14a284689d3dbb61eab62d65493591fac801d3f4a48f90fe418bcad0 |
Close
Hashes for tinymetabobjloader-2.0.0a0-pp27-pypy_73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d9c00325ef16858f3306db20e946c9fd53ce10787eac82e9b583def3658ebed |
|
MD5 | 45a05ee66e5cc6502af2a63a862a0c34 |
|
BLAKE2b-256 | 153a96b74a7cbd8a9bd90ed2d2d7cc716351f6b42c5c6cf72430d4ccd19644f9 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794d8cce696b94ce4ea91d4695b03eb0845f7d357234d4022eff764354cc21fd |
|
MD5 | 3444535f149ef569835cd9f3160fd346 |
|
BLAKE2b-256 | 875f214e93622e298d775c01ac27578697d5787beab9b1e973d45767e0dd6435 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 929c2a75dc722837288db0f7b07a521bf1ccd040f3e339f800ebe9db5458a204 |
|
MD5 | 0b2b363d7696fb10ee376e3d84f96492 |
|
BLAKE2b-256 | aa28358c6609d2fea14131190ba49174a4bb475ca90dc34177db3cf718e532b4 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f57d1e4b56efa88809546a7c7578e0491c6017ff23ba1dc96999e8eee8f86daf |
|
MD5 | 0c859c4ec3625ebc06e4c5aa82e5abdb |
|
BLAKE2b-256 | 76538000e3b4c850c521ebde6d2536eed48315555e41b2aeb8bba24cbea5053a |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9256c42a7e8b39d7cf602a85abdce24ac6c62e36fd15562fe38c0c2c0976fe83 |
|
MD5 | 1825357465a6dd1e02025da6453f84d5 |
|
BLAKE2b-256 | c4b0ea14d9ecf37a4aeaa7073c0b3a3bd241d5caa70b6e3aaa5579f2dc02e70c |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4301779bf8571ffde113fdd0980c067bfb438be8798db5825154a1dcf2f877b7 |
|
MD5 | 3e561e130de0084ef5b06ce29b015602 |
|
BLAKE2b-256 | 22445a9a6495e9a06e5b69d1b71e716ba2642c9a4bbde06eebe25914d112a1e0 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e15b6f4197cfe1e30afd9efa0fbf50dc4757f1ead5f40459adc06ac8651a03b |
|
MD5 | 4b1ec489a964566540c9122ec62475ca |
|
BLAKE2b-256 | a58fe36050b787ac2b670723817ceb40827603dffeb7cf53d7c07677b4fffcd6 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 991de7433d32fafddbb22943c74454d8f8b591665c203920c2f2c2b61fed7d07 |
|
MD5 | b3f7a2e1b5a35e27b222d19935071e87 |
|
BLAKE2b-256 | 389b5dd692ed03d7db215ef429c363cbf2b7524ba6fe62d1be2cedf8afd64f8e |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6d2318c6b5c9b8179ed1ce9fcba1ff38e1f9e993f80f41dcccbdc77efec4256 |
|
MD5 | 12c8f62f576dca600608b0b267ae9e19 |
|
BLAKE2b-256 | 06ea115ac4a4fd7076c7c12721c7f8690e4644603146b3be09bcce928b147cc9 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebbc420adcbbf1f4c9f1bd4592c064317c2a8a4532d2c8928398290a0751415b |
|
MD5 | 39bfe4e45b6c1c904ca506fb930ccae3 |
|
BLAKE2b-256 | e6e3f4f516a7078ef27374ff55b24c5d37f773046f1979d9a676914872b342aa |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e1e2de095b7f4644e7a05350ed7f101c67e19e7c177efec9a628eb73bd8da8 |
|
MD5 | 7bd6feab62765443332e9dbcf265480b |
|
BLAKE2b-256 | 7c56cb6e5f1ea7108591c5563dbe0cf45c1c7f543bd18ce00e8cf724a72186f9 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 607f190ce27200dd06f7cf7a8f6306df8f723726662c4b702d813b7eac4c9cf4 |
|
MD5 | c675d3f4c8200e21338d601705fa28cd |
|
BLAKE2b-256 | ce8dd3692d40a85b548986a6d1b9f2f8b105177e985ab7f36769ddec58875ca5 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38b4f475035a23d5d39d22014f413243e441a91ac5b084b12a4ea4bc44d90639 |
|
MD5 | 9e97c1963268806267ae59baa29e12b3 |
|
BLAKE2b-256 | 9671e0f8dbd4989590e82e2c3f65cb0597724777446b85cca991d712cbedfa7d |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0845f0ae29f899bbba2d4ffd02302e30007a5a24cef8c432b32157f1d4bbf1ea |
|
MD5 | 87deac13150ad2a8a20bd06ffe2f3390 |
|
BLAKE2b-256 | 41874a764ab6bcaaf7f2c6e686265b9839fe96b742f2fa88751a6f4e37c394d5 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4f43b9bc48ee6fcee172346c1e0089a9b9dbe2a2ac2b9d1cab04598473438ba |
|
MD5 | cbd157c4ad4a53ca9c9f34af9c2791da |
|
BLAKE2b-256 | 395766cf3c9ba38f6d24a77ca00e63dcbd4908adb288fcb39c865658ab9fd6f2 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4375ab61cf98ddc9bb560000afa850634c883fef75125a9963539f4fedca1ea |
|
MD5 | c4a71058c4c1a901a2991d216da0b798 |
|
BLAKE2b-256 | d8fb833ea805e6df1a9f5da81d973e26e6db268f70d679ce91a0504587074b0e |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 712bcd85889c9a9667a8770e772ca03c62fe0f4a552c4ab2fc61f619624a0092 |
|
MD5 | e57c63b6b884107e801c01841106837d |
|
BLAKE2b-256 | 713d002e6660ffcaae0a2f3548c7a054c63bcccaa86fae2588fa42f98b5a6333 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp27-cp27mu-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61f69e5819cbf54c5c2ffcf0f5ececc22ed4278d4ba604b974fd9b90ae39859e |
|
MD5 | 41921f5f41d6946d46abaf03eb6e5def |
|
BLAKE2b-256 | 4d4a21ceda9689cbfafedb2c834e5ae303db3b33253ad34b9befba18e3463de5 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70b7dd46a05fbdea1c98101f39daa32671c4467f799413d28ede195d167f3c65 |
|
MD5 | 52c0474a444242f5d47158cc2ed7ba13 |
|
BLAKE2b-256 | a6454c29eb831a0a6aacd0aa3f0617aeefdf38a14eaa4fbc88016933386d880d |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp27-cp27m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3a71e7b3b9a112983f02cf660836ad9be1cd561e4ccbae8d6973873d4f1f10f |
|
MD5 | 9fe4cdfef0b17c4891e7c2ab8e269c85 |
|
BLAKE2b-256 | 41c6d7a3a4fe516ae2fa94217a2f2d04e817b4180e28bd6b913c8298e2e32389 |
Close
Hashes for tinymetabobjloader-2.0.0a0-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3718a0908e779ae00ea55b485bbbc81d02e01ebabcd1f6f5a7dd8deaabe38568 |
|
MD5 | 0941ecd76c99b6a05d3fe0819c72fdda |
|
BLAKE2b-256 | 992595894d6abf871ffa040dac41317e1162db9228407114c5867979ba5a5b5b |