[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37178] branches/soc-2011-onion: Revision: 29663

Jason Wilkins Jason.A.Wilkins at gmail.com
Sat Jun 4 17:58:25 CEST 2011


Revision: 37178
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37178
Author:   jwilkins
Date:     2011-06-04 15:58:25 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
Revision: 29663
Author: nicholasbishop
Date: 7:53:11 PM, Wednesday, June 23, 2010
Message:
Added undo pushes for the mask_set operator. Also removed a bunch of old crufty declarations in sculpt_intern.h.

** jwilkins:
** Bug? ever since layers were added, removing the last layer causes the object to be drawn using the object color where before the object started grey and stayed grey

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_mask.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_intern.h
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c

Property Changed:
----------------
    branches/soc-2011-onion/


Property changes on: branches/soc-2011-onion
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-29585,29596,29662
/trunk/blender:36833-37054
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-29585,29596,29662-29663
/trunk/blender:36833-37054

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_mask.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_mask.c	2011-06-04 15:43:02 UTC (rev 37177)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_mask.c	2011-06-04 15:58:25 UTC (rev 37178)
@@ -29,6 +29,7 @@
 #include "ED_mesh.h"
 #include "ED_sculpt.h"
 #include "paint_intern.h"
+#include "sculpt_intern.h"
 
 static void set_mask_value(MaskSetMode mode, float *m)
 {
@@ -45,11 +46,13 @@
 	Object *ob;
 	DerivedMesh *dm;
 	struct MultiresModifierData *mmd;
+	SculptSession *ss;
 	Mesh *me;
 	PBVH *pbvh;
 
 	scene = CTX_data_scene(C);
 	ob = CTX_data_active_object(C);
+	ss = ob->sculpt;
 	me = get_mesh(ob);
 	mmd = paint_multires_active(scene, ob);
 
@@ -61,9 +64,14 @@
 		int n, totnode;
 
 		BLI_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode);
+
+		sculpt_undo_push_begin("Paint mask fill");
+
 		for(n=0; n<totnode; n++) {
 			PBVHVertexIter vd;
 
+			sculpt_undo_push_node(ob, nodes[n]);
+
 			BLI_pbvh_vertex_iter_begin(pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
 				if(vd.mask_active)
 					set_mask_value(mode, vd.mask_active);
@@ -76,6 +84,9 @@
 		if(mmd)
 			multires_mark_as_modified(ob);
 		BLI_pbvh_update(pbvh, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
+
+		sculpt_undo_push_end();
+
 		WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
 	}
 	
@@ -89,9 +100,8 @@
 	return ob && get_mesh(ob) && ob->sculpt;
 }
 
-/* Temporary operator to test masking; simply fills up a mask for the
-   entire object, setting each point to either 0, 1, or a random value
-*/
+/* fills up a mask for the entire object, setting each vertex to
+   either 0, 1, or a random value */
 void PAINT_OT_mask_set(wmOperatorType *ot)
 {
 	static EnumPropertyItem mask_items[] = {

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_intern.h
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_intern.h	2011-06-04 15:43:02 UTC (rev 37177)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_intern.h	2011-06-04 15:58:25 UTC (rev 37178)
@@ -42,41 +42,21 @@
 #include "BLI_pbvh.h"
 
 struct bContext;
-struct Brush;
 struct KeyBlock;
-struct Mesh;
-struct MultiresModifierData;
 struct Object;
 struct Scene;
-struct Sculpt;
-struct SculptStroke;
+struct PBVHNode;
+struct SculptUndoNode;
 
-/* Interface */
-void sculptmode_selectbrush_menu(void);
-void sculptmode_draw_mesh(int);
-void sculpt_paint_brush(char clear);
-void sculpt_stroke_draw(struct SculptStroke *);
-void sculpt_radialcontrol_start(int mode);
-
-struct Brush *sculptmode_brush(void);
-
-void sculpt(Sculpt *sd);
-
 int sculpt_poll(struct bContext *C);
 void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_fmap);
+int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float out[3], float mouse[2]);
 
 /* Deformed mesh sculpt */
 void sculpt_free_deformMats(struct SculptSession *ss);
 
-/* Stroke */
-struct SculptStroke *sculpt_stroke_new(const int max);
-void sculpt_stroke_free(struct SculptStroke *);
-void sculpt_stroke_add_point(struct SculptStroke *, const short x, const short y);
-void sculpt_stroke_apply(struct Sculpt *sd, struct SculptStroke *);
-void sculpt_stroke_apply_all(struct Sculpt *sd, struct SculptStroke *);
-int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float out[3], float mouse[2]);
-
 /* Undo */
+
 /* Sculpt has its own undo, for each undo step there can be multiple
    SculptUndoNodes, added as they are needed. SculptUndoNodes contain undo data
    for one PBVHNode. */
@@ -112,11 +92,12 @@
 	int pmask_layer_offset;
 } SculptUndoNode;
 
-SculptUndoNode *sculpt_undo_push_node(const Object *ob, PBVHNode *node);
-SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
+struct SculptUndoNode *sculpt_undo_push_node(const Object *ob, PBVHNode *node);
+struct SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
 void sculpt_undo_push_begin(const char *name);
 void sculpt_undo_push_end(void);
 
+/* modifiers */
 void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]);
 
 #endif

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c	2011-06-04 15:43:02 UTC (rev 37177)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c	2011-06-04 15:58:25 UTC (rev 37178)
@@ -66,8 +66,6 @@
 #include "paint_intern.h"
 #include "sculpt_intern.h"
 
-/************************** Undo *************************/
-
 static void update_cb(PBVHNode *node, void *unused)
 {
 	(void)unused;




More information about the Bf-blender-cvs mailing list