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

@@ -322,8 +322,7 @@ class AddGear(bpy.types.Operator):
mesh.update()
ob_new = bpy.data.objects.new('Gear','MESH')
ob_new.data = mesh
ob_new = bpy.data.objects.new('Gear', mesh)
tipgroup = ob_new.add_vertex_group('Tips')
# for some reason the name does not 'stick' and we have to set it this way: