porters

Blender


Blender to Babylon.js exporter

The Blender export plugin can be found on github repository.

An extension named Tower of Babel can also be used as exporter, see its readme to know about its functionnalities.

Features:

Scene

Blender scene properties panel

Blender BJS equivalent
Scene
scene
  • Camera: set scene activeCamera
Exporter panel
exporter-scene-options
  • Export only selected layers: objects in hidden scene layers will not be taken into account
    selected-layers
  • Flat shade entire scene: all objects will be exported as flat shaded meshes
    (tip about shading)
  • Force 64k per Mesh Vertex Limit: here to keep compatibility with old or low-cost hardware

World

Blender world properties panel

Blender Render

Blender BJS equivalent
World
world-br
  • Horizon Color: scene clearColor
  • Ambient Color: scene ambientColor
Exporter panel
mist
  • Mist: when Blender Render Mist is enabled, you have access to Fog Mode & Fog Density parameters

Object

Blender object properties panel

Blender BJS equivalent
header
  • object name will be exported as it is
Transform
transform
  • Position
  • Rotation
    • XYZ Euler
    • Quaternion
  • Scale
    • do not forget to apply Scale before exporting: 'Ctrl' + 'A' > 'Scale'
Relations
relations
  • parenting is supported

Constraints

Blender constraints properties panel

Blender BJS equivalent
constraints
  • Track To: useful when using ArcRotate camera (tip)

Cameras

Blender cameras properties panel

Blender BJS equivalent
Lens
lens
  • Field of View: fov
  • Clipping: minZ & maxZ
Exporter panel
exporter-cameras-options
  • Camera Type, choose between:
    • Arc Rotate (tip)
    • Device Orientation
    • Follow
    • Gamepad
    • Touch
    • Universal
    • Virtual Joysticks
    • VR Dev Orientation Free
    • Web VR Free

Lights

Blender lights properties panel

Blender BJS equivalent
Lamp
lamp
  • Sun as Directionnal, Area as Point, other named like in BJS
  • This Layer Only: includedOnlyMeshes
  • when Sphere is checked, Distance value is exported as range
Spot Shape
(only available when light type is Spot)
spot-shape
  • Size: Angle
  • Blend: value * 2 = exponent
Exporter panel
exporter-lights-options
  • Shadow Map (only for directional lights):
    • None
    • Standard
    • Poisson
    • ESM
    • Blur ESM

Meshes

Blender meshes properties panel

Blender BJS equivalent
Normals
normals
Auto Smooth is often use by Blender users, but is not supported.
Use an edge split modifier instead, see tip.
UV Maps
uv-maps
  • UVMap: coordinatesIndex
  • limited to 2 channels
Vertex Colors
vertex-colors
  • if multiples layers exist, they will be merge
Exporter panel
exporter-meshes-options

Materials

Blender materials properties panel

General

  • as you can notice in BJS mesh panel, materials will be suffixed by .babylon filename,
  • other options can be found on this mesh panel, like max simultaneous lights, texture size for baking, etc,
  • texture baking will be automatic when:
    • cycles render is the current render engine,
    • procedural textures are used.

Blender Render

Blender BJS equivalent
header
  • multi-materials are supported
Diffuse
diffuse
  • color intensity is multiplied by intensity value
Specular
specular
  • color intensity is multiplied by intensity value
  • Hardness: specularPower
Shading
shading
  • Emit: diffuse color * value
  • Ambient: diffuse color * value
Transparency
transparency
  • when enabled, set alpha value under Z Transparency
Specials
  • you can temporary switch to Blender Game to gain access to some materials settings:

blender-game

Blender BJS equivalent
Game Settings
game-settings
  • Backface culling: true by default
  • Face Orientation:
    • Normal
    • Billboard

Cycles Render

Blender BJS equivalent

Textures

Blender textures properties panel

General

  • Blender can handle packed images, even if their isn't source file on disk, but you have to unpack all before export,
  • about automatic baking, see Materials.

Blender Render

Blender BJS equivalent
header
  • multiple textures can be assigned
    • if two textures are assigned to the same Influence (see below), automatic baking will be used
  • this name is only used in Blender
Texture Type
type-image
  • as seen above, this name is only used in Blender
  • texture type:
    • for image file, choose Image or Movie
    • for procedural textures, choose any one but voxel data, point density, ocean
Image
image
  • texture filename will be texture name in BJS
Image Sampling
image-sampling
  • Use Alpha: hasAlpha
Image Mapping
image-mapping
  • Extension: choosing Clip will set Wrap value to 0

Cycles Render

Blender BJS equivalent
  • Name
  • Associated file
  • Level
  • Use alpha
  • uOffset / voffset
  • uScale / uScale
  • uAng / vAng / Wang
  • WrapU / WrapV
  • Coordinates index
  • Texture in-lining to .babylon file