https://github.com/thetestgame/bbmodel2bam
About A CLI tool to convert Blockbench bbmodel files to Panda3D BAM files
https://github.com/thetestgame/bbmodel2bam
bbmodel blockbench panda3d python
Last synced: 5 days ago
JSON representation
About A CLI tool to convert Blockbench bbmodel files to Panda3D BAM files
- Host: GitHub
- URL: https://github.com/thetestgame/bbmodel2bam
- Owner: thetestgame
- License: mit
- Created: 2026-04-13T22:41:17.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-13T22:48:56.000Z (2 months ago)
- Last Synced: 2026-04-14T00:34:05.539Z (2 months ago)
- Topics: bbmodel, blockbench, panda3d, python
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bbmodel2bam
Convert Blockbench `.bbmodel` files to Panda3D `.bam` files.
Inspired by [blend2bam](https://github.com/Moguri/blend2bam).
## Features
- **Mesh elements** – free-form meshes with per-vertex UVs
- **Cube elements** – box primitives with per-face UV rects
- **Embedded textures** – base64-encoded textures decoded and embedded in BAM
- **File-referenced textures** – external texture paths resolved relative to `.bbmodel`
- **Groups / bones** – outliner hierarchy preserved as scene-graph nodes
- **Element transforms** – origin and rotation applied correctly
- **Coordinate conversion** – Blockbench Y-up → Panda3D Z-up
- **Panda3D file loader** – `loader.load_model('model.bbmodel')` works natively
## Installation
```
pip install panda3d-bbmodel2bam
```
Or install in development mode:
```
pip install -e .
```
## Usage
### CLI
```
bbmodel2bam model.bbmodel model.bam
bbmodel2bam models/ output/
bbmodel2bam --scale 0.0625 --textures ref model.bbmodel model.bam
```
Options:
| Flag | Default | Description |
|------|---------|-------------|
| `--scale FLOAT` | `1.0` | Uniform scale factor for coordinates |
| `--textures {embed,ref}` | `embed` | Embed textures in BAM or save as separate files |
| `--append-ext` | off | Append `.bam` instead of replacing extension (batch) |
| `-v, --verbose` | off | Print extra conversion info |
### Python
```python
from bbmodel2bam.converter import convert
convert('model.bbmodel', 'model.bam', scale=1.0)
```
### Panda3D File Loader
With the package installed, Panda3D 1.10.4+ can load `.bbmodel` files directly:
```python
model = loader.load_model('model.bbmodel')
model.reparent_to(render)
```
## Supported bbmodel features
| Feature | Status |
|---------|--------|
| Cube elements | ✅ |
| Mesh elements (free-form) | ✅ |
| Per-face UV (non-box UV) | ✅ |
| Box UV | ❌ planned |
| Embedded textures (base64) | ✅ |
| External texture files | ✅ |
| Element rotation/origin | ✅ |
| Groups / outliner hierarchy | ✅ |
| Animations | ❌ planned |
| Locators | ❌ planned |
## License
MIT