Skip to main content

Pipeline License

blend2bam

blend2bam is a CLI tool to convert Blender 2.80+ blend files to Panda3D BAM files. It also supplies a Python file loader to add "native" blend file support to Panda3D.

Features

The following are supported:

  • Static Meshes
  • Materials1
  • Textures
  • Lights
  • Skinned Meshes
  • Shape Keys
  • Skeletal Mesh Animations
  • Shape Key Animations 2
  • Separate Animation Files
  • Collision Shapes 3
  • Tags from Custom Properties
  • Convert Particle Systems to Meshes

1 The focus is on PBR materials with limited support for "legacy" materials. For legacy materials, only diffuse color (pulled from base color) and normal maps are supported.

2 Shape key animations require Panda3D 1.10.6+

3 Collision shapes are generated from Blender's rigid body properties and shapes can be built for either Bullet or Panda3D's builtin collision system

Some notable missing features are:

  • Object Animations
  • Multiple Diffuse/Base Color Textures

The conversion guide provides information on how Blender data gets converted to Panda3D data and any gotchas.

Installation

Use pip to install the panda3d-blend2bam package:

pip install panda3d-blend2bam

Blender 2.80+ is required for blend2bam (ideally available on the system PATH). If it is not, the directory containing blender can be specified with --blender-dir (see CLI usage).

Usage

CLI

usage: blend2bam [-h] [--version] [-v] [-m {legacy,pbr}] [--physics-engine {builtin,bullet}] [--srcdir SRCDIR] [--blender-dir BLENDER_DIR] [--blender-bin BLENDER_BIN]
                 [--append-ext] [--no-srgb] [--textures {ref,copy,embed}] [--animations {embed,separate,skip}] [--invisible-collisions-collection INVISIBLE_COLLISIONS_COLLECTION]
                 [--allow-double-sided-materials] src [src ...] dst

CLI tool to convert Blender blend files to Panda3D BAM files

positional arguments:
  src                   source path
  dst                   destination path

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose         print out extra information (default: False)
  -m {legacy,pbr}, --material-mode {legacy,pbr}
                        control how materials are exported (default: pbr)
  --physics-engine {builtin,bullet}
                        the physics engine to build collision solids for (default: builtin)
  --srcdir SRCDIR       a common source directory to use when specifying multiple source files (default: None)
  --blender-dir BLENDER_DIR
                        directory that contains the blender binary (default: )
  --blender-bin BLENDER_BIN
                        name of the blender binary to use (default: blender)
  --append-ext          append extension on the destination instead of replacing it (batch mode only) (default: False)
  --no-srgb             do not load textures as sRGB textures (default: False)
  --textures {ref,copy,embed}
                        how to handle external textures (default: ref)
  --animations {embed,separate,skip}
                        how to handle animation data (default: embed)
  --invisible-collisions-collection INVISIBLE_COLLISIONS_COLLECTION
                        name of a collection in blender whose collision objects will be exported without a visible geom node (default: InvisibleCollisions)
  --allow-double-sided-materials
                        allow exporting double-sided materials (otherwise force all materials to be single-sided) (default: False)

Python File Loader

blend2bam also supports Panda3D's Python file loader API (requires Panda3D 1.10.4+) to seamlessly adds blend file support to Panda3D's Loader classes. This does not add support to pview, which is a C++ application that does not support Python file loaders.

Running Tests

First install blend2bam in editable mode along with test extras:

pip install -e .[test]

Then run the test suite with pytest:

python -m pytest

Building Wheels

Install build:

pip install --upgrade build

and run:

python -m build

License

MIT

Release files for panda3d-blend2bam 0.26.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for panda3d-blend2bam 0.26.0
File Size Uploaded
panda3d_blend2bam-0.26.0.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for panda3d-blend2bam 0.26.0
File Interpreter ABI Platform
panda3d_blend2bam-0.26.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.7 kB

Release files / panda3d_blend2bam-0.26.0.tar.gz

Download URL panda3d_blend2bam-0.26.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
491ed858d5620ea48c55a096fe5e5a9340793bea44e1fabd46d91ec8e01664c7
BLAKE2b-256 checksum
How to use checksums
2c05b2c09896c918a0468f7b6e4c14db1b75e69fce70354e811bad3ca211ae1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / panda3d_blend2bam-0.26.0-py3-none-any.whl

Download URL panda3d_blend2bam-0.26.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e2bbf9957352c3b9af97e17b7689178ce3e19ba25de8b179db25ec16ffd0972
BLAKE2b-256 checksum
How to use checksums
2561b68585549dd76a4ea1828cbcb0470930ebeed34cc47a8ad5b5c581b8cc14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.26.0 This release

2 release files

0.25.0

2 release files

0.23.0

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.21

2 release files

0.20

2 release files

0.19

1 release file

0.18

1 release file

0.17

1 release file

0.16

1 release file

0.15

1 release file

0.14.1

1 release file

0.14

1 release file

0.13

1 release file

0.12

1 release file

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page