Skip to content

Commit

Permalink
v1.7.3
Browse files Browse the repository at this point in the history
Former-commit-id: 580a512
  • Loading branch information
deltakosh committed Dec 13, 2013
1 parent c1ce336 commit 3de835d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 10 deletions.
Binary file modified Babylon/JSKompactor.exe
Binary file not shown.
11 changes: 6 additions & 5 deletions Babylon/Tools/babylon.sceneLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ var BABYLON = BABYLON || {};

mesh.checkCollisions = parsedMesh.checkCollisions;

// Parent
if (parsedMesh.parentId) {
mesh.parent = scene.getLastEntryByID(parsedMesh.parentId);
}

// Geometry
if (parsedMesh.delayLoadingFile) {
mesh.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
mesh.delayLoadingFile = rootUrl + parsedMesh.delayLoadingFile;
Expand Down Expand Up @@ -398,11 +404,6 @@ var BABYLON = BABYLON || {};
BABYLON.SceneLoader._ImportGeometry(parsedMesh, mesh);
}

// Parent
if (parsedMesh.parentId) {
mesh.parent = scene.getLastEntryByID(parsedMesh.parentId);
}

// Material
if (parsedMesh.materialId) {
mesh.setMaterialByID(parsedMesh.materialId);
Expand Down
42 changes: 39 additions & 3 deletions Exporters/Blender/io_export_babylon.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bl_info = {
"name": "Babylon.js",
"author": "David Catuhe",
"version": (1, 0),
"version": (1, 1),
"blender": (2, 67, 0),
"location": "File > Export > Babylon.js (.babylon)",
"description": "Export Babylon.js scenes (.babylon)",
Expand Down Expand Up @@ -675,6 +675,38 @@ def export_mesh(object, scene, file_handler, multiMaterials):

# Closing
file_handler.write("}")

def export_node(object, scene, file_handler):
# Transform
loc = mathutils.Vector((0, 0, 0))
rot = mathutils.Quaternion((0, 0, 0, 1))
scale = mathutils.Vector((1, 1, 1))

world = object.matrix_world
if (object.parent):
world = object.parent.matrix_world.inverted() * object.matrix_world

loc, rot, scale = world.decompose()

# Writing node
file_handler.write("{")

Export_babylon.write_string(file_handler, "name", object.name, True)
Export_babylon.write_string(file_handler, "id", object.name)
if object.parent != None:
Export_babylon.write_string(file_handler, "parentId", object.parent.name)

Export_babylon.write_vector(file_handler, "position", loc)
Export_babylon.write_vectorScaled(file_handler, "rotation", rot.to_euler("XYZ"), -1)
Export_babylon.write_vector(file_handler, "scaling", scale)
Export_babylon.write_bool(file_handler, "isVisible", False)
Export_babylon.write_bool(file_handler, "isEnabled", True)
Export_babylon.write_bool(file_handler, "checkCollisions", False)
Export_babylon.write_int(file_handler, "billboardMode", 0)
Export_babylon.write_bool(file_handler, "receiveShadows", False)

# Closing
file_handler.write("}")

def export_shadowGenerator(lamp, scene, file_handler):
file_handler.write("{")
Expand Down Expand Up @@ -870,12 +902,16 @@ def save(operator, context, filepath="",
multiMaterials = []
first = True
for object in [object for object in scene.objects]:
if (object.type == 'MESH'):
if object.type == 'MESH' or object.type == 'EMPTY':
if first != True:
file_handler.write(",")

first = False
data_string = Export_babylon.export_mesh(object, scene, file_handler, multiMaterials)
if object.type == 'MESH':
data_string = Export_babylon.export_mesh(object, scene, file_handler, multiMaterials)
else:
data_string = Export_babylon.export_node(object, scene, file_handler)

file_handler.write("]")

# Multi-materials
Expand Down
2 changes: 1 addition & 1 deletion babylon.1.7.2.js → babylon.1.7.3.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion what's new.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Changes list
Changes list
============
- 1.7.3:
- **Updates**
- Support for "file://" moniker ([davrous](https://github.com/davrous))
- Support for DAE (COLLADA) file format ([gwenael-hagenmuller](https://github.com/gwenael-hagenmuller))
- Support for "empty" object type in Blender exporter ([deltakosh](http://www.github.com/deltakosh))
- **Bugfixes**
- "use strict" is no more included in minified version ([deltakosh](http://www.github.com/deltakosh))
- Fixing a bug with MSGesture with IE11 on Windows 7 ([deltakosh](http://www.github.com/deltakosh))
- 1.7.0:
- **Major updates**
- Support for [lens flares](https://github.com/BabylonJS/Babylon.js/wiki/How-to-use-lens-flares) ([deltakosh](http://www.github.com/deltakosh))
Expand Down

0 comments on commit 3de835d

Please sign in to comment.