https://github.com/darktohka/p3bamboo
Python library to read the Panda3D BAM format.
https://github.com/darktohka/p3bamboo
panda panda3d panda3d-game-engine python tools toontown toontown-online
Last synced: 5 months ago
JSON representation
Python library to read the Panda3D BAM format.
- Host: GitHub
- URL: https://github.com/darktohka/p3bamboo
- Owner: darktohka
- License: bsd-3-clause
- Created: 2020-10-16T18:20:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-14T11:39:14.000Z (almost 3 years ago)
- Last Synced: 2025-11-27T14:27:16.562Z (6 months ago)
- Topics: panda, panda3d, panda3d-game-engine, python, tools, toontown, toontown-online
- Language: Python
- Homepage:
- Size: 41 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
p3bamboo
========
[](https://pypi.python.org/pypi/p3bamboo/)
p3bamboo is a Python library that gives you full access to a Panda3D BAM file's inner structure.
# Getting Started
Simply install p3bamboo using `pip`:
```bash
python -m pip install p3bamboo
```
Loading a BAM file is very simple:
```python
from p3bamboo.BamFile import BamFile
bam = BamFile()
with open('myModel.bam', 'rb') as f:
bam.load(f)
```
Writing out a BAM file is also easy:
```python
with open('newModel.bam', 'wb') as f:
bam.write(f)
```
To automatically deserialize BAM objects, you must register your own custom BAM object types. For example, to register an object type named `Texture`:
```python
from p3bamboo.BamFactory import BamFactory
from myproject.Texture import Texture
BamFactory.register_type('Texture', Texture)
```
If you register your object types properly and load a BAM file afterwards, you'll be able to access your objects using `bam.object_map`.