[Bf-extensions-cvs] [e1d8c70] master: Fix T46365: Export UV Layout to PNG not working (missing context messages part).

Bastien Montagne noreply at git.blender.org
Sun Oct 4 11:38:25 CEST 2015


Commit: e1d8c70bbb5776041383335f986b28b33d18f8ff
Author: Bastien Montagne
Date:   Sun Oct 4 11:37:12 2015 +0200
Branches: master
https://developer.blender.org/rBAe1d8c70bbb5776041383335f986b28b33d18f8ff

Fix T46365: Export UV Layout to PNG not working (missing context messages part).

Cannot reproduce the crash, let's see whether those missing context stuff fix it as well...

===================================================================

M	io_mesh_uv_layout/__init__.py
M	io_mesh_uv_layout/export_uv_eps.py
M	io_mesh_uv_layout/export_uv_png.py
M	io_mesh_uv_layout/export_uv_svg.py

===================================================================

diff --git a/io_mesh_uv_layout/__init__.py b/io_mesh_uv_layout/__init__.py
index 30dff94..811430d 100644
--- a/io_mesh_uv_layout/__init__.py
+++ b/io_mesh_uv_layout/__init__.py
@@ -21,7 +21,7 @@
 bl_info = {
     "name": "UV Layout",
     "author": "Campbell Barton, Matt Ebb",
-    "version": (1, 1, 1),
+    "version": (1, 1, 2),
     "blender": (2, 75, 0),
     "location": "Image-Window > UVs > Export UV Layout",
     "description": "Export the UV layout as a 2D graphic",
@@ -199,7 +199,7 @@ class ExportUVLayout(bpy.types.Operator):
         else:
             mesh = obj.data
 
-        func(fw, mesh, self.size[0], self.size[1], self.opacity,
+        func(fw, context, mesh, self.size[0], self.size[1], self.opacity,
              lambda: self._face_uv_iter(context, mesh, self.tessellated))
 
         if self.modified:
diff --git a/io_mesh_uv_layout/export_uv_eps.py b/io_mesh_uv_layout/export_uv_eps.py
index a15dc26..271ab5e 100644
--- a/io_mesh_uv_layout/export_uv_eps.py
+++ b/io_mesh_uv_layout/export_uv_eps.py
@@ -21,7 +21,7 @@
 import bpy
 
 
-def write(fw, mesh, image_width, image_height, opacity, face_iter_func):
+def write(fw, context, mesh, image_width, image_height, opacity, face_iter_func):
     fw("%!PS-Adobe-3.0 EPSF-3.0\n")
     fw("%%%%Creator: Blender %s\n" % bpy.app.version_string)
     fw("%%Pages: 1\n")
diff --git a/io_mesh_uv_layout/export_uv_png.py b/io_mesh_uv_layout/export_uv_png.py
index 5da543c..c5ba3a3 100644
--- a/io_mesh_uv_layout/export_uv_png.py
+++ b/io_mesh_uv_layout/export_uv_png.py
@@ -21,7 +21,7 @@
 import bpy
 
 
-def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func):
+def write(fw, context, mesh_source, image_width, image_height, opacity, face_iter_func):
     filepath = fw.__self__.name
     fw.__self__.close()
 
@@ -133,7 +133,8 @@ def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func):
 
     scene.update()
 
-    data_context = {"blend_data": bpy.context.blend_data, "scene": scene}
+    data_context = context.copy()
+    data_context.update((("blend_data", bpy.context.blend_data), ("scene", scene)))
     bpy.ops.render.render(data_context, write_still=True)
 
     # cleanup
diff --git a/io_mesh_uv_layout/export_uv_svg.py b/io_mesh_uv_layout/export_uv_svg.py
index 764f0d3..d237821 100644
--- a/io_mesh_uv_layout/export_uv_svg.py
+++ b/io_mesh_uv_layout/export_uv_svg.py
@@ -21,7 +21,7 @@
 import bpy
 
 
-def write(fw, mesh, image_width, image_height, opacity, face_iter_func):
+def write(fw, context, mesh, image_width, image_height, opacity, face_iter_func):
     # for making an XML compatible string
     from xml.sax.saxutils import escape
     from os.path import basename



More information about the Bf-extensions-cvs mailing list