From ec97450ac6160a8892a339a746a507e40b7d2fce Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Tue, 23 Mar 2021 18:26:13 +1100 Subject: Curves: add taper mode option Currently, when a taper object is specified, the radius of the spline is ignored. This patch adds a new option to control how the taper object affect the effective radius of the spline. The option allow three modes of operation: - Override: The old method. The radius of the spline is ignored and overridden. - Multiply: The radius of the spline is multiplied by the taper radius. - Add: The radius of the spline is added to the taper radius. Ref D10779 --- source/blender/makesdna/DNA_curve_types.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_curve_types.h') diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index b3f0708539a..4f914089347 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -269,7 +269,12 @@ typedef struct Curve { char overflow; char spacemode, align_y; char bevel_mode; - char _pad[2]; + /** + * Determine how the effective radius of the bevel point is computed when a taper object is + * specified. The effective radius is a function of the bevel point radius and the taper radius. + */ + char taper_radius_mode; + char _pad; /* font part */ short lines; @@ -400,6 +405,16 @@ enum { CU_BEV_MODE_CURVE_PROFILE = 2, }; +/** #Curve.taper_radius_mode */ +enum { + /** Override the radius of the bevel point with the taper radius. */ + CU_TAPER_RADIUS_OVERRIDE = 0, + /** Multiply the radius of the bevel point by the taper radius. */ + CU_TAPER_RADIUS_MULTIPLY = 1, + /** Add the radius of the bevel point to the taper radius. */ + CU_TAPER_RADIUS_ADD = 2, +}; + /* Curve.overflow. */ enum { CU_OVERFLOW_NONE = 0, -- cgit v1.2.3