Skip to content
Snippets Groups Projects
Commit e1d8c70b authored by Bastien Montagne's avatar Bastien Montagne
Browse files

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...
parent 5d62a34f
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
bl_info = { bl_info = {
"name": "UV Layout", "name": "UV Layout",
"author": "Campbell Barton, Matt Ebb", "author": "Campbell Barton, Matt Ebb",
"version": (1, 1, 1), "version": (1, 1, 2),
"blender": (2, 75, 0), "blender": (2, 75, 0),
"location": "Image-Window > UVs > Export UV Layout", "location": "Image-Window > UVs > Export UV Layout",
"description": "Export the UV layout as a 2D graphic", "description": "Export the UV layout as a 2D graphic",
...@@ -199,7 +199,7 @@ class ExportUVLayout(bpy.types.Operator): ...@@ -199,7 +199,7 @@ class ExportUVLayout(bpy.types.Operator):
else: else:
mesh = obj.data 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)) lambda: self._face_uv_iter(context, mesh, self.tessellated))
if self.modified: if self.modified:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import bpy 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("%!PS-Adobe-3.0 EPSF-3.0\n")
fw("%%%%Creator: Blender %s\n" % bpy.app.version_string) fw("%%%%Creator: Blender %s\n" % bpy.app.version_string)
fw("%%Pages: 1\n") fw("%%Pages: 1\n")
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import bpy 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 filepath = fw.__self__.name
fw.__self__.close() fw.__self__.close()
...@@ -133,7 +133,8 @@ def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func): ...@@ -133,7 +133,8 @@ def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func):
scene.update() 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) bpy.ops.render.render(data_context, write_still=True)
# cleanup # cleanup
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import bpy 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 # for making an XML compatible string
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from os.path import basename from os.path import basename
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment