Skip to content

Commit ed92022

Browse files
committed
Updated Blender 2.58 exporter with recent changes from 2.57 exporter.
(normal maps, textures packed in blend file, copy textures, urlBaseType, texture params) Also fixed broken reload handling and bumped up version number.
1 parent 70a6000 commit ed92022

File tree

2 files changed

+258
-93
lines changed

2 files changed

+258
-93
lines changed

utils/exporters/blender/2.58/scripts/addons/io_mesh_threejs/__init__.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
# Init
2121
# ################################################################
2222

23-
# To support reload properly, try to access a package var,
24-
# if it's there, reload everything
2523

2624
bl_info = {
2725
"name": "three.js format",
28-
"author": "mrdoob, kikko, alteredq, remoe",
29-
"version": (1, 0),
26+
"author": "mrdoob, kikko, alteredq, remoe, pxf",
27+
"version": (1, 0, 2),
3028
"blender": (2, 5, 7),
3129
"api": 35622,
3230
"location": "File > Import-Export",
@@ -36,14 +34,18 @@
3634
"tracker_url": "https://github.com/mrdoob/three.js/issues",
3735
"category": "Import-Export"}
3836

37+
# To support reload properly, try to access a package var,
38+
# if it's there, reload everything
39+
40+
import bpy
41+
3942
if "bpy" in locals():
4043
import imp
4144
if "export_threejs" in locals():
4245
imp.reload(export_threejs)
4346
if "import_threejs" in locals():
4447
imp.reload(import_threejs)
4548

46-
import bpy
4749
from bpy.props import *
4850
from bpy_extras.io_utils import ExportHelper, ImportHelper
4951

@@ -175,7 +177,9 @@ def save_settings_export(properties):
175177
settings = {
176178
"option_export_scene" : properties.option_export_scene,
177179
"option_embed_meshes" : properties.option_embed_meshes,
178-
180+
"option_url_base_html" : properties.option_url_base_html,
181+
"option_copy_textures" : properties.option_copy_textures,
182+
179183
"option_lights" : properties.option_lights,
180184
"option_cameras" : properties.option_cameras,
181185

@@ -225,6 +229,8 @@ def restore_settings_export(properties):
225229

226230
properties.option_export_scene = settings.get("option_export_scene", False)
227231
properties.option_embed_meshes = settings.get("option_embed_meshes", True)
232+
properties.option_url_base_html = settings.get("option_url_base_html", False)
233+
properties.option_copy_textures = settings.get("option_copy_textures", False)
228234

229235
properties.option_lights = settings.get("option_lights", False)
230236
properties.option_cameras = settings.get("option_cameras", False)
@@ -263,7 +269,9 @@ class ExportTHREEJS(bpy.types.Operator, ExportHelper):
263269

264270
option_export_scene = BoolProperty(name = "Scene", description = "Export scene", default = False)
265271
option_embed_meshes = BoolProperty(name = "Embed", description = "Embed meshes", default = True)
266-
272+
option_copy_textures = BoolProperty(name = "Copy textures", description = "Copy textures", default = False)
273+
option_url_base_html = BoolProperty(name = "HTML as url base", description = "Use HTML as url base ", default = False)
274+
267275
option_lights = BoolProperty(name = "Lights", description = "Export default scene lights", default = False)
268276
option_cameras = BoolProperty(name = "Cameras", description = "Export default scene cameras", default = False)
269277

@@ -284,6 +292,7 @@ def execute(self, context):
284292
save_settings_export(self.properties)
285293

286294
filepath = self.filepath
295+
287296
import io_mesh_threejs.export_threejs
288297
return io_mesh_threejs.export_threejs.save(self, context, **self.properties)
289298

@@ -341,11 +350,18 @@ def draw(self, context):
341350

342351
row = layout.row()
343352
row.prop(self.properties, "option_export_scene")
353+
354+
row = layout.row()
344355
row.prop(self.properties, "option_lights")
345356
row.prop(self.properties, "option_cameras")
346357

347358
row = layout.row()
348359
row.prop(self.properties, "option_embed_meshes")
360+
row.prop(self.properties, "option_copy_textures")
361+
362+
row = layout.row()
363+
row.prop(self.properties, "option_url_base_html")
364+
349365
layout.separator()
350366

351367

0 commit comments

Comments
 (0)