Blender V2.61 - r43446

BKE_paint.h

Go to the documentation of this file.
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 int paint_vertsel_test(struct Object *ob);
00063 
00064 /* Session data (mode-specific) */
00065 
00066 typedef struct SculptSession {
00067     /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
00068     struct MultiresModifierData *multires; /* Special handling for multires meshes */
00069     struct MVert *mvert;
00070     struct MFace *mface;
00071     int totvert, totface;
00072     float *face_normals;
00073     struct KeyBlock *kb;
00074     
00075     /* Mesh connectivity */
00076     struct ListBase *fmap;
00077 
00078     /* PBVH acceleration structure */
00079     struct PBVH *pbvh;
00080 
00081     /* Paiting on deformed mesh */
00082     int modifiers_active; /* object is deformed with some modifiers */
00083     float (*orig_cos)[3]; /* coords of undeformed mesh */
00084     float (*deform_cos)[3]; /* coords of deformed mesh but without stroke displacement */
00085     float (*deform_imats)[3][3]; /* crazyspace deformation matrices */
00086 
00087     /* Partial redraw */
00088     int partial_redraw;
00089     
00090     /* Used to cache the render of the active texture */
00091     unsigned int texcache_side, *texcache, texcache_actual;
00092 
00093     /* Layer brush persistence between strokes */
00094     float (*layer_co)[3]; /* Copy of the mesh vertices' locations */
00095 
00096     struct SculptStroke *stroke;
00097     struct StrokeCache *cache;
00098 } SculptSession;
00099 
00100 void free_sculptsession(struct Object *ob);
00101 void free_sculptsession_deformMats(struct SculptSession *ss);
00102 
00103 #endif