Fix T57776: Error when adding a Torus to the scene.
Not all Object.select_set() cases had been updated to new API... Tsst. ;)
This commit is contained in:
@@ -125,7 +125,7 @@ def object_data_add(context, obdata, operator=None, name=None):
|
||||
scene_collection = layer_collection.collection
|
||||
|
||||
for ob in layer.objects:
|
||||
ob.select_set(action='DESELECT')
|
||||
ob.select_set(False)
|
||||
|
||||
if name is None:
|
||||
name = "Object" if obdata is None else obdata.name
|
||||
@@ -133,7 +133,7 @@ def object_data_add(context, obdata, operator=None, name=None):
|
||||
obj_act = layer.objects.active
|
||||
obj_new = bpy.data.objects.new(name, obdata)
|
||||
scene_collection.objects.link(obj_new)
|
||||
obj_new.select_set(action='SELECT')
|
||||
obj_new.select_set(True)
|
||||
obj_new.matrix_world = add_object_align_init(context, operator)
|
||||
|
||||
# XXX
|
||||
@@ -155,10 +155,10 @@ def object_data_add(context, obdata, operator=None, name=None):
|
||||
|
||||
if obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type:
|
||||
bpy.ops.mesh.select_all(action='DESELECT')
|
||||
obj_act.select_set(action='SELECT')
|
||||
obj_act.select_set(True)
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
||||
obj_act.select_set(action='SELECT')
|
||||
obj_act.select_set(True)
|
||||
scene.update() # apply location
|
||||
# layer.objects.active = obj_new
|
||||
|
||||
|
||||
Reference in New Issue
Block a user