Obj2gltf
Small wrapper library over pygtlflib that helps you convert your obj files into gtlf format, for something like 3.js which prefer gltf format.
Installation
pip install obj2gltf
Usuage Guide
This script converts OBJ files to GLTF format. It can process a single file or an entire folder of OBJ files. You can use it as command line tool, or import it to your own code.
Basic Usage
python -m obj2gltf <obj_path> [options]
Arguments
obj_path(required): Path to the OBJ file or folder containing OBJ files.
Options
-
--output: Path to the output GLTF file or folder. If not specified, the output will be saved in the same location as the input with a .gltf extension. -
--exclude_list: List of files to be excluded from processing. Useful when converting a folder of OBJ files. -
--colors: List of RGB color values to be applied to the converted models.
Examples
-
Convert a single OBJ file:
python -m obj2gltf path/to/model.obj -
Convert a single OBJ file with a specific output path:
python -m obj2gltf path/to/model.obj --output path/to/output.gltf -
Convert all OBJ files in a folder:
python -m obj2gltf path/to/obj_folder -
Convert all OBJ files in a folder, excluding specific files:
python -m obj2gltf path/to/obj_folder --exclude_list "[file1.obj,file2.obj]" -
Convert an OBJ file and apply a specific color:
python -m obj2gltf path/to/model.obj --colors "[255,0,0]"
Notes
- When using
--exclude_listor--colors, enclose the list in square brackets and separate items with commas, without spaces. - Color values should be integers between 0 and 255 for each RGB component.
- If processing a folder, the script will maintain the folder structure in the output.
Alternative Usuage
Import the Obj2Gltf class to your own code.
from obj2gltf import Obj2Gltf
For any issues or further questions, please refer to the documentation or contact the developer.
Metadata
Release files for obj2gltf 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| obj2gltf-0.1.3.tar.gz | 3.9 kB | Without provenance | Details for obj2gltf-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| obj2gltf-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for obj2gltf-0.1.3-py3-none-any.whl |
Total release size: 8.1 kB
Release files / obj2gltf-0.1.3.tar.gz
| Download URL | obj2gltf-0.1.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6f754a2acde45b67462f3d9108333b67cad14a0ddd26be8c14a4ffbafcbf6b2
|
|
BLAKE2b-256 checksum How to use checksums |
b553f59266ae882867858d37d31a81426f3835bb1d823b67e79174fa6f8f4abb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Darwin/24.0.0
|
Release files / obj2gltf-0.1.3-py3-none-any.whl
| Download URL | obj2gltf-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7febafa9111bccb370e0c35ea6f43741b4778b51b7c0e62678925b78a2822d3d
|
|
BLAKE2b-256 checksum How to use checksums |
c53637f83ec5e7b0da4c86e975d8dd9fce42d6e31f29c891716f2c508e41598d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Darwin/24.0.0
|
Security for obj2gltf 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.