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) 2006 by Nicholas Bishop
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file blender/editors/sculpt_paint/sculpt_intern.h
33 #ifndef __SCULPT_INTERN_H__
34 #define __SCULPT_INTERN_H__
36 #include "DNA_listBase.h"
37 #include "DNA_vec_types.h"
38 #include "DNA_key_types.h"
40 #include "BLI_bitmap.h"
47 struct MultiresModifierData;
52 struct SculptUndoNode;
55 struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob);
57 void sculpt(struct Sculpt *sd);
59 int sculpt_mode_poll(struct bContext *C);
60 int sculpt_mode_poll_view3d(struct bContext *C);
61 int sculpt_poll(struct bContext *C);
62 void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob,
63 int need_pmap, int need_mask);
65 /* Deformed mesh sculpt */
66 void free_sculptsession_deformMats(struct SculptSession *ss);
69 int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]);
71 /* Dynamic topology */
72 void sculpt_pbvh_clear(Object *ob);
73 void sculpt_update_after_dynamic_topology_toggle(bContext *C);
74 void sculpt_dynamic_topology_enable(struct bContext *C);
75 void sculpt_dynamic_topology_disable(struct bContext *C,
76 struct SculptUndoNode *unode);
84 SCULPT_UNDO_DYNTOPO_BEGIN,
85 SCULPT_UNDO_DYNTOPO_END,
86 SCULPT_UNDO_DYNTOPO_SYMMETRIZE,
89 typedef struct SculptUndoNode {
90 struct SculptUndoNode *next, *prev;
94 char idname[MAX_ID_NAME]; /* name instead of pointer*/
95 void *node; /* only during push, not valid afterwards! */
104 int maxvert; /* to verify if totvert it still the same */
105 int *index; /* to restore into right location */
106 BLI_bitmap vert_hidden;
109 int maxgrid; /* same for grid */
110 int gridsize; /* same for grid */
111 int totgrid; /* to restore into right location */
112 int *grids; /* to restore into right location */
113 BLI_bitmap *grid_hidden;
116 struct BMLogEntry *bm_entry;
118 CustomData bm_enter_vdata;
119 CustomData bm_enter_edata;
120 CustomData bm_enter_ldata;
121 CustomData bm_enter_pdata;
122 int bm_enter_totvert;
123 int bm_enter_totedge;
124 int bm_enter_totloop;
125 int bm_enter_totpoly;
128 char shapeName[sizeof(((KeyBlock *)0))->name];
131 SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type);
132 SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
133 void sculpt_undo_push_begin(const char *name);
134 void sculpt_undo_push_end(void);
136 void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]);