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:
authorEthan Simon <razed>2021-06-09 01:00:37 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-06-09 01:01:13 +0300
commit3a409083e7dbc8e5fef5a68f6ac5be275acc5ca8 (patch)
treeac8bf5a156a794824212b2efb6759cced1ac1cf2
parent448eeb681aa414257a75356d7e6c65e0672980d5 (diff)
Add Curve Extra Objects: Fix invalid context traceback error
This patch simply adds a preliminary check for the built-in Add Curve Extra Objects add-on. The check basically prevents a traceback in the console. Without this patch the add-on still functions as intended, just with a console prompt. Reviewed By: Blendify Differential Revision: https://developer.blender.org/D9666
-rw-r--r--add_curve_extra_objects/beveltaper_curve.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/add_curve_extra_objects/beveltaper_curve.py b/add_curve_extra_objects/beveltaper_curve.py
index 27795ed1..5b71cf00 100644
--- a/add_curve_extra_objects/beveltaper_curve.py
+++ b/add_curve_extra_objects/beveltaper_curve.py
@@ -424,10 +424,11 @@ def menu_funcs(self, context):
layout = self.layout
- if bpy.context.view_layer.objects.active.type == "CURVE":
- layout.operator("curve.bevelcurve")
- layout.operator("curve.tapercurve")
- layout.separator()
+ if context.view_layer.objects.active:
+ if context.view_layer.objects.active.type == "CURVE":
+ layout.operator("curve.bevelcurve")
+ layout.operator("curve.tapercurve")
+ layout.separator()
# Register
classes = [