diff options
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index c573de6b54e..8874d7e3ca0 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -107,13 +107,14 @@ typedef struct bGPDspoint { typedef enum eGPDspoint_Flag { /* stroke point is selected (for editing) */ GP_SPOINT_SELECT = (1 << 0), - /* stroke point is tagged (for some editing operation) */ GP_SPOINT_TAG = (1 << 1), /* stroke point is temp tagged (for some editing operation) */ GP_SPOINT_TEMP_TAG = (1 << 2), /* stroke point is temp tagged (for some editing operation) */ GP_SPOINT_TEMP_TAG2 = (1 << 3), + /* Stroke point is "linked" to control point of bezier handle. */ + GP_SPOINT_IS_BEZT_CONTROL = (1 << 4), } eGPSPoint_Flag; /* ***************************************** */ @@ -183,6 +184,14 @@ typedef enum eGPDpalette_Flag { /* ***************************************** */ /* GP Curve Point */ +typedef struct bGPDcpoint_Runtime { + /* Original curve point */ + struct bGPDcurve_point *gpc_pt_orig; + /* Original index array position */ + int idx_orig; + char _pad0[4]; +} bGPDcpoint_Runtime; + typedef struct bGPDcurve_point { /** Bezier Triple for the handles and control points. */ BezTriple bezt; @@ -205,12 +214,14 @@ typedef struct bGPDcurve_point { /** Vertex Color RGBA (A=mix factor). */ float vert_color[4]; - char _pad[4]; + + bGPDcpoint_Runtime runtime; } bGPDcurve_point; /* bGPDcurve_point->flag */ typedef enum eGPDcurve_point_Flag { GP_CURVE_POINT_SELECT = (1 << 0), + GP_CURVE_POINT_TAG = (1 << 1), } eGPDcurve_point_Flag; /* ***************************************** */ @@ -218,19 +229,22 @@ typedef enum eGPDcurve_point_Flag { /* Curve for Bezier Editing. */ typedef struct bGPDcurve { - /** Array of BezTriple. */ + /** Array of curve points. */ bGPDcurve_point *curve_points; /** Total number of curve points. */ int tot_curve_points; /** General flag. */ short flag; char _pad[2]; + /** Vertex weight data. */ + struct MDeformVert *dvert; + void *_pad2; + } bGPDcurve; /* bGPDcurve_Flag->flag */ typedef enum bGPDcurve_Flag { - /* Flag to indicated that the stroke data has been changed and the curve needs to be refitted */ - GP_CURVE_NEEDS_STROKE_UPDATE = (1 << 0), + /* GP_CURVE_NEEDS_STROKE_UPDATE = (1 << 0), */ /* Deprecated */ /* Curve is selected */ GP_CURVE_SELECT = (1 << 1), } bGPDcurve_Flag; @@ -341,9 +355,6 @@ typedef enum eGPDstroke_Flag { /* Flag used to indicate that stroke is used for fill close and must use * fill color for stroke and no fill area */ GP_STROKE_NOFILL = (1 << 8), - /* Flag to indicated that the editcurve has been changed and the stroke needs to be updated with - * the curve data */ - GP_STROKE_NEEDS_CURVE_UPDATE = (1 << 9), /* only for use with stroke-buffer (while drawing arrows) */ GP_STROKE_USE_ARROW_START = (1 << 12), /* only for use with stroke-buffer (while drawing arrows) */ @@ -657,10 +668,6 @@ typedef struct bGPdata { int flag; /** Default resolution for generated curves using curve editing method. */ int curve_edit_resolution; - /** Curve Editing error threshold. */ - float curve_edit_threshold; - /** Curve Editing corner angle (less or equal is treated as corner). */ - float curve_edit_corner_angle; /* Palettes */ /** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */ @@ -871,6 +878,17 @@ typedef enum eGP_DrawMode { #define GPENCIL_PLAY_ON(gpd) ((gpd) && ((gpd)->runtime.playing == 1)) +/* True if the stroke has curve data (is of type BEZIER). */ +#define GPENCIL_STROKE_TYPE_BEZIER(gps) ((gps) && ((gps)->editcurve != NULL)) + +/* True if the stroke is of type POLY */ +#define GPENCIL_STROKE_TYPE_POLY(gps) ((gps) && ((gps)->editcurve == NULL)) + +/* True if the stroke type of gps_a and gps_b is equal. */ +#define GPENCIL_STROKE_TYPE_EQ(gps_a, gps_b) \ + ((GPENCIL_STROKE_TYPE_BEZIER(gps_a) && GPENCIL_STROKE_TYPE_BEZIER(gps_b)) || \ + (GPENCIL_STROKE_TYPE_POLY(gps_a) && GPENCIL_STROKE_TYPE_POLY(gps_b))) + #ifdef __cplusplus } #endif |