Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-12-30 22:29:07 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-12-30 22:29:07 +0400
commit67d27db4a1ce276c394fd3fdfab221018d4240ce (patch)
tree434ce724230ebd0afa170ab53fa5b42ef1862a09 /source/blender/editors/sculpt_paint/sculpt_intern.h
parent2e69b0cd0b26fb1e641536de5a81a02f4478065c (diff)
Add dynamic topology support to sculpt mode
* User documentation: wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Dynamic_Topology_Sculpting * Code review for this and the other dynamic-topology commits: https://codereview.appspot.com/6947064/ Thanks to Sergey for doing code review! * Add SCULPT_OT_dynamic_topology_toggle operator to enable or disable dynamic topology mode * Most brushes need little modification for dynamic topology, but for some it won't work well and is disabled. This decision is made in sculpt_stroke_dynamic_topology(). * For brushes that need original data (e.g. grab brush) the topology is not updated during the stroke, but some changes to original vertex data is accessed were made since BMesh works a little differently from mesh/multires. This is abstracted with SculptOrigVertData and associated functions. * Smooth brush gets yet another set of functions, for mesh and multires and dynamic topology and, separetely, masking * For most brushes, the topology is updated during the stroke right before the regular brush action takes place. This is handled in sculpt_topology_update(). * Exiting sculpt mode also disables dynamic topology * Sculpt undo works differently with BMesh. Since the contents of nodes in the PBVH do not remain static during a sculpt session, the SculptUndoNodes do not correspond with PBVHNodes if dynamic topology is enabled. Rather, each SculptUndoNode is associated with a BMLogEntry. * Sculpt undo gets a few new cases: entering and exiting dynamic topology does an undo push of all mesh data. Symmetrize will similarly push a full copy of BMesh data, although it does so through the BMLog API. * Undo and redo in dynamic-topology mode will do a full recalculation of the PBVH. * Add some documentation to doc/sculpt.org. This could stand to be expanded a lot more, for now it mostly contains test cases for the undo system. * Add SCULPT_OT_optimize operator to recalculate the BVH. The BVH gets less optimal more quickly with dynamic topology than regular sculpting. There is no doubt more clever stuff we can do to optimize it on the fly, but for now this gives the user a nicer way to recalculate it than toggling modes.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index cfc908bf453..e56962a3964 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -49,6 +49,7 @@ struct Object;
struct Scene;
struct Sculpt;
struct SculptStroke;
+struct SculptUndoNode;
/* Interface */
struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob);
@@ -67,12 +68,22 @@ void free_sculptsession_deformMats(struct SculptSession *ss);
/* Stroke */
int sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]);
+/* Dynamic topology */
+void sculpt_pbvh_clear(Object *ob);
+void sculpt_update_after_dynamic_topology_toggle(bContext *C);
+void sculpt_dynamic_topology_enable(struct bContext *C);
+void sculpt_dynamic_topology_disable(struct bContext *C,
+ struct SculptUndoNode *unode);
+
/* Undo */
typedef enum {
SCULPT_UNDO_COORDS,
SCULPT_UNDO_HIDDEN,
- SCULPT_UNDO_MASK
+ SCULPT_UNDO_MASK,
+ SCULPT_UNDO_DYNTOPO_BEGIN,
+ SCULPT_UNDO_DYNTOPO_END,
+ SCULPT_UNDO_DYNTOPO_SYMMETRIZE,
} SculptUndoType;
typedef struct SculptUndoNode {
@@ -101,6 +112,18 @@ typedef struct SculptUndoNode {
int *grids; /* to restore into right location */
BLI_bitmap *grid_hidden;
+ /* bmesh */
+ struct BMLogEntry *bm_entry;
+ int applied;
+ CustomData bm_enter_vdata;
+ CustomData bm_enter_edata;
+ CustomData bm_enter_ldata;
+ CustomData bm_enter_pdata;
+ int bm_enter_totvert;
+ int bm_enter_totedge;
+ int bm_enter_totloop;
+ int bm_enter_totpoly;
+
/* shape keys */
char shapeName[sizeof(((KeyBlock *)0))->name];
} SculptUndoNode;