Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNBurn <7nburn@gmail.com>2019-01-29 04:04:35 +0300
committerNBurn <7nburn@gmail.com>2019-01-29 04:04:35 +0300
commitedd2de62eb13284f7e02256701fec1483973018d (patch)
tree02a6ab0c10b9131e346d2e55b36bfd14873fafa3 /add_curve_extra_objects
parentbdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff)
addons: view_layer.objects.active syntax update
Diffstat (limited to 'add_curve_extra_objects')
-rw-r--r--add_curve_extra_objects/beveltaper_curve.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/add_curve_extra_objects/beveltaper_curve.py b/add_curve_extra_objects/beveltaper_curve.py
index 7f09a3a0..6da71428 100644
--- a/add_curve_extra_objects/beveltaper_curve.py
+++ b/add_curve_extra_objects/beveltaper_curve.py
@@ -193,14 +193,14 @@ def add_type1(self, context):
def make_path(self, context, verts):
- target = bpy.context.scene.objects.active
+ target = bpy.context.view_layer.objects.active
bpy.ops.curve.primitive_nurbs_path_add(
view_align=False, enter_editmode=False, location=(0, 0, 0)
)
- target.data.taper_object = bpy.context.scene.objects.active
- taper = bpy.context.scene.objects.active
+ target.data.taper_object = bpy.context.view_layer.objects.active
+ taper = bpy.context.view_layer.objects.active
taper.name = target.name + '_Taper'
- bpy.context.scene.objects.active = target
+ bpy.context.view_layer.objects.active = target
points = taper.data.splines[0].points
for i in range(len(verts)):
@@ -208,7 +208,7 @@ def make_path(self, context, verts):
def make_curve(self, context, verts, lh, rh):
- target = bpy.context.scene.objects.active
+ target = bpy.context.view_layer.objects.active
curve_data = bpy.data.curves.new(
name=target.name + '_Bevel', type='CURVE'
)
@@ -229,8 +229,8 @@ def make_curve(self, context, verts, lh, rh):
c += 1
object_data_add(context, curve_data, operator=self)
- target.data.bevel_object = bpy.context.scene.objects.active
- bpy.context.scene.objects.active = target
+ target.data.bevel_object = bpy.context.view_layer.objects.active
+ bpy.context.view_layer.objects.active = target
class add_tapercurve(Operator):
@@ -404,7 +404,7 @@ class Bevel_Taper_Curve_Menu(Menu):
def menu_funcs(self, context):
- if bpy.context.scene.objects.active.type == "CURVE":
+ if bpy.context.view_layer.objects.active.type == "CURVE":
self.layout.menu("VIEW3D_MT_bevel_taper_curve_menu")