[Bf-extensions-cvs] [d023f6e] blender-v2.78-release: Fix T49270: UV Export layout broken since new datablock handling.

Bastien Montagne noreply at git.blender.org
Wed Sep 14 10:23:12 CEST 2016


Commit: d023f6e8de71a35ca13caa535a131b4a43f93b92
Author: Bastien Montagne
Date:   Tue Sep 6 11:56:43 2016 +0200
Branches: blender-v2.78-release
https://developer.blender.org/rBAd023f6e8de71a35ca13caa535a131b4a43f93b92

Fix T49270: UV Export layout broken since new datablock handling.

RNA API to remove datablocks has been unified, no more implicit unlinking is done
like it used to be for some types (most notably Scenes)...

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

M	io_mesh_uv_layout/export_uv_png.py

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

diff --git a/io_mesh_uv_layout/export_uv_png.py b/io_mesh_uv_layout/export_uv_png.py
index 5da543c..51daeb7 100644
--- a/io_mesh_uv_layout/export_uv_png.py
+++ b/io_mesh_uv_layout/export_uv_png.py
@@ -137,14 +137,14 @@ def write(fw, mesh_source, image_width, image_height, opacity, face_iter_func):
     bpy.ops.render.render(data_context, write_still=True)
 
     # cleanup
-    bpy.data.scenes.remove(scene)
-    bpy.data.objects.remove(obj_cam)
-    bpy.data.objects.remove(obj_solid)
-    bpy.data.objects.remove(obj_wire)
+    bpy.data.scenes.remove(scene, do_unlink=True)
+    bpy.data.objects.remove(obj_cam, do_unlink=True)
+    bpy.data.objects.remove(obj_solid, do_unlink=True)
+    bpy.data.objects.remove(obj_wire, do_unlink=True)
 
-    bpy.data.cameras.remove(cam)
-    bpy.data.meshes.remove(mesh)
+    bpy.data.cameras.remove(cam, do_unlink=True)
+    bpy.data.meshes.remove(mesh, do_unlink=True)
 
-    bpy.data.materials.remove(material_wire)
+    bpy.data.materials.remove(material_wire, do_unlink=True)
     for mat_solid in material_solids:
-        bpy.data.materials.remove(mat_solid)
+        bpy.data.materials.remove(mat_solid, do_unlink=True)



More information about the Bf-extensions-cvs mailing list