GithubHelp home page GithubHelp logo

kukulski / panda3d-gltf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moguri/panda3d-gltf

0.0 1.0 0.0 342 KB

glTF utilities for Panda3D

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

panda3d-gltf's Introduction

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
  • 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

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.