From 2e6159a4948cd0f4e0b636734bfe506796bd87f2 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 1 Nov 2019 12:09:55 +0100 Subject: Curve: CurveMapping Extend Option Extend options are currently stored per curve. This was not clearly communicated to the user and they expected this to be a setting per CurveMapping. This change will move the option from `Curve` to `CurveMapping`. In order to support this the API had to be changed. BPY: CurveMap.evaluate is also moved to CurveMapping.evaluate what breaks Python API. Cycles has been updated but other add-ons have not. After release of 2.81 we can merge this to master and adapt the add-ons. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D6169 --- source/blender/makesdna/DNA_color_types.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'source/blender/makesdna/DNA_color_types.h') diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h index 219fc96554a..66adc547cf2 100644 --- a/source/blender/makesdna/DNA_color_types.h +++ b/source/blender/makesdna/DNA_color_types.h @@ -24,6 +24,7 @@ #ifndef __DNA_COLOR_TYPES_H__ #define __DNA_COLOR_TYPES_H__ +#include "DNA_defs.h" #include "DNA_vec_types.h" /* general defines for kernel functions */ @@ -47,7 +48,8 @@ enum { }; typedef struct CurveMap { - short totpoint, flag; + short totpoint; + short flag DNA_DEPRECATED; /** Quick multiply value for reading table. */ float range; @@ -67,9 +69,6 @@ typedef struct CurveMap { float premul_ext_out[2]; } CurveMap; -/* cuma->flag */ -#define CUMA_EXTEND_EXTRAPOLATE 1 - typedef struct CurveMapping { /** Cur; for buttons, to show active curve. */ int flag, cur; @@ -93,11 +92,17 @@ typedef struct CurveMapping { char _pad[6]; } CurveMapping; -/* cumapping->flag */ -#define CUMA_DO_CLIP (1 << 0) -#define CUMA_PREMULLED (1 << 1) -#define CUMA_DRAW_CFRA (1 << 2) -#define CUMA_DRAW_SAMPLE (1 << 3) +/* CurveMapping.flag */ +typedef enum eCurveMappingFlags { + CUMA_DO_CLIP = (1 << 0), + CUMA_PREMULLED = (1 << 1), + CUMA_DRAW_CFRA = (1 << 2), + CUMA_DRAW_SAMPLE = (1 << 3), + + /* The curve is extended by extrapolation. When not set the curve is extended + * Horizontally */ + CUMA_EXTEND_EXTRAPOLATE = (1 << 4), +} eCurveMappingFlags; /* cumapping->preset */ typedef enum eCurveMappingPreset { -- cgit v1.2.3