Fix T45746: PNG UV layout export is blank with new depsgraph.

Looks like we need an explicit Scene.update() call here...
This commit is contained in:
Bastien Montagne 2015-08-12 15:34:39 +02:00
parent 94abe3b97f
commit 4c142e5920
Notes: blender-bot 2023-02-14 19:54:14 +01:00
Referenced by issue #45746, UV layout export is blank
2 changed files with 5 additions and 4 deletions

View File

@ -21,13 +21,12 @@
bl_info = {
"name": "UV Layout",
"author": "Campbell Barton, Matt Ebb",
"version": (1, 1),
"blender": (2, 62, 0),
"version": (1, 1, 1),
"blender": (2, 75, 0),
"location": "Image-Window > UVs > Export UV Layout",
"description": "Export the UV layout as a 2D graphic",
"warning": "",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
"Scripts/Import-Export/UV_Layout",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/UV_Layout",
"support": 'OFFICIAL',
"category": "Import-Export",
}

View File

@ -131,6 +131,8 @@ def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func):
scene.render.image_settings.file_format = 'PNG'
scene.render.filepath = filepath
scene.update()
data_context = {"blend_data": bpy.context.blend_data, "scene": scene}
bpy.ops.render.render(data_context, write_still=True)