Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender 5.2.1 #2022

Merged
merged 1 commit into from Apr 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified Exporters/Blender/Blender2Babylon-5.2.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions Exporters/Blender/src/babylon-js/__init__.py
@@ -1,7 +1,7 @@
bl_info = {
'name': 'Babylon.js',
'author': 'David Catuhe, Jeff Palmer',
'version': (5, 2, 0),
'version': (5, 2, 1),
'blender': (2, 76, 0),
'location': 'File > Export > Babylon.js (.babylon)',
'description': 'Export Babylon.js scenes (.babylon)',
Expand All @@ -11,7 +11,7 @@

# allow module to be changed during a session (dev purposes)
if "bpy" in locals():
print('Reloading TOB exporter')
print('Reloading .babylon exporter')
import imp
imp.reload(animation)
imp.reload(armature)
Expand Down
5 changes: 4 additions & 1 deletion Exporters/Blender/src/babylon-js/json_exporter.py
Expand Up @@ -66,6 +66,7 @@ def execute(self, context, filepath):
self.materials = []
self.multiMaterials = []
self.sounds = []
self.needPhysics = False

# Scene level sound
if scene.attachedSound != '':
Expand Down Expand Up @@ -102,6 +103,8 @@ def execute(self, context, filepath):
Logger.log(self.fatalError)
return

if hasattr(mesh, 'physicsImpostor'): self.needPhysics = True

if hasattr(mesh, 'instances'):
self.meshesAndNodes.append(mesh)
else:
Expand Down Expand Up @@ -161,7 +164,7 @@ def to_scene_file(self):
file_handler = open(self.filepathMinusExtension + '.babylon', 'w', encoding='utf8')
file_handler.write('{')
file_handler.write('"producer":{"name":"Blender","version":"' + bpy.app.version_string + '","exporter_version":"' + format_exporter_version() + '","file":"' + JsonExporter.nameSpace + '.babylon"},\n')
self.world.to_scene_file(file_handler)
self.world.to_scene_file(file_handler, self.needPhysics)

# Materials
file_handler.write(',\n"materials":[')
Expand Down
7 changes: 5 additions & 2 deletions Exporters/Blender/src/babylon-js/world.py
Expand Up @@ -31,12 +31,15 @@ def __init__(self, scene):

Logger.log('Python World class constructor completed')
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def to_scene_file(self, file_handler):
def to_scene_file(self, file_handler, needPhysics):
write_bool(file_handler, 'autoClear', self.autoClear, True)
write_color(file_handler, 'clearColor', self.clear_color)
write_color(file_handler, 'ambientColor', self.ambient_color)
write_vector(file_handler, 'gravity', self.gravity)


if needPhysics:
write_bool(file_handler, 'physicsEnabled', True)

if hasattr(self, 'fogMode'):
write_int(file_handler, 'fogMode', self.fogMode)
write_color(file_handler, 'fogColor', self.fogColor)
Expand Down