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 /add_advanced_objects_menu | |
parent | bdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff) |
addons: view_layer.objects.active syntax update
Diffstat (limited to 'add_advanced_objects_menu')
-rw-r--r-- | add_advanced_objects_menu/circle_array.py | 8 | ||||
-rw-r--r-- | add_advanced_objects_menu/cubester.py | 4 | ||||
-rw-r--r-- | add_advanced_objects_menu/make_struts.py | 4 | ||||
-rw-r--r-- | add_advanced_objects_menu/mesh_easylattice.py | 2 | ||||
-rw-r--r-- | add_advanced_objects_menu/oscurart_chain_maker.py | 4 | ||||
-rw-r--r-- | add_advanced_objects_menu/pixelate_3d.py | 2 | ||||
-rw-r--r-- | add_advanced_objects_menu/random_box_structure.py | 6 | ||||
-rw-r--r-- | add_advanced_objects_menu/trilighting.py | 2 |
8 files changed, 16 insertions, 16 deletions
diff --git a/add_advanced_objects_menu/circle_array.py b/add_advanced_objects_menu/circle_array.py index acec375f..6d4a9459 100644 --- a/add_advanced_objects_menu/circle_array.py +++ b/add_advanced_objects_menu/circle_array.py @@ -90,7 +90,7 @@ class Circle_Array(Operator): check_mod.use_relative_offset = False else: # fallback - bpy.context.scene.objects.active = active + bpy.context.view_layer.objects.active = active bpy.ops.object.modifier_add(type='ARRAY') active.modifiers[0].use_object_offset = True active.modifiers[0].use_relative_offset = False @@ -98,7 +98,7 @@ class Circle_Array(Operator): active.modifiers[0].use_object_offset = True active.modifiers[0].use_relative_offset = False active.select_set(False) - bpy.context.scene.objects.active = context.active_object + bpy.context.view_layer.objects.active = context.active_object bpy.ops.view3d.snap_cursor_to_selected() if active.modifiers[0].offset_object is None: @@ -109,7 +109,7 @@ class Circle_Array(Operator): else: empty_name = active.modifiers[0].offset_object - bpy.context.scene.objects.active = active + bpy.context.view_layer.objects.active = active num = active.modifiers["Array"].count rotate_num = 360 / num active.select_set(True) @@ -134,7 +134,7 @@ class Circle_Array(Operator): else: empty_name = active.modifiers[0].offset_object - bpy.context.scene.objects.active = active + bpy.context.view_layer.objects.active = active num = active.modifiers["Array"].count rotate_num = 360 / num active.select_set(True) diff --git a/add_advanced_objects_menu/cubester.py b/add_advanced_objects_menu/cubester.py index 3d95613e..6c4f8dfd 100644 --- a/add_advanced_objects_menu/cubester.py +++ b/add_advanced_objects_menu/cubester.py @@ -198,7 +198,7 @@ def create_mesh_from_audio(self, scene, verts, faces): mesh.from_pydata(verts, [], faces) ob = bpy.data.objects.new("cubed", mesh) bpy.context.scene.objects.link(ob) - bpy.context.scene.objects.active = ob + bpy.context.view_layer.objects.active = ob ob.select_set(True) # initial vertex colors @@ -413,7 +413,7 @@ def create_mesh_from_image(self, scene, verts, faces): mesh.from_pydata(verts, [], faces) ob = bpy.data.objects.new("cubed", mesh) context.scene.objects.link(ob) - context.scene.objects.active = ob + context.view_layer.objects.active = ob ob.select_set(True) # uv unwrap diff --git a/add_advanced_objects_menu/make_struts.py b/add_advanced_objects_menu/make_struts.py index b88c478d..57cede0a 100644 --- a/add_advanced_objects_menu/make_struts.py +++ b/add_advanced_objects_menu/make_struts.py @@ -420,7 +420,7 @@ def build_edge_frames(edges): def make_manifold_struts(truss_obj, od, segments): - bpy.context.scene.objects.active = truss_obj + bpy.context.view_layer.objects.active = truss_obj bpy.ops.object.editmode_toggle() truss_mesh = bmesh.from_edit_mesh(truss_obj.data).copy() bpy.ops.object.editmode_toggle() @@ -494,7 +494,7 @@ def create_struts(self, context, ind, od, segments, solid, loops, manifold): bpy.context.scene.objects.link(obj) obj.select_set(True) obj.location = truss_obj.location - bpy.context.scene.objects.active = obj + bpy.context.view_layer.objects.active = obj mesh.update() diff --git a/add_advanced_objects_menu/mesh_easylattice.py b/add_advanced_objects_menu/mesh_easylattice.py index 585a343f..6c8fa49f 100644 --- a/add_advanced_objects_menu/mesh_easylattice.py +++ b/add_advanced_objects_menu/mesh_easylattice.py @@ -255,7 +255,7 @@ def main(context, lat_props): bpy.ops.object.select_all(action='DESELECT') bpy.ops.object.select_pattern(pattern=lat.name, extend=False) - context.scene.objects.active = lat + context.view_layer.objects.active = lat context.scene.update() diff --git a/add_advanced_objects_menu/oscurart_chain_maker.py b/add_advanced_objects_menu/oscurart_chain_maker.py index 8624dea5..b6fca005 100644 --- a/add_advanced_objects_menu/oscurart_chain_maker.py +++ b/add_advanced_objects_menu/oscurart_chain_maker.py @@ -207,7 +207,7 @@ def makeChain(self, context, mult, curverig): # select the curve bpy.ops.object.select_all(action='DESELECT') bpy.data.objects['Cable'].select = 1 - bpy.context.scene.objects.active = bpy.data.objects['Cable'] + bpy.context.view_layer.objects.active = bpy.data.objects['Cable'] # switch to Edit mode bpy.ops.object.mode_set(mode='EDIT') @@ -223,7 +223,7 @@ def makeChain(self, context, mult, curverig): bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.select_all(action='DESELECT') ACTARM.select = 1 - bpy.context.scene.objects.active = bpy.data.objects['Armature'] + bpy.context.view_layer.objects.active = bpy.data.objects['Armature'] bpy.ops.object.mode_set(mode='POSE') bpy.ops.pose.select_all(action='DESELECT') ACTARM.data.bones[-1].select = 1 diff --git a/add_advanced_objects_menu/pixelate_3d.py b/add_advanced_objects_menu/pixelate_3d.py index 10032e62..ea7c0e82 100644 --- a/add_advanced_objects_menu/pixelate_3d.py +++ b/add_advanced_objects_menu/pixelate_3d.py @@ -60,7 +60,7 @@ def pix(self, obj): sca = self.size * (100 - self.gap) * .005 bpy.ops.mesh.primitive_cube_add(layers=[True] + [False] * 19) bpy.ops.transform.resize(value=[sca] * 3) - bpy.context.scene.objects.active = dup + bpy.context.view_layer.objects.active = dup bpy.ops.object.parent_set(type='OBJECT') diff --git a/add_advanced_objects_menu/random_box_structure.py b/add_advanced_objects_menu/random_box_structure.py index 7d6edbdd..dfa151cf 100644 --- a/add_advanced_objects_menu/random_box_structure.py +++ b/add_advanced_objects_menu/random_box_structure.py @@ -102,7 +102,7 @@ class makestructure(Operator): for obj in oblst: bpy.ops.object.select_pattern(pattern=obj.name) # Select base mesh - bpy.context.scene.objects.active = obj + bpy.context.view_layer.objects.active = obj if obj.data.uv_layers[:] != []: uvyes = 1 else: @@ -173,7 +173,7 @@ class makestructure(Operator): constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True ) - bpy.context.scene.objects.active = obj # Again needed to avoid poll() taking me down + bpy.context.view_layer.objects.active = obj # Again needed to avoid poll() taking me down bpy.ops.object.make_links_data(type='MODIFIERS') bpy.ops.object.make_links_data(type='MATERIAL') @@ -181,7 +181,7 @@ class makestructure(Operator): bpy.ops.object.join_uvs() bpy.ops.collection.objects_remove() - bpy.context.scene.objects.active = select + bpy.context.view_layer.objects.active = select if self.dc is True: bpy.context.scene.objects.unlink(obj) diff --git a/add_advanced_objects_menu/trilighting.py b/add_advanced_objects_menu/trilighting.py index 000df5a7..0a6c0ce4 100644 --- a/add_advanced_objects_menu/trilighting.py +++ b/add_advanced_objects_menu/trilighting.py @@ -129,7 +129,7 @@ class TriLighting(Operator): camera = cam_obj bpy.ops.view3d.viewnumpad(type='TOP') - obj = bpy.context.scene.objects.active + obj = bpy.context.view_layer.objects.active # Calculate Energy for each Lamp if(self.contrast > 0): |