Fix incorrect active object setting in scripts.

This commit is contained in:
2018-07-24 11:18:45 +02:00
parent 9284c051d6
commit 31c49493d1
6 changed files with 15 additions and 15 deletions

View File

@@ -238,7 +238,7 @@ class CLIP_OT_track_to_empty(Operator):
ob = bpy.data.objects.new(name=track.name, object_data=None)
ob.select_set(action='SELECT')
context.scene.objects.link(ob)
context.scene.objects.active = ob
context.view_layer.objects.active = ob
for con in ob.constraints:
if con.type == 'FOLLOW_TRACK':
@@ -314,7 +314,7 @@ class CLIP_OT_bundles_to_mesh(Operator):
ob.matrix_world = matrix
context.scene.objects.link(ob)
ob.select = True
context.scene.objects.active = ob
context.view_layer.objects.active = ob
else:
self.report({'WARNING'}, "No usable tracks selected")