2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2012 Blender Foundation.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): Blender Foundation,
26 * ***** END GPL LICENSE BLOCK *****
29 /** \file DNA_mask_types.h
32 * \author Sergey Sharybin
35 #ifndef __DNA_MASK_TYPES_H__
36 #define __DNA_MASK_TYPES_H__
40 #include "DNA_listBase.h"
41 #include "DNA_curve_types.h"
46 ListBase masklayers; /* mask layers */
47 int masklay_act; /* index of active mask layer (-1 == None) */
48 int masklay_tot; /* total number of mask layers */
50 int sfra, efra; /* frames, used by the sequencer */
52 int flag; /* for anim info */
56 typedef struct MaskParent {
57 // int flag; /* parenting flags */ /* not used */
59 int id_type; /* type of parenting */
60 ID *id; /* ID block of entity to which mask/spline is parented to
61 * in case of parenting to movie tracking data set to MovieClip datablock */
62 char parent[64]; /* entity of parent to which parenting happened
63 * in case of parenting to movie tracking data contains name of layer */
64 char sub_parent[64]; /* sub-entity of parent to which parenting happened
65 * in case of parenting to movie tracking data contains name of track */
66 float parent_orig[2]; /* track location at the moment of parenting */
69 typedef struct MaskSplinePointUW {
70 float u, w; /* u coordinate along spline segment and weight of this point */
71 int flag; /* different flags of this point */
74 typedef struct MaskSplinePoint {
75 BezTriple bezt; /* actual point coordinates and it's handles */
77 int tot_uw; /* number of uv feather values */
78 MaskSplinePointUW *uw; /* feather UV values */
79 MaskParent parent; /* parenting information of particular spline point */
82 typedef struct MaskSpline {
83 struct MaskSpline *next, *prev;
85 int flag; /* defferent spline flag (closed, ...) */
86 int tot_point; /* total number of points */
87 MaskSplinePoint *points; /* points which defines spline itself */
88 MaskParent parent; /* parenting information of the whole spline */
90 int weight_interp, pad; /* weight interpolation */
92 MaskSplinePoint *points_deform; /* deformed copy of 'points' BezTriple data - not saved */
96 typedef struct MaskLayerShape {
97 struct MaskLayerShape *next, *prev;
99 float *data; /* u coordinate along spline segment and weight of this point */
100 int tot_vert; /* to ensure no buffer overruns's: alloc size is (tot_vert * MASK_OBJECT_SHAPE_ELEM_SIZE) */
101 int frame; /* different flags of this point */
102 char flag; /* animation flag */
106 /* cast to this for convenience, not saved */
107 #define MASK_OBJECT_SHAPE_ELEM_SIZE 8 /* 3x 2D points + weight + radius == 8 */
111 typedef struct MaskLayerShapeElem {
112 float value[MASK_OBJECT_SHAPE_ELEM_SIZE];
113 } MaskLayerShapeElem;
115 typedef struct MaskLayer {
116 struct MaskLayer *next, *prev;
118 char name[64]; /* name of the mask layer (64 = MAD_ID_NAME - 2) */
120 ListBase splines; /* list of splines which defines this mask layer */
121 ListBase splines_shapes;
123 struct MaskSpline *act_spline; /* active spline */
124 struct MaskSplinePoint *act_point; /* active point */
126 /* blending options */
131 char flag; /* for animation */
132 char restrictflag; /* matching 'Object' flag of the same name - eventually use in the outliner */
135 /* MaskParent->flag */
136 /* #define MASK_PARENT_ACTIVE (1 << 0) */ /* UNUSED */
138 /* MaskSpline->flag */
139 /* reserve (1 << 0) for SELECT */
141 MASK_SPLINE_CYCLIC = (1 << 1),
142 MASK_SPLINE_NOFILL = (1 << 2)
145 /* MaskSpline->weight_interp */
146 #define MASK_SPLINE_INTERP_LINEAR 1
147 #define MASK_SPLINE_INTERP_EASE 2
149 /* ob->restrictflag */
150 #define MASK_RESTRICT_VIEW 1
151 #define MASK_RESTRICT_SELECT 2
152 #define MASK_RESTRICT_RENDER 4
154 /* SpaceClip->mask_draw_flag */
155 #define MASK_DRAWFLAG_SMOOTH 1
157 /* copy of eSpaceImage_UVDT */
158 /* SpaceClip->mask_draw_type */
169 MASK_BLEND_SUBTRACT = 1
172 /* masklay->blend_flag */
174 MASK_BLENDFLAG_INVERT = (1 << 0)
179 MASK_LAYERFLAG_LOCKED = (1 << 4),
180 MASK_LAYERFLAG_SELECT = (1 << 5)
183 /* masklay_shape->flag */
185 MASK_SHAPE_SELECT = (1 << 0)
191 MASK_ANIMF_EXPAND = (1 << 4)
194 #endif // __DNA_MASK_TYPES_H__