Tiny but powerful Wavefront OBJ loader
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.
Requirements
- python 3.x(3.6+ recommended)
- python 2.7 may work, but not officially supported.
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(tinyobjloader) and ISC(mapbox earcut) 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
tinyobjloader-2.0.0rc9.tar.gz
(29.4 kB
view hashes)
Built Distributions
Close
Hashes for tinyobjloader-2.0.0rc9-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d36aef6d653a26a8b9e9e83298c807ab623ab5d68c74030004951a02a8b792d |
|
MD5 | c7bc288df4dda1a887da889576f59ade |
|
BLAKE2b-256 | 200e52cc3543ddde1ef572028825b3fbb81d0f7910c2476f1efc732145470c58 |
Close
Hashes for tinyobjloader-2.0.0rc9-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d211bbe13f1b49a54e3c833f9419107eafbb7a60954832d3fffdc30a8c2651c |
|
MD5 | dc4df05d22d0d148d22e3491e9630a34 |
|
BLAKE2b-256 | b54b23ecc11395f5f2cddbd9b1a91f867c38330f3dea23189f58e0cb16512a1a |
Close
Hashes for tinyobjloader-2.0.0rc9-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1c6fa2103c09e70122be8160194970fe46e1a960b8694745f9aed36453faca0 |
|
MD5 | b9fdf4db085c842d55db4272fa6169cc |
|
BLAKE2b-256 | 823323878da8cfc0841b4f4c742dec1ab01bb49f86c28a5f9390163ae9570495 |
Close
Hashes for tinyobjloader-2.0.0rc9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1c613d89279309b33446335f7bb51e57a5958c5cae8b5465342b1928f5de76f |
|
MD5 | 6bbdae84cd1bee5a60811dc55e51b243 |
|
BLAKE2b-256 | 2679f3cb9a0cb952e84e60615a139d2d011b5de5fd9e922f96d22f1b23aecd23 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0d18bbfb088604c16d1084a01cd6ae9fb39e65fd5b4d1127f7f7ee8100501b |
|
MD5 | 8b3fd3eb2114b6337a6928ae7d5d07a2 |
|
BLAKE2b-256 | 9c37b6dd3cd91d8d183b7502b6ac3590c3488163cd07d1c2d9bf84de8fa7ce7c |
Close
Hashes for tinyobjloader-2.0.0rc9-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5871b44b490f185668c45592b2ad53f126b5e049ff127c3d6b36c3e26da0e8 |
|
MD5 | 1bc2bf9f605333a1203d704f07703c95 |
|
BLAKE2b-256 | 384e658a89c05029530c0e22b41714154edfb3bc231db900026c5e522d589029 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cf5c45f5063dff9fe5dbea328fd807b1fef468827c8039d180f9c4b584928c6 |
|
MD5 | a0f058a467225fb23b53e4381ff96d32 |
|
BLAKE2b-256 | a34cdf44f0682c837cb8b14486a798865bd1f517a72521a7356bf055c0cd9344 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a80642f0b09702b4a478eac12ae0787669841ec5191c3444d42ba8c960d77571 |
|
MD5 | 5fb61371a756d5af11d5adc568f2781b |
|
BLAKE2b-256 | 5257e0092019d0de799222755cf45e9350a2257cd834c34355fc3e6fb236a210 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41f48a4bacd3cb46d6d60df5a8f2bc5d2263c5e174853a8ce6621f56e6a1b0c3 |
|
MD5 | ec8ba64867a30d44023489eef85a1686 |
|
BLAKE2b-256 | 8fa298cd5b733f6224e15e599edb7a7f927106a69370da58c97a5f9854992c48 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac2ed15713a625795161707ded7ea994e6a826947fcdb7aa75731bad54d3d168 |
|
MD5 | 1ae3e041737046de73a186567fc680b6 |
|
BLAKE2b-256 | 67e07dae2fba7d59e66ebcf8a62a5c8fe4034ce0acff8652cf50c8000abe0e17 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c00f66b3f28d9f0d244a99e40e2ed32d3423fe75d9460833ba4ec6f3a9fa601 |
|
MD5 | b538c2d876c91b6b3a958dcc8ee848e2 |
|
BLAKE2b-256 | 55d0491b2bdd966dcffc8c8e5f749fc6e4ae308e61b8e64b75f78a53d70756be |
Close
Hashes for tinyobjloader-2.0.0rc9-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89127f8e64d400348360fb7e221cc5efebc8323efeb6f480df1e4760b20ca1f3 |
|
MD5 | 12d5278f330b931ad655dabbd489f5b5 |
|
BLAKE2b-256 | 135441458ed1659b09f78758d4912cc4c872741b7a71c4732f323f2dc3ec9b2a |
Close
Hashes for tinyobjloader-2.0.0rc9-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdd1f280563b6de4c532f6d7d8d3f3ee4e4b5cce6bdce51a4cfb6da917ccc279 |
|
MD5 | 0b2701d47244216b96656412ab5b944c |
|
BLAKE2b-256 | 867e146bb7a94e4104dbfac0f43adbad7395c5d210b4a3e5d3eef7ac0d1087fd |
Close
Hashes for tinyobjloader-2.0.0rc9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | affecb40090b9de6d1232dbf7a153b76a1f314b51816a3849f7ec40d34d771c8 |
|
MD5 | 5d2015d75afee7a0cbe08467e97722ca |
|
BLAKE2b-256 | 454e70fb87a43119175fda7c04ee4bb2ae77b1c507d0796413dccfbddf0fcb25 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31ca79a33af421d08fce8d26c7cfb06dcfbeb4fe108a90b6a826126cebc8623 |
|
MD5 | 35216d1a1d5a59b69625c11ff4155aad |
|
BLAKE2b-256 | 82e48b794b5d3217f7e70b01d724f2da556f501bda55af49eb504b2af153cd30 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e81495a40b2f52b6a13d540143837235ed9ff1ec2beba653023d6ad4936ebcf |
|
MD5 | 657da27731d83014b68a23a9adf22c80 |
|
BLAKE2b-256 | 5b519ca01163f7aafeab0cd7fbdab67cb4214fb4f89025b1515c48a44fd15d49 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c5d3ffd0766ab759dbbc0dd9b6aa6e1cca359a95f90e411dfa6c92c01062df |
|
MD5 | 6fe10ea553b9c752134cd652442c4546 |
|
BLAKE2b-256 | d942ea67351e1134c7aadbdc706c0c61016df9a6d5c4bb5d14d426b2cac42710 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 706ab2371de4788d3f28e7117106673f09bf94e90bc27d8d69a5e54558df6368 |
|
MD5 | ee39c2d363dc5143145dc7abc320a072 |
|
BLAKE2b-256 | 58c74d5517a178a8317455782f63e0345f64596560cd4f5c7127968bb1fa3275 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eec27f6a7cb19ea83bf904512b1d2eed057f0af9b786d5a757ba90a44b40686 |
|
MD5 | 731a77317eb0c29c4ead1b74d9150b67 |
|
BLAKE2b-256 | eaac5c40a2b98ade8cfe82b1eb50cea4919451282287c19bae73b0702b5315ea |
Close
Hashes for tinyobjloader-2.0.0rc9-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dba696ed3c90ed7584d7009245d2efd8fc72b991039123d479bba656165a0c02 |
|
MD5 | 474e7c3b5ae06d03faace0967d66e9bd |
|
BLAKE2b-256 | f439b7823225a5ac5e34daaad789bceaf8c02efb84afcff5ab43b8e478189785 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d51bccf2f7cc7845e473fe0443018417cf5b4b0ef94125949985e859045f633 |
|
MD5 | 9ad246839a8e8907d02725a196388abc |
|
BLAKE2b-256 | a81122f0da45dffcef33ce9f63072ca68e1f4cf89918ef31d0fb8c6bc7ce6887 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976885cb4015cb126d61a3ef004f9c9e8a32cdd6a988ff7f64e4de7ec1fc609a |
|
MD5 | 60d9f24342e499c10c0a38b3848d1e3c |
|
BLAKE2b-256 | 4f2f299142099ba4de00ca8d98eead7933cd5f55850710d0113e70be8e7c81d7 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 508ea225824c388d6c9dfccdf480006cb4042fa4479f3b9cc8a26ed13b2c62c2 |
|
MD5 | e2beede0a271bb36a98b19a74107d3ef |
|
BLAKE2b-256 | 85556b8c1b196917b38664b3c6478f6840f6eacff2306033b3c625f8f9cecdd6 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7712149a5690fcf37b72dac8e5b49526f8a6002623e05bde145afa1ae8795b1 |
|
MD5 | 2dfb03e2249de1eb39d3c1fa2429dffe |
|
BLAKE2b-256 | 0a365bd3eb315559f6991f6a17fcd729dd9cdd51d480a4d1e2e573a90d255b2e |
Close
Hashes for tinyobjloader-2.0.0rc9-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ba914e4e666be6cd21ec7b28a1b633719bb005cc133baa51edf7790c90c5b8 |
|
MD5 | aa5db68b2f40ba3689c05432a9591f4c |
|
BLAKE2b-256 | f787fc753c31fbb5ae59be308635d3cdfcef8c393a9e5f1042c04000949a9f70 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60125d56c9d6eef2a3929ab8a708ba7de210e86c9f01d5ce4c56c6fe1adb7d74 |
|
MD5 | b001f53eb8236a6085bd582febd81a45 |
|
BLAKE2b-256 | abe0b3a2635698f736c168183f3b468164f9f63d9cce3feb5733908516f09b53 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8ae3f84fa1e2dce3125b001ede0008248af71ad09e7a21b89d00c7bd827f8e3 |
|
MD5 | f214a5923779f0207448b9d2678d0ae4 |
|
BLAKE2b-256 | cfa896ff67f206834d7cbd9ff20dfcb847aea6fbcb444bd6571650f51addd359 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31db678c37d30b60089f2be6f2dac46a6ec0af8ad1aeff2c2ad5fa9f847007a8 |
|
MD5 | 66c6f314a3ae57eba353a47c039832ad |
|
BLAKE2b-256 | a2d50d544acec487db82988e7a306a8d2227b8147d2e52bcddb42a4b14782db3 |
Close
Hashes for tinyobjloader-2.0.0rc9-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 836350a075b230e6e9b808ae3435bb479c6b91763e31bf04da50e10e87c392f3 |
|
MD5 | ccc208dd75c80540ad2ca3bcd7ce2f35 |
|
BLAKE2b-256 | 420053e029d35b88d44362566f9e9f2d49d530bf92889b0a446b2b40bec8ee3d |