|
Blender
V2.59
|
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) 2009 by Nicholas Bishop 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00028 #ifndef BKE_PAINT_H 00029 #define BKE_PAINT_H 00030 00035 struct Brush; 00036 struct MFace; 00037 struct MultireModifierData; 00038 struct MVert; 00039 struct Object; 00040 struct Paint; 00041 struct PBVH; 00042 struct Scene; 00043 struct StrokeCache; 00044 00045 extern const char PAINT_CURSOR_SCULPT[3]; 00046 extern const char PAINT_CURSOR_VERTEX_PAINT[3]; 00047 extern const char PAINT_CURSOR_WEIGHT_PAINT[3]; 00048 extern const char PAINT_CURSOR_TEXTURE_PAINT[3]; 00049 00050 void paint_init(struct Paint *p, const char col[3]); 00051 void free_paint(struct Paint *p); 00052 void copy_paint(struct Paint *src, struct Paint *tar); 00053 00054 struct Paint *paint_get_active(struct Scene *sce); 00055 struct Brush *paint_brush(struct Paint *paint); 00056 void paint_brush_set(struct Paint *paint, struct Brush *br); 00057 00058 /* testing face select mode 00059 * Texture paint could be removed since selected faces are not used 00060 * however hiding faces is useful */ 00061 int paint_facesel_test(struct Object *ob); 00062 00063 /* Session data (mode-specific) */ 00064 00065 typedef struct SculptSession { 00066 /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */ 00067 struct MultiresModifierData *multires; /* Special handling for multires meshes */ 00068 struct MVert *mvert; 00069 struct MFace *mface; 00070 int totvert, totface; 00071 float *face_normals; 00072 struct KeyBlock *kb; 00073 00074 /* Mesh connectivity */ 00075 struct ListBase *fmap; 00076 00077 /* PBVH acceleration structure */ 00078 struct PBVH *pbvh; 00079 00080 /* Paiting on deformed mesh */ 00081 int modifiers_active; /* object is deformed with some modifiers */ 00082 float (*orig_cos)[3]; /* coords of undeformed mesh */ 00083 float (*deform_cos)[3]; /* coords of deformed mesh but without stroke displacement */ 00084 float (*deform_imats)[3][3]; /* crazyspace deformation matricies */ 00085 00086 /* Partial redraw */ 00087 int partial_redraw; 00088 00089 /* Used to cache the render of the active texture */ 00090 unsigned int texcache_side, *texcache, texcache_actual; 00091 00092 /* Layer brush persistence between strokes */ 00093 float (*layer_co)[3]; /* Copy of the mesh vertices' locations */ 00094 00095 struct SculptStroke *stroke; 00096 struct StrokeCache *cache; 00097 } SculptSession; 00098 00099 void free_sculptsession(struct Object *ob); 00100 00101 #endif