RNA: Object.select_set use boolean, only select

- Was setting active state, making it necessary to backup/restore
  active object in cases where this isn't needed.
  Existing scripts are explicitly setting the active object when needed.

- Use a boolean select arg (toggle selection wasn't used anywhere).

- Add an optional view layer argument since scripts should be able to
  operate outside the user context.
This commit is contained in:
Campbell Barton
2018-11-08 08:51:03 +11:00
parent c121bc6219
commit f12d2adc87
13 changed files with 27 additions and 42 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ class UnitTesting(ViewLayerTesting):
layer = bpy.context.view_layer
original_cube = layer.objects.get('Cube')
original_cube.select_set('SELECT')
original_cube.select_set(True)
self.assertTrue(original_cube.select_get())
bpy.ops.scene.new(type='FULL_COPY')