Skip to main content

glTF utilities for Panda3D

Project description

Pipeline License

panda3d-gltf

This project adds glTF loading capabilities to Panda3D. One long-term goal for this project is to be used as a reference for adding a builtin, C++ glTF loader to Panda3D. If and when Panda3D gets builtin support for glTF, this module will go into maintenance mode and be used to backport glTF support to older versions of Panda3D.

Features

  • Adds support for native loading of glTF files
  • Supports glTF 2.0
  • Supports binary glTF
  • Includes support for the following extensions:
    • KHR_lights (deprecated in favor of KHR_lights_punctual)
    • KHR_lights_punctual
    • BLENDER_physics
  • Ships with a gltf2bam cli-tool for converting glTF files to BAM
  • Ships with gltf-viewer for viewing files (including glTF) with a simple PBR renderer

Installation

Use pip to install the panda3d-gltf package:

pip install panda3d-gltf

To grab the latest development build, use:

pip install git+https://github.com/Moguri/panda3d-gltf.git

Usage

Configuration

panda3d-gltf has the following configuration options. See below for information on setting these options for the native loader and the CLI.

  • collision_shapes - the type of collision shapes to build. Either builtin for ColisionSolids or bullet for BulletRigidBodyNodes. Defaults to builtin.
  • flatten_nodes - attempt to flatten resulting scene graph, defaults to False
  • legacy_materials - convert imported PBR materials to legacy materials, defaults to False
  • no_srgb - do not load textures as sRGB textures, defaults to False
  • skip_animations - do not convert animation data found in the glTF file, defaults to False
  • skip_axis_conversion - do not perform axis-conversion (useful if glTF data is already non-standard and already Z-Up), defaults to False

Native loading

panda3d-gltf ships with a Python file loader (requires Panda3D 1.10.4+), which seamlessly adds glTF support to Panda3D's Loader classes. This does not add support to pview, which is a C++ application that does not support loading Python file loaders. Instead of pview, use the gltf-viewer that ships with panda3d-gltf.

The loader can be configured via PRC variables. These PRC variables are prefixed with gltf- but otherwise match the names above. For example, use gltf-collision-shapes bullet to have the loader load Bullet shapes instead of CollisionSolids.

Command Line

To convert glTF files to BAM via the command line, use the supplied gltf2bam tool:

gltf2bam source.gltf output.bam

See gltf2bam -h for more information on usage and available CLI flags.

Viewer

panda3d-gltf ships with gltf-viewer. This is a simple viewer (like pview) to view glTF (or any other file format support by Panda3D) with a simple, PBR renderer.

Running Tests

First install panda3d-gltf in editable mode along with test extras:

pip install -e .[test]

Then run the test suite with pytest:

pytest

Building Wheels

Install build:

pip install --upgrade build

and run:

python -m build

License

B3D 3-Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panda3d-gltf-1.1.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panda3d_gltf-1.1.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file panda3d-gltf-1.1.0.tar.gz.

File metadata

  • Download URL: panda3d-gltf-1.1.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for panda3d-gltf-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3d16e95ab27699a926ea9524a90735f799680660ebac624649644a225bfd4b40
MD5 994dcca73872eeaff6ecd8dc41a12563
BLAKE2b-256 a1cb4656cc4be7fa92ba983ffe775acf594b126f0b1d486eda81c844dbe5b474

See more details on using hashes here.

File details

Details for the file panda3d_gltf-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: panda3d_gltf-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for panda3d_gltf-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c351ee0e66236c4d639dc2c56bff3cff7c403f53958dc7780a8333b219f384e4
MD5 929a5eb6e280666f58ba651bf6dc8756
BLAKE2b-256 12e8bfc1fd4dd48fd55f00b4dc0de79c5a4bb0359c8c17bb3b7f149c789ec8c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page