Doc: simplify T72883 fix

Code example made it seem setting the active object was more complex
than a single assignment.
This commit is contained in:
Campbell Barton 2020-02-11 11:27:01 +11:00
parent 1c61f3e018
commit 7d6c08beb8
1 changed files with 1 additions and 5 deletions

View File

@ -230,11 +230,7 @@ though they may be changed by running API functions or by using the data API.
So ``bpy.context.active_object = obj`` will raise an error.
But the following will work as expected:
>>> obj = bpy.data.objects["Cube"]
>>> obj.select_set(state = True, view_layer = bpy.context.view_layer)
>>> bpy.context.view_layer.objects.active = obj
But ``bpy.context.view_layer.objects.active = obj`` works as expected.
The context attributes change depending on where they are accessed.
The 3D Viewport has different context members than the Python Console,