[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38345] branches/soc-2011-radish: Lots of incomplete changes:

Jason Hays jason_hays22 at mymail.eku.edu
Tue Jul 12 21:06:06 CEST 2011


Revision: 38345
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38345
Author:   jason_hays22
Date:     2011-07-12 19:06:06 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Lots of incomplete changes:
Weight Paint Vertex Select tweaked to act like edit mode's select and Circle select was added, but clipping is not working properly for either.

Select all was added too, but to the Q key until I look into overriding A's select all bones.

The select vertices checkbox was moved to the header, but it does not force face select mask to turn off yet--and it doesn't have the correct icon.

There will definitely be an update tomorrow to fix the problems with all or most of the issues.

Modified Paths:
--------------
    branches/soc-2011-radish/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2011-radish/source/blender/blenkernel/BKE_paint.h
    branches/soc-2011-radish/source/blender/blenkernel/intern/paint.c
    branches/soc-2011-radish/source/blender/editors/include/ED_mesh.h
    branches/soc-2011-radish/source/blender/editors/mesh/editmesh.c
    branches/soc-2011-radish/source/blender/editors/mesh/editmesh_mods.c
    branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_intern.h
    branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_ops.c
    branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_utils.c
    branches/soc-2011-radish/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_header.c
    branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_select.c
    branches/soc-2011-radish/source/blender/makesdna/DNA_mesh_types.h
    branches/soc-2011-radish/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-radish/source/blender/makesrna/intern/rna_mesh.c
    branches/soc-2011-radish/source/blender/makesrna/intern/rna_scene.c

Modified: branches/soc-2011-radish/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2011-radish/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-07-12 19:06:06 UTC (rev 38345)
@@ -641,7 +641,6 @@
             layout.prop(context.tool_settings, "use_auto_normalize", text="Auto Normalize")
             # Jason was here
             layout.prop(context.tool_settings, "use_multipaint", text="Multi-Paint")
-            layout.prop(context.tool_settings, "use_wp_vert_sel", text="Select Vertices")
 
             col = layout.column()
 

Modified: branches/soc-2011-radish/source/blender/blenkernel/BKE_paint.h
===================================================================
--- branches/soc-2011-radish/source/blender/blenkernel/BKE_paint.h	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/blenkernel/BKE_paint.h	2011-07-12 19:06:06 UTC (rev 38345)
@@ -59,7 +59,8 @@
  * Texture paint could be removed since selected faces are not used
  * however hiding faces is useful */
 int paint_facesel_test(struct Object *ob);
-
+/* Jason */
+int paint_vertsel_test(struct Object *ob);
 /* Session data (mode-specific) */
 
 typedef struct SculptSession {

Modified: branches/soc-2011-radish/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/soc-2011-radish/source/blender/blenkernel/intern/paint.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/blenkernel/intern/paint.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -93,7 +93,11 @@
 {
 	return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)));
 }
-
+/* Jason */
+int paint_vertsel_test(Object *ob)
+{
+	return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && (ob->mode & (OB_MODE_WEIGHT_PAINT)));
+}
 void paint_init(Paint *p, const char col[3])
 {
 	Brush *brush;

Modified: branches/soc-2011-radish/source/blender/editors/include/ED_mesh.h
===================================================================
--- branches/soc-2011-radish/source/blender/editors/include/ED_mesh.h	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/include/ED_mesh.h	2011-07-12 19:06:06 UTC (rev 38345)
@@ -124,6 +124,7 @@
 void		undo_push_mesh(struct bContext *C, const char *name);
 /* Jason */
 void		paintvert_flush_flags(struct Object *ob);
+void		paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
 
 /* editmesh_lib.c */
 

Modified: branches/soc-2011-radish/source/blender/editors/mesh/editmesh.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/mesh/editmesh.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/mesh/editmesh.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -1992,4 +1992,63 @@
 			mv->flag= mv_orig->flag;
 		}
 	}
+}
+/* Jason note: caller needs to run paintvert_flush_flags(ob) after this */
+void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
+{
+	Mesh *me;
+	MVert *mvert;
+	int a;
+
+	me= get_mesh(ob);
+	if(me==NULL) return;
+	
+	if(action == SEL_INVERT) {
+		mvert= me->mvert;
+		a= me->totvert;
+		while(a--) {
+			if((mvert->flag & ME_HIDE) == 0) {
+				mvert->flag ^= SELECT;
+			}
+			mvert++;
+		}
+	}
+	else {
+		if (action == SEL_TOGGLE) {
+			action = SEL_SELECT;
+
+			mvert= me->mvert;
+			a= me->totvert;
+			while(a--) {
+				if((mvert->flag & ME_HIDE) == 0 && mvert->flag & SELECT) {
+					action = SEL_DESELECT;
+					break;
+				}
+				mvert++;
+			}
+		}
+
+		mvert= me->mvert;
+		a= me->totvert;
+		while(a--) {
+			if((mvert->flag & ME_HIDE) == 0) {
+				switch (action) {
+				case SEL_SELECT:
+					mvert->flag |= SELECT;
+					break;
+				case SEL_DESELECT:
+					mvert->flag &= ~SELECT;
+					break;
+				case SEL_INVERT:
+					mvert->flag ^= SELECT;
+					break;
+				}
+			}
+			mvert++;
+		}
+	}
+
+	if(flush_flags) {
+		paintvert_flush_flags(ob);
+	}
 }
\ No newline at end of file

Modified: branches/soc-2011-radish/source/blender/editors/mesh/editmesh_mods.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/mesh/editmesh_mods.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/mesh/editmesh_mods.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -328,6 +328,7 @@
 	/* method in use for face selecting too */
 	if(vc->obedit==NULL) {
 		if(paint_facesel_test(vc->obact));
+		else if(paint_vertsel_test(vc->obact));// Jason, vertex selecting
 		else return 0;
 	}
 	else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;

Modified: branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_image.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_image.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -5414,7 +5414,11 @@
 {
 	return paint_facesel_test(CTX_data_active_object(C));
 }
-
+// Jason
+int vert_paint_poll(bContext *C)
+{
+	return paint_vertsel_test(CTX_data_active_object(C));
+}
 /* use project paint to re-apply an image */
 static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
 {

Modified: branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_intern.h
===================================================================
--- branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_intern.h	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_intern.h	2011-07-12 19:06:06 UTC (rev 38345)
@@ -121,6 +121,9 @@
 void PAINT_OT_face_select_inverse(struct wmOperatorType *ot);
 void PAINT_OT_face_select_hide(struct wmOperatorType *ot);
 void PAINT_OT_face_select_reveal(struct wmOperatorType *ot);
+/* Jason */
+void PAINT_OT_vert_select_all(struct wmOperatorType *ot);
+int vert_paint_poll(struct bContext *C);
 
 int facemask_paint_poll(struct bContext *C);
 

Modified: branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_ops.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_ops.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -373,6 +373,9 @@
 	WM_operatortype_append(PAINT_OT_weight_sample);
 	WM_operatortype_append(PAINT_OT_weight_sample_group);
 
+	/* Jason, vertex selection */
+	WM_operatortype_append(PAINT_OT_vert_select_all);
+
 	/* vertex */
 	WM_operatortype_append(PAINT_OT_vertex_paint_toggle);
 	WM_operatortype_append(PAINT_OT_vertex_paint);
@@ -607,6 +610,10 @@
 
 	WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0);
 
+	// Jason
+	WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", QKEY, KM_PRESS, 0, 0);
+	WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
+
 	/* Image/Texture Paint mode */
 	keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0);
 	keymap->poll= image_texture_paint_poll;

Modified: branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_utils.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_utils.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_utils.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -358,6 +358,30 @@
 	WM_operator_properties_select_all(ot);
 }
 
+/* Jason */
+static int vert_select_all_exec(bContext *C, wmOperator *op)
+{
+	Object *ob= CTX_data_active_object(C);
+	paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE);
+	ED_region_tag_redraw(CTX_wm_region(C));
+	return OPERATOR_FINISHED;
+}
+
+/* Jason */
+void PAINT_OT_vert_select_all(wmOperatorType *ot)
+{
+	ot->name= "Vertex Selection";
+	ot->description= "Change selection for all vertices";
+	ot->idname= "PAINT_OT_vert_select_all";
+
+	ot->exec= vert_select_all_exec;
+	ot->poll= vert_paint_poll;
+
+	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+	WM_operator_properties_select_all(ot);
+}
+
 static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Object *ob= CTX_data_active_object(C);

Modified: branches/soc-2011-radish/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/space_view3d/drawobject.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/space_view3d/drawobject.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -2777,7 +2777,7 @@
 
 				GPU_disable_material();
 				// Jason
-				if(scene->toolsettings->wp_vert_sel) {
+				if(paint_vertsel_test(ob)) {
 					glColor3f(0.0f, 0.0f, 0.0f);
 					glPointSize(2.0f);
 					dm->drawEdges(dm, (dt==OB_WIRE || totface==0), me->drawflag);

Modified: branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_header.c	2011-07-12 18:59:54 UTC (rev 38344)
+++ branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_header.c	2011-07-12 19:06:06 UTC (rev 38345)
@@ -498,6 +498,7 @@
 
 		RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
 		uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+		uiItemR(layout, &meshptr, "wp_vert_sel", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);// Jason
 	} else {
 		const char *str_menu;
 

Modified: branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_select.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/space_view3d/view3d_select.c	2011-07-12 18:59:54 UTC (rev 38344)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list