diff options
Diffstat (limited to 'mesh_tissue')
-rw-r--r-- | mesh_tissue/dual_mesh.py | 4 | ||||
-rw-r--r-- | mesh_tissue/lattice.py | 12 | ||||
-rw-r--r-- | mesh_tissue/tessellate_numpy.py | 10 | ||||
-rw-r--r-- | mesh_tissue/uv_to_mesh.py | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/mesh_tissue/dual_mesh.py b/mesh_tissue/dual_mesh.py index d983d873..34b68c55 100644 --- a/mesh_tissue/dual_mesh.py +++ b/mesh_tissue/dual_mesh.py @@ -139,7 +139,7 @@ class dual_mesh(Operator): ob.data = ob.data.copy() bpy.ops.object.select_all(action='DESELECT') ob.select_set(True) - bpy.context.scene.objects.active = ob0 + bpy.context.view_layer.objects.active = ob0 bpy.ops.object.mode_set(mode='EDIT') # prevent borders erosion @@ -276,7 +276,7 @@ class dual_mesh(Operator): for o in sel: o.select_set(True) - bpy.context.scene.objects.active = act + bpy.context.view_layer.objects.active = act bpy.ops.object.mode_set(mode=mode) return {'FINISHED'} diff --git a/mesh_tissue/lattice.py b/mesh_tissue/lattice.py index 9edcd39f..782576cd 100644 --- a/mesh_tissue/lattice.py +++ b/mesh_tissue/lattice.py @@ -338,7 +338,7 @@ class lattice_along_surface(Operator): if len(grid_mesh.polygons) > 64 * 64: bpy.ops.object.delete(use_global=False) - bpy.context.scene.objects.active = obj + bpy.context.view_layer.objects.active = obj obj.select_set(True) self.report({'ERROR'}, "Maximum resolution allowed for Lattice is 64") return {'CANCELLED'} @@ -379,7 +379,7 @@ class lattice_along_surface(Operator): if bb.z == 0: lattice.scale.z = 1 - bpy.context.scene.objects.active = obj + bpy.context.view_layer.objects.active = obj bpy.ops.object.modifier_add(type='LATTICE') obj.modifiers[-1].object = lattice @@ -387,7 +387,7 @@ class lattice_along_surface(Operator): if self.set_parent: obj.select_set(True) lattice.select_set(True) - bpy.context.scene.objects.active = lattice + bpy.context.view_layer.objects.active = lattice bpy.ops.object.parent_set(type='LATTICE') # reading grid structure @@ -436,7 +436,7 @@ class lattice_along_surface(Operator): lattice.select_set(True) obj.select_set(False) bpy.ops.object.delete(use_global=False) - bpy.context.scene.objects.active = obj + bpy.context.view_layer.objects.active = obj obj.select_set(True) bpy.ops.object.modifier_remove(modifier=obj.modifiers[-1].name) if nu > 64 or nv > 64: @@ -455,7 +455,7 @@ class lattice_along_surface(Operator): lattice.select_set(False) obj.select_set(False) bpy.ops.object.delete(use_global=False) - bpy.context.scene.objects.active = lattice + bpy.context.view_layer.objects.active = lattice lattice.select_set(True) if self.high_quality_lattice: @@ -466,7 +466,7 @@ class lattice_along_surface(Operator): if self.hide_lattice: bpy.ops.object.hide_view_set(unselected=False) - bpy.context.scene.objects.active = obj + bpy.context.view_layer.objects.active = obj obj.select_set(True) lattice.select_set(False) diff --git a/mesh_tissue/tessellate_numpy.py b/mesh_tissue/tessellate_numpy.py index f2a96d5e..5d8ed35e 100644 --- a/mesh_tissue/tessellate_numpy.py +++ b/mesh_tissue/tessellate_numpy.py @@ -889,7 +889,7 @@ class tessellate(Operator): scene = bpy.context.scene scene.objects.link(new_ob) new_ob.select_set(True) - bpy.context.scene.objects.active = new_ob + bpy.context.view_layer.objects.active = new_ob if self.merge: bpy.ops.object.mode_set(mode='EDIT') bpy.ops.mesh.select_mode( @@ -1432,7 +1432,7 @@ class settings_tessellate(Operator): scene = bpy.context.scene scene.objects.link(temp_ob) temp_ob.select_set(True) - bpy.context.scene.objects.active = temp_ob + bpy.context.view_layer.objects.active = temp_ob try: bpy.ops.object.vertex_group_copy_to_linked() @@ -1441,7 +1441,7 @@ class settings_tessellate(Operator): scene.objects.unlink(temp_ob) bpy.data.objects.remove(temp_ob) - bpy.context.scene.objects.active = self.ob + bpy.context.view_layer.objects.active = self.ob if self.merge: bpy.ops.object.mode_set(mode='EDIT') @@ -1544,9 +1544,9 @@ class rotate_face(Operator): bpy.ops.object.mode_set(mode='OBJECT') for o in [obj for obj in bpy.data.objects if obj.tissue_tessellate.generator == ob.name]: - bpy.context.scene.objects.active = o + bpy.context.view_layer.objects.active = o bpy.ops.object.update_tessellate() - bpy.context.scene.objects.active = ob + bpy.context.view_layer.objects.active = ob bpy.ops.object.mode_set(mode='EDIT') return {'FINISHED'} diff --git a/mesh_tissue/uv_to_mesh.py b/mesh_tissue/uv_to_mesh.py index 8ae59c6f..a544ff64 100644 --- a/mesh_tissue/uv_to_mesh.py +++ b/mesh_tissue/uv_to_mesh.py @@ -177,7 +177,7 @@ class uv_to_mesh(Operator): ob0.select_set(True) bpy.ops.object.delete(use_global=False) ob.select_set(True) - bpy.context.scene.objects.active = ob + bpy.context.view_layer.objects.active = ob return {'FINISHED'} |