Skip to main content

glTF utilities for Panda3D

Project description

Build Status Panda3D Versions

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 excluding morph targets
  • 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

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. For those that need to support Panda3D 1.10.3 or lower, panda3d-gltf also supplies a patch_loader() function to monkey-patch glTF support to ShowBase.loader:

import gltf

class App(ShowBase):
    def __init__(self):
        ...
        gltf.patch_loader(self.loader)
        ...

On Panda3D 1.10.4+, this function will leave self.loader alone in favor of relying on the Python file loader.

Command Line

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

gltf2bam source.gltf output.bam

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.

API Stability

Since panda3d-gltf has not reached a 1.0 release, its API should not be considered "stable." However, this mostly applies to internals, and effort will be put into keeping the gltf2bam API from breaking. patch_loader() will also be kept stable, but will eventually be phased out in favor of the Python file loader.

Running tests

python setup.py test

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-0.4.tar.gz (19.5 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-0.4-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: panda3d-gltf-0.4.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.1

File hashes

Hashes for panda3d-gltf-0.4.tar.gz
Algorithm Hash digest
SHA256 1a1e04a46d6e0a44b72a3bf2a17c8daf8604d167851b1697c04b7320f8d33865
MD5 db528660836a381f7b538e6667436936
BLAKE2b-256 b7ccc59ff267edef325927ce8f4d8c40733227c32c2062cb3debcb1671215ad0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: panda3d_gltf-0.4-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.1

File hashes

Hashes for panda3d_gltf-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a39517ef41ac1e1d5ba31b6253cd7f9fc8cf0a3a5bd2080c9170e5d3a900fb10
MD5 e017e76f569d53040c6e179ce0843c84
BLAKE2b-256 8392c0242bfdfeccf5ab988d6969f6a2a6bbaf8fccfb3cf7aa95cea111adfacd

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