Giter Site home page Giter Site logo

blend2bam's Introduction

Pipeline Python Versions Panda3D Versions License

blend2bam

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

Installation

Use pip to install the panda3d-blend2bam package:

pip install panda3d-blend2bam

blend2bam also requires that Blender is installed. Ideally blender is available on the system PATH. However, if it's not, the directory containing blender can be specified with --blender-dir (see CLI usage).

Usage

CLI

usage: blend2bam [-h] [--version] [-m {legacy,pbr}] [--physics-engine {builtin,bullet}] [--srcdir SRCDIR]
                 [--blender-dir BLENDER_DIR] [--append-ext] [--pipeline {gltf,egg}]
                 [--no-srgb] [--textures {ref,copy,embed}]
                 src [src ...] dst

CLI tool to convert Blender blend files to Panda3D BAM files

positional arguments:
  src                   source path
  dst                   destination path

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -m {legacy,pbr}, --material-mode {legacy,pbr}
                        control how materials are exported
  --physics-engine {builtin,bullet}
                        the physics engine to build collision solids for
  --srcdir SRCDIR       a common source directory to use when specifying multiple source files
  --blender-dir BLENDER_DIR
                        directory that contains the blender binary
  --blender-bin BLENDER_BIN
                        name of the blender binary to use
  --append-ext          append extension on the destination instead of replacing it (batch mode only)
  --pipeline {gltf,egg}
                        the backend pipeline used to convert files
  --no-srgb             do not load textures as sRGB textures (only for glTF pipelines)
  --textures {ref,copy,embed}
                        how to handle external textures
  --animations {embed,separate,skip}
                        how to handle animation data

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.

Pipelines

blend2bam has support for multiple backend "pipelines." Currently, gltf and egg are supported. For Blender 2.7x, gltf uses blendergltf and panda3d-gltf while egg uses YABEE and egg2bam from the Panda3d SDK. For Blender 2.80+ (including 2.90+), only gltf is supported and uses the glTF exporter built into Blender 2.80+ instead of blendergltf. The below table hightlights some of the differences.

Feature glTF (2.7x) EGG (2.7x) glTF (2.8+)
Static Meshes ✔️ ✔️ ✔️
Textures ✔️ ✔️ ✔️
Multiple Diffuse Textures ✔️
Legacy Materials ✔️ ✔️ ✔️2
PBR Materials ✔️ ✔️
Lights ✔️ ✔️
Skinned Meshes ✔️ ✔️ ✔️
Skeletal Animations ✔️ ✔️ ✔️
Shape Keys ✔️ ✔️
Shape Key Animations ✔️ ✔️1
Object Animations
CollisionSolids ✔️ ✔️ ✔️
Bullet Shapes ✔️ ✔️
Tags from Game Properties ✔️ ✔️
Tags from Custom Properties ✔️ ✔️
Convert Particle Systems to Meshes ✔️ ✔️
Separate Animation Files ✔️ 3 ✔️

1 Shape key animations require Panda3D 1.10.6.

2 Only supports diffuse color (factor and map pulled from base color) and normal maps. Requires panda3d-gltf >= 0.9.

3 Supported by EGG, but not implemented in blend2bam

Conversion Guides

The following conversion guides describe how Blender data gets converted to Panda3D data for the various pipelines blend2bam supports:

License

MIT

blend2bam's People

Contributors

janentikan avatar moguri avatar rdb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.