## FBXLoader for Python
> [!WARNING]
> This library has very limited features and is only intended for **reading mesh geometry from binary FBX files**, it doesn't support:
> * Reading ASCII FBX files.
> * Reading textures and materials even if they are encoded in the file.
> * Reading skeletons and animations. Note that the geometry may also be incorrect if the mesh is skinned.
> * Writing FBX files.
> However, this can be a starting point to implement more features in the future. Welcome to contribute!
### Install
```bash
# from pypi
pip install fbxloader
# from source
pip install git+https://github.com/ashawkey/fbxloader.git
```
### Usage
Python API:
```python
from fbxloader import FBXLoader
fbx = FBXLoader('model.fbx') # load from file or bytes
# similar to glb, fbx usually contains multiple meshes as a scene
# we provide a method to merge them into a single mesh and export as trimesh.Trimesh
mesh = fbx.export_trimesh()
# write to other formats (using trimesh API)
mesh.export('model.obj')
# meta: this is to provide some information on unimplemented features, you may inspect it to make sure if the model is expected to load correctly. e.g., hasDeformers=True usually means the model is skinned.
print(fbx.meta)
# {'hasImages': False, 'hasTextures': False, 'hasMaterials': True, 'hasDeformers': True, 'hasAnimations': True}
```
We also provide a CLI tool:
```bash
fbxconverter <input.fbx> <output.obj/ply/glb>
```
Lastly, we provide a testing script and also a fbx mesh as an example:
```bash
python tests/test.py examples/annulus.fbx
```
### Reference
The code is basically translated from [threejs's FBXLoader](https://github.com/mrdoob/three.js/blob/b1046960d9adb597ba0ead7ff4a31f16d0a49a79/examples/jsm/loaders/FBXLoader.js).
Thanks to the threejs team and also copilot!
Raw data
{
"_id": null,
"home_page": "https://github.com/ashawkey/fbxloader",
"name": "fbxloader",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "fbx",
"author": "kiui",
"author_email": "ashawkey1999@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/48/b2/35fb118f0bce0f1b24f3122b5bc05619365126de65c19dbe23cd65fec67f/fbxloader-0.0.2.tar.gz",
"platform": null,
"description": "## FBXLoader for Python\n\n> [!WARNING]\n> This library has very limited features and is only intended for **reading mesh geometry from binary FBX files**, it doesn't support:\n> * Reading ASCII FBX files.\n> * Reading textures and materials even if they are encoded in the file.\n> * Reading skeletons and animations. Note that the geometry may also be incorrect if the mesh is skinned.\n> * Writing FBX files.\n> However, this can be a starting point to implement more features in the future. Welcome to contribute!\n\n\n### Install\n\n```bash\n# from pypi\npip install fbxloader\n\n# from source\npip install git+https://github.com/ashawkey/fbxloader.git\n```\n\n### Usage\n\nPython API:\n```python\nfrom fbxloader import FBXLoader\n\nfbx = FBXLoader('model.fbx') # load from file or bytes\n\n# similar to glb, fbx usually contains multiple meshes as a scene\n# we provide a method to merge them into a single mesh and export as trimesh.Trimesh\nmesh = fbx.export_trimesh()\n\n# write to other formats (using trimesh API)\nmesh.export('model.obj')\n\n# meta: this is to provide some information on unimplemented features, you may inspect it to make sure if the model is expected to load correctly. e.g., hasDeformers=True usually means the model is skinned.\nprint(fbx.meta)\n# {'hasImages': False, 'hasTextures': False, 'hasMaterials': True, 'hasDeformers': True, 'hasAnimations': True}\n```\n\nWe also provide a CLI tool:\n```bash\nfbxconverter <input.fbx> <output.obj/ply/glb>\n```\n\nLastly, we provide a testing script and also a fbx mesh as an example:\n```bash\npython tests/test.py examples/annulus.fbx\n```\n\n### Reference\nThe code is basically translated from [threejs's FBXLoader](https://github.com/mrdoob/three.js/blob/b1046960d9adb597ba0ead7ff4a31f16d0a49a79/examples/jsm/loaders/FBXLoader.js). \nThanks to the threejs team and also copilot!\n",
"bugtrack_url": null,
"license": null,
"summary": "utility to read fbx file",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/ashawkey/fbxloader"
},
"split_keywords": [
"fbx"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a649df741b3810b7360c55c15ec547f06fbcafa4a3c458aac32e3bb69442155d",
"md5": "4eaf81c2e6999671ac32a6a160cf5e18",
"sha256": "22dd2f319f6870e19070f5fc57f0dce70ef0798619b8a782f995ae4aff26227a"
},
"downloads": -1,
"filename": "fbxloader-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4eaf81c2e6999671ac32a6a160cf5e18",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9930,
"upload_time": "2024-08-05T18:35:53",
"upload_time_iso_8601": "2024-08-05T18:35:53.796611Z",
"url": "https://files.pythonhosted.org/packages/a6/49/df741b3810b7360c55c15ec547f06fbcafa4a3c458aac32e3bb69442155d/fbxloader-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "48b235fb118f0bce0f1b24f3122b5bc05619365126de65c19dbe23cd65fec67f",
"md5": "8faa984ebfe24a2835bde7f4921bd841",
"sha256": "db004e0d134598094e86f68a1dde5eaf07a0befc4d87cdf781620015cc2a752d"
},
"downloads": -1,
"filename": "fbxloader-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "8faa984ebfe24a2835bde7f4921bd841",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9518,
"upload_time": "2024-08-05T18:35:54",
"upload_time_iso_8601": "2024-08-05T18:35:54.680561Z",
"url": "https://files.pythonhosted.org/packages/48/b2/35fb118f0bce0f1b24f3122b5bc05619365126de65c19dbe23cd65fec67f/fbxloader-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-05 18:35:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ashawkey",
"github_project": "fbxloader",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fbxloader"
}