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

This reverts commit e1d8c70bbb.

Prefer not to have speculative fixes.

The intention here is not to use the context at all,
even if doing so fixes the crash -
it may then fail silently by mixing data from different contexts,
causing further complications which are much harder to debug.
This commit is contained in:
Campbell Barton 2015-10-05 09:10:07 +11:00
parent e1d8c70bbb
commit 30b619e765
Notes: blender-bot 2023-02-14 19:53:08 +01:00
Referenced by issue #46365, PyC_IsInterpreterActive fails w/ Py3.5+, (was: Export UV Layout to PNG not working)
4 changed files with 6 additions and 7 deletions

View File

@ -21,7 +21,7 @@
bl_info = {
"name": "UV Layout",
"author": "Campbell Barton, Matt Ebb",
"version": (1, 1, 2),
"version": (1, 1, 1),
"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, context, mesh, self.size[0], self.size[1], self.opacity,
func(fw, mesh, self.size[0], self.size[1], self.opacity,
lambda: self._face_uv_iter(context, mesh, self.tessellated))
if self.modified:

View File

@ -21,7 +21,7 @@
import bpy
def write(fw, context, mesh, image_width, image_height, opacity, face_iter_func):
def write(fw, 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")

View File

@ -21,7 +21,7 @@
import bpy
def write(fw, context, mesh_source, image_width, image_height, opacity, face_iter_func):
def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func):
filepath = fw.__self__.name
fw.__self__.close()
@ -133,8 +133,7 @@ def write(fw, context, mesh_source, image_width, image_height, opacity, face_ite
scene.update()
data_context = context.copy()
data_context.update((("blend_data", bpy.context.blend_data), ("scene", scene)))
data_context = {"blend_data": bpy.context.blend_data, "scene": scene}
bpy.ops.render.render(data_context, write_still=True)
# cleanup

View File

@ -21,7 +21,7 @@
import bpy
def write(fw, context, mesh, image_width, image_height, opacity, face_iter_func):
def write(fw, 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