diff options
author | NBurn <7nburn@gmail.com> | 2019-01-29 17:08:23 +0300 |
---|---|---|
committer | NBurn <7nburn@gmail.com> | 2019-01-29 17:08:23 +0300 |
commit | 5c994fde52196dfe8a7e0db03b6935bac001d353 (patch) | |
tree | a7836a0741695b78df699e59a30f2a527202a815 /add_mesh_extra_objects | |
parent | 8b93448f56ecdf9c91ad1b6297580eedf1f6e18f (diff) |
addons: more view_layer syntax updates
Diffstat (limited to 'add_mesh_extra_objects')
-rw-r--r-- | add_mesh_extra_objects/Wallfactory.py | 4 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_round_brilliant.py | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/add_mesh_extra_objects/Wallfactory.py b/add_mesh_extra_objects/Wallfactory.py index f7edf659..1f36d884 100644 --- a/add_mesh_extra_objects/Wallfactory.py +++ b/add_mesh_extra_objects/Wallfactory.py @@ -865,8 +865,6 @@ class add_mesh_wallb(Operator): # Make a mesh from a list of verts/edges/faces. mesh.from_pydata(verts_array, [], faces_array) - scene = context.scene - # Deselect all objects. bpy.ops.object.select_all(action='DESELECT') @@ -876,7 +874,7 @@ class add_mesh_wallb(Operator): scene.objects.link(ob_new) # leave this out to prevent 'Tab key" going into edit mode :) # Use rmb click to select and still modify. - scene.objects.active = ob_new + context.view_layer.objects.active = ob_new ob_new.select_set(True) ob_new.location = tuple(context.scene.cursor_location) diff --git a/add_mesh_extra_objects/add_mesh_round_brilliant.py b/add_mesh_extra_objects/add_mesh_round_brilliant.py index 90673ed4..7794269e 100644 --- a/add_mesh_extra_objects/add_mesh_round_brilliant.py +++ b/add_mesh_extra_objects/add_mesh_round_brilliant.py @@ -220,9 +220,6 @@ def addBrilliant(context, s, table_w, crown_h, girdle_t, pavi_d, bezel_f, cf.append(i) fa(*cf) - # bpy variables / shortcuts - scene = bpy.context.scene - # deactivate possible active Objects bpy.context.view_layer.objects.active = None @@ -236,7 +233,7 @@ def addBrilliant(context, s, table_w, crown_h, girdle_t, pavi_d, bezel_f, dobj = object_utils.object_data_add(context, dmesh, operator=None, name="dobj").object # activate and select object - scene.objects.active = dobj + bpy.context.view_layer.objects.active = dobj dobj.select_set(True) obj = bpy.context.active_object |