Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2008, Blender Foundation. 00019 * This is a new part of Blender 00020 * 00021 * Contributor(s): Joshua Leung 00022 * 00023 * ***** END GPL LICENSE BLOCK ***** 00024 */ 00025 00030 #ifndef DNA_GPENCIL_TYPES_H 00031 #define DNA_GPENCIL_TYPES_H 00032 00033 #include "DNA_listBase.h" 00034 #include "DNA_ID.h" 00035 00036 /* Grease-Pencil Annotations - 'Stroke Point' 00037 * -> Coordinates may either be 2d or 3d depending on settings at the time 00038 * -> Coordinates of point on stroke, in proportions of window size 00039 * This assumes that the bottom-left corner is (0,0) 00040 */ 00041 typedef struct bGPDspoint { 00042 float x, y, z; /* co-ordinates of point (usually 2d, but can be 3d as well) */ 00043 float pressure; /* pressure of input device (from 0 to 1) at this point */ 00044 } bGPDspoint; 00045 00046 /* Grease-Pencil Annotations - 'Stroke' 00047 * -> A stroke represents a (simplified version) of the curve 00048 * drawn by the user in one 'mousedown'->'mouseup' operation 00049 */ 00050 typedef struct bGPDstroke { 00051 struct bGPDstroke *next, *prev; 00052 00053 bGPDspoint *points; /* array of data-points for stroke */ 00054 int totpoints; /* number of data-points in array */ 00055 00056 short thickness; /* thickness of stroke (currently not used) */ 00057 short flag; /* various settings about this stroke */ 00058 } bGPDstroke; 00059 00060 /* bGPDstroke->flag */ 00061 /* stroke is in 3d-space */ 00062 #define GP_STROKE_3DSPACE (1<<0) 00063 /* stroke is in 2d-space */ 00064 #define GP_STROKE_2DSPACE (1<<1) 00065 /* stroke is in 2d-space (but with special 'image' scaling) */ 00066 #define GP_STROKE_2DIMAGE (1<<2) 00067 /* only for use with stroke-buffer (while drawing eraser) */ 00068 #define GP_STROKE_ERASER (1<<15) 00069 00070 00071 /* Grease-Pencil Annotations - 'Frame' 00072 * -> Acts as storage for the 'image' formed by strokes 00073 */ 00074 typedef struct bGPDframe { 00075 struct bGPDframe *next, *prev; 00076 00077 ListBase strokes; /* list of the simplified 'strokes' that make up the frame's data */ 00078 00079 int framenum; /* frame number of this frame */ 00080 int flag; /* temp settings */ 00081 } bGPDframe; 00082 00083 /* bGPDframe->flag */ 00084 /* frame is being painted on */ 00085 #define GP_FRAME_PAINT (1<<0) 00086 /* for editing in Action Editor */ 00087 #define GP_FRAME_SELECT (1<<1) 00088 00089 00090 /* Grease-Pencil Annotations - 'Layer' */ 00091 typedef struct bGPDlayer { 00092 struct bGPDlayer *next, *prev; 00093 00094 ListBase frames; /* list of annotations to display for frames (bGPDframe list) */ 00095 bGPDframe *actframe; /* active frame (should be the frame that is currently being displayed) */ 00096 00097 int flag; /* settings for layer */ 00098 short thickness; /* current thickness to apply to strokes */ 00099 short gstep; /* max number of frames between active and ghost to show (0=only those on either side) */ 00100 00101 float color[4]; /* color that should be used to draw all the strokes in this layer */ 00102 00103 char info[128]; /* optional reference info about this layer (i.e. "director's comments, 12/3") 00104 * this is used for the name of the layer too and kept unique. */ 00105 } bGPDlayer; 00106 00107 /* bGPDlayer->flag */ 00108 /* don't display layer */ 00109 #define GP_LAYER_HIDE (1<<0) 00110 /* protected from further editing */ 00111 #define GP_LAYER_LOCKED (1<<1) 00112 /* layer is 'active' layer being edited */ 00113 #define GP_LAYER_ACTIVE (1<<2) 00114 /* draw points of stroke for debugging purposes */ 00115 #define GP_LAYER_DRAWDEBUG (1<<3) 00116 /* do onionskinning */ 00117 #define GP_LAYER_ONIONSKIN (1<<4) 00118 /* for editing in Action Editor */ 00119 #define GP_LAYER_SELECT (1<<5) 00120 /* current frame for layer can't be changed */ 00121 #define GP_LAYER_FRAMELOCK (1<<6) 00122 /* don't render xray (which is default) */ 00123 #define GP_LAYER_NO_XRAY (1<<7) 00124 00125 00126 /* Grease-Pencil Annotations - 'DataBlock' */ 00127 typedef struct bGPdata { 00128 ID id; /* Grease Pencil data is */ 00129 00130 /* saved Grease-Pencil data */ 00131 ListBase layers; /* bGPDlayers */ 00132 int flag; /* settings for this datablock */ 00133 00134 /* not-saved stroke buffer data (only used during paint-session) 00135 * - buffer must be initialised before use, but freed after 00136 * whole paint operation is over 00137 */ 00138 short sbuffer_size; /* number of elements currently in cache */ 00139 short sbuffer_sflag; /* flags for stroke that cache represents */ 00140 void *sbuffer; /* stroke buffer (can hold GP_STROKE_BUFFER_MAX) */ 00141 } bGPdata; 00142 00143 /* bGPdata->flag */ 00144 // XXX many of these flags should be depreceated for more general ideas in 2.5 00145 /* don't allow painting to occur at all */ 00146 // XXX is depreceated - not well understood 00147 #define GP_DATA_LMBPLOCK (1<<0) 00148 /* show debugging info in viewport (i.e. status print) */ 00149 #define GP_DATA_DISPINFO (1<<1) 00150 /* in Action Editor, show as expanded channel */ 00151 #define GP_DATA_EXPAND (1<<2) 00152 /* is the block overriding all clicks? */ 00153 // XXX is depreceated - nasty old concept 00154 #define GP_DATA_EDITPAINT (1<<3) 00155 /* new strokes are added in viewport space */ 00156 #define GP_DATA_VIEWALIGN (1<<4) 00157 /* Project into the screens Z values */ 00158 #define GP_DATA_DEPTH_VIEW (1<<5) 00159 #define GP_DATA_DEPTH_STROKE (1<<6) 00160 00161 #define GP_DATA_DEPTH_STROKE_ENDPOINTS (1<<7) 00162 00163 #endif /* DNA_GPENCIL_TYPES_H */