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:
2010-02-22 00:07:46 +00:00
parent 835c353aaa
commit bc3d96678d
9 changed files with 60 additions and 27 deletions

View File

@@ -447,13 +447,11 @@ class MakeDupliFace(bpy.types.Operator):
# pick an object to use
obj = objects[0]
ob_new = bpy.data.objects.new(mesh.name, 'MESH')
ob_new.data = mesh
ob_new = bpy.data.objects.new(mesh.name, mesh)
base = scene.objects.link(ob_new)
base.layers[:] = obj.layers
ob_inst = bpy.data.objects.new(data.name, obj.type)
ob_inst.data = data
ob_inst = bpy.data.objects.new(data.name, data)
base = scene.objects.link(ob_inst)
base.layers[:] = obj.layers