bugfix [#21233] Crash in pyapi, with new object.

pass the obdata as an argument rather then assigning later so as not to allow an invalid state.
This commit is contained in:
Campbell Barton
2010-02-22 00:07:46 +00:00
parent 835c353aaa
commit bc3d96678d
9 changed files with 60 additions and 27 deletions

View File

@@ -447,8 +447,7 @@ def write(filename, objects, scene,
break
if has_quads:
newob = bpy.data.objects.new('temp_object', 'MESH')
newob.data = me
newob = bpy.data.objects.new('temp_object', me)
# if we forget to set Object.data - crash
scene.objects.link(newob)
newob.convert_to_triface(scene)