diff options
author | NBurn <7nburn@gmail.com> | 2019-01-29 04:04:35 +0300 |
---|---|---|
committer | NBurn <7nburn@gmail.com> | 2019-01-29 04:04:35 +0300 |
commit | edd2de62eb13284f7e02256701fec1483973018d (patch) | |
tree | 02a6ab0c10b9131e346d2e55b36bfd14873fafa3 /camera_turnaround.py | |
parent | bdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff) |
addons: view_layer.objects.active syntax update
Diffstat (limited to 'camera_turnaround.py')
-rw-r--r-- | camera_turnaround.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/camera_turnaround.py b/camera_turnaround.py index 5bb5c620..8ea44e6d 100644 --- a/camera_turnaround.py +++ b/camera_turnaround.py @@ -89,7 +89,7 @@ class RunAction(Operator): # ------------------------- bpy.ops.object.select_all(False) myempty.select_set(True) - context.scene.objects.active = myempty + context.view_layer.objects.active = myempty # save current configuration savedinterpolation = context.preferences.edit.keyframe_new_interpolation_type # change interpolation mode @@ -158,7 +158,7 @@ class RunAction(Operator): # Track constraint if turn_camera.track is True: - bpy.context.scene.objects.active = camera + bpy.context.view_layer.objects.active = camera bpy.ops.object.constraint_add(type='TRACK_TO') bpy.context.object.constraints[-1].track_axis = 'TRACK_NEGATIVE_Z' bpy.context.object.constraints[-1].up_axis = 'UP_Y' @@ -173,7 +173,7 @@ class RunAction(Operator): # ------------------------- bpy.ops.object.select_all(False) selectobject.select_set(True) - bpy.context.scene.objects.active = selectobject + bpy.context.view_layer.objects.active = selectobject bpy.context.scene.frame_set(savedframe) return {'FINISHED'} |