[Bf-blender-cvs] [fd65ebf39a7] blender2.8: Fix T57776: Error when adding a Torus to the scene.

Bastien Montagne noreply at git.blender.org
Sun Nov 11 11:23:42 CET 2018


Commit: fd65ebf39a708fb57b8fe3ebbe14111380849f97
Author: Bastien Montagne
Date:   Sun Nov 11 11:22:38 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBfd65ebf39a708fb57b8fe3ebbe14111380849f97

Fix T57776: Error when adding a Torus to the scene.

Not all Object.select_set() cases had been updated to new API... Tsst. ;)

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

M	release/scripts/modules/bpy_extras/object_utils.py
M	release/scripts/startup/bl_operators/clip.py
M	release/scripts/startup/bl_operators/object.py
M	release/scripts/startup/bl_operators/rigidbody.py
M	tests/python/view_layer/test_object_copy.py
M	tests/python/view_layer/view_layer_common.py

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

diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index dbb4a376099..4fa090b7336 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -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
 
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index 53bd7ccbb7a..975a59e1a36 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -237,7 +237,7 @@ class CLIP_OT_track_to_empty(Operator):
 
         ob = bpy.data.objects.new(name=track.name, object_data=None)
         context.collection.objects.link(ob)
-        ob.select_set(action='SELECT')
+        ob.select_set(True)
         context.view_layer.objects.active = ob
 
         for con in ob.constraints:
@@ -516,7 +516,7 @@ class CLIP_OT_constraint_to_fcurve(Operator):
         # XXX, should probably use context.selected_editable_objects
         # since selected objects can be from a lib or in hidden layer!
         for ob in scene.objects:
-            if ob.select_set(action='SELECT'):
+            if ob.select_set(True):
                 self._bake_object(scene, ob)
 
         return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index a24f6a742c1..fddf15155fc 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -92,7 +92,7 @@ class SelectPattern(Operator):
                         if item_parent is not None:
                             item_parent.select_tail = True
                 else:
-                    item.select_set(action='SELECT')
+                    item.select_set(True)
 
         return {'FINISHED'}
 
@@ -139,7 +139,7 @@ class SelectCamera(Operator):
                 bpy.ops.object.select_all(action='DESELECT')
             view_layer.objects.active = camera
             # camera.hide = False  # XXX TODO where is this now?
-            camera.select_set(action='SELECT')
+            camera.select_set(True)
             return {'FINISHED'}
 
         return {'CANCELLED'}
@@ -205,7 +205,7 @@ class SelectHierarchy(Operator):
                 bpy.ops.object.select_all(action='DESELECT')
 
             for obj in select_new:
-                obj.select_set(action='SELECT')
+                obj.select_set(True)
 
             view_layer.objects.active = act_new
             return {'FINISHED'}
@@ -646,8 +646,8 @@ class MakeDupliFace(Operator):
             ob_new.use_dupli_faces_scale = True
             ob_new.dupli_faces_scale = 1.0 / SCALE_FAC
 
-            ob_inst.select_set(action='SELECT')
-            ob_new.select_set(action='SELECT')
+            ob_inst.select_set(True)
+            ob_new.select_set(True)
 
     def execute(self, context):
         self._main(context)
diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py
index b98538dd20b..cca01a6f2fa 100644
--- a/release/scripts/startup/bl_operators/rigidbody.py
+++ b/release/scripts/startup/bl_operators/rigidbody.py
@@ -65,7 +65,7 @@ class CopyRigidbodySettings(Operator):
         # deselect all but mesh objects
         for o in context.selected_objects:
             if o.type != 'MESH':
-                o.select_set(action='DESELECT')
+                o.select_set(False)
             elif o.rigid_body is None:
                 # Add rigidbody to object!
                 view_layer.objects.active = o
@@ -127,7 +127,7 @@ class BakeToKeyframes(Operator):
         # filter objects selection
         for obj in context.selected_objects:
             if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE':
-                obj.select_set(action='DESELECT')
+                obj.select_set(False)
 
         objects = context.selected_objects
 
@@ -266,7 +266,7 @@ class ConnectRigidBodies(Operator):
         ob.location = loc
         context.scene.objects.link(ob)
         context.view_layer.objects.active = ob
-        ob.select_set(action='SELECT')
+        ob.select_set(True)
 
         bpy.ops.rigidbody.constraint_add()
         con_obj = context.active_object
@@ -311,7 +311,7 @@ class ConnectRigidBodies(Operator):
             # restore selection
             bpy.ops.object.select_all(action='DESELECT')
             for obj in objects:
-                obj.select_set(action='SELECT')
+                obj.select_set(True)
             view_layer.objects.active = obj_act
             return {'FINISHED'}
         else:
diff --git a/tests/python/view_layer/test_object_copy.py b/tests/python/view_layer/test_object_copy.py
index 19a7c56b989..2ca5e170192 100644
--- a/tests/python/view_layer/test_object_copy.py
+++ b/tests/python/view_layer/test_object_copy.py
@@ -46,7 +46,7 @@ class UnitTesting(ViewLayerTesting):
             if mode == 'DUPLICATE':
                 # assuming the latest layer is the active layer
                 bpy.ops.object.select_all(action='DESELECT')
-                three_c.select_set(action='SELECT')
+                three_c.select_set(True)
                 bpy.ops.object.duplicate()
 
             elif mode == 'NAMED':
diff --git a/tests/python/view_layer/view_layer_common.py b/tests/python/view_layer/view_layer_common.py
index 25cf7c80d96..709ef4afbfe 100644
--- a/tests/python/view_layer/view_layer_common.py
+++ b/tests/python/view_layer/view_layer_common.py
@@ -416,7 +416,7 @@ class ViewLayerTesting(unittest.TestCase):
             elif del_mode == 'OPERATOR':
                 bpy.context.scene.update()  # update depsgraph
                 bpy.ops.object.select_all(action='DESELECT')
-                ob.select_set(action='SELECT')
+                ob.select_set(True)
                 self.assertTrue(ob.select_get())
                 bpy.ops.object.delete()



More information about the Bf-blender-cvs mailing list