From bd6e21a22e3f6fef95c4f3c40c2492402097a444 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 13 Jun 2015 15:58:43 -0400 Subject: [PATCH] Don't screw with the user's context... --- korman/exporter/mesh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/korman/exporter/mesh.py b/korman/exporter/mesh.py index 1ccad7d..9a762c1 100644 --- a/korman/exporter/mesh.py +++ b/korman/exporter/mesh.py @@ -293,11 +293,11 @@ class MeshConverter: return geospans def _export_static_lighting(self, bo): - bpy.context.scene.objects.active = bo + context = {"active_object": bo, "object": bo} if bo.plasma_modifiers.lightmap.enabled: print(" Baking lightmap...") print("====") - bpy.ops.object.plasma_lightmap_autobake() + bpy.ops.object.plasma_lightmap_autobake(context) print("====") else: for vcol_layer in bo.data.vertex_colors: @@ -306,7 +306,7 @@ class MeshConverter: break else: print(" Baking crappy vertex color lighting...") - bpy.ops.object.plasma_vertexlight_autobake() + bpy.ops.object.plasma_vertexlight_autobake(context) def _find_create_dspan(self, bo, hsgmat, pass_index):