Skip to content

Latest commit

 

History

History
100 lines (68 loc) · 2.06 KB

blend2egg.md

File metadata and controls

100 lines (68 loc) · 2.06 KB

blend2egg

BLEND to EGG (Panda3D model format) converter.

Features

  • Export RenderPipeline materials
  • Export Blender-calculated tangents-bitangents
  • Export NodePath "tags" from json-encoded Blender text blocks
  • Skeletal animations

Requirements

  • Panda3D (1.10.6+) for EGG generation
  • python-blender (2.81+) (Blender as Python module) or Blender's Python

Expected material nodes setup

Supported texture maps as BSDF inputs for RenderPipeline materials:

  • Base Color
  • Specular
  • Roughness
  • Normal Map

Supported BSDF input values as RenderPipeline material params:

  • Metallic (RenderPipeline uses values 0 and 1 only)
  • Roughness
  • Normal Map Strength (from Normal Map Node)

Some input values could be specified as separate Math Nodes.

Nodes 1 Nodes 2

NodePath tags setup

You can define object's tags using json-encoded Blender text blocks with the same name as an object.

Text 1

pview output (notice the "hp" and "type" tags):

GeomNode mesh_ruby (1 geoms: S:(MaterialAttrib TextureAttrib)) [hp type] T:m(scale 10000)

python usage example:

ruby_mesh = self.ruby.find('**/=type=body')
print('hp', ruby_mesh.get_tag('hp'))

outputs:

hp 100

Exporting models

blend2egg --output x.egg x.blend

Exporting animations (from Blender actions)

blend2egg --output x_action_name.egg --export animation --action action_name x.blend

Examples

Original model made by theStoff:

https://sketchfab.com/3d-models/ruby-rose-2270ee59d38e409491a76451f6c6ef80

Convert models from BLEND file:

make -C examples/ruby_rose

Open converted models using Panda3D and RenderPipeline (from EGG format):

python examples/ruby_rose/scene_rp_egg.py

Preview in Blender Preview in RenderPipeline