Page Menu
Home
Search
Configure Global Search
Log In
Files
F18593
vertmask.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
codemanx
Nov 13 2013, 4:10 PM
Size
4 KB
Subscribers
None
vertmask.diff
View Options
Index: blenkernel/intern/paint.c
===================================================================
--- blenkernel/intern/paint.c (revision 45806)
+++ blenkernel/intern/paint.c (working copy)
@@ -115,7 +115,7 @@
(ob->type == OB_MESH) &&
(ob->data != NULL) &&
(((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) &&
- (ob->mode & OB_MODE_WEIGHT_PAINT)
+ (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT))
);
}
Index: editors/sculpt_paint/paint_ops.c
===================================================================
--- editors/sculpt_paint/paint_ops.c (revision 45806)
+++ editors/sculpt_paint/paint_ops.c (working copy)
@@ -149,6 +149,7 @@
Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
unsigned int paintcol = vpaint_get_current_col(scene->toolsettings->vpaint);
+ // May have to distinguish between face and vert paint mask here...
vpaint_fill(obact, paintcol);
ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
Index: editors/sculpt_paint/paint_vertex.c
===================================================================
--- editors/sculpt_paint/paint_vertex.c (revision 45806)
+++ editors/sculpt_paint/paint_vertex.c (working copy)
@@ -449,19 +449,33 @@
if (!me->mloopcol) return; /* possible we can't make mcol's */
- selected = (me->editflag & ME_EDIT_PAINT_MASK);
+ if (me->editflag & ME_EDIT_VERT_SEL) {
+ for (i = 0; i < me->totpoly; i++) {
- mp = me->mpoly;
- for (i = 0; i < me->totpoly; i++, mp++) {
- if (!(!selected || mp->flag & ME_FACE_SEL))
- continue;
+ for (j = 0; j < me->mpoly[i].totloop; j++) {
+ if (me->mvert[me->mloop[me->mpoly[i].loopstart + j].v].flag & SELECT) {
+ lcol = me->mloopcol + (me->mpoly[i].loopstart + j);
+ *(int *)lcol = paintcol;
+ }
+ }
+ }
+ }
+ else {
- lcol = me->mloopcol + mp->loopstart;
- for (j = 0; j < mp->totloop; j++, lcol++) {
- *(int *)lcol = paintcol;
+ selected = (me->editflag & ME_EDIT_PAINT_MASK);
+
+ mp = me->mpoly;
+ for (i = 0; i < me->totpoly; i++, mp++) {
+ if (!(!selected || mp->flag & ME_FACE_SEL))
+ continue;
+
+ lcol = me->mloopcol + mp->loopstart;
+ for (j = 0; j < mp->totloop; j++, lcol++) {
+ *(int *)lcol = paintcol;
+ }
}
}
-
+
/* remove stale me->mcol, will be added later */
BKE_mesh_tessface_clear(me);
Index: editors/space_view3d/drawobject.c
===================================================================
--- editors/space_view3d/drawobject.c (revision 45806)
+++ editors/space_view3d/drawobject.c (working copy)
@@ -2083,7 +2083,9 @@
// TODO define selected color
if (sel) {
- glColor3f(1.0f, 1.0f, 0.0f);
+ // for vertex paint mode, would be nice to draw some sort of border
+ // otherwise, it can be hard to see where verts are...
+ glColor3f(1.0f, 0.5f, 0.0f);
}
else {
glColor3f(0.0f, 0.0f, 0.0f);
@@ -7365,7 +7367,7 @@
Mesh *me = ob->data;
if ((me->editflag & ME_EDIT_VERT_SEL) &&
/* currently vertex select only supports weight paint */
- (ob->mode & OB_MODE_WEIGHT_PAINT))
+ (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT)))
{
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
glColor3ub(0, 0, 0);
Index: editors/space_view3d/view3d_header.c
===================================================================
--- editors/space_view3d/view3d_header.c (revision 45806)
+++ editors/space_view3d/view3d_header.c (working copy)
@@ -510,7 +510,7 @@
PointerRNA meshptr;
RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
- if (ob->mode & (OB_MODE_TEXTURE_PAINT | OB_MODE_VERTEX_PAINT)) {
+ if (ob->mode & OB_MODE_TEXTURE_PAINT) {
uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
}
else {
Index: makesrna/intern/rna_mesh.c
===================================================================
--- makesrna/intern/rna_mesh.c (revision 45806)
+++ makesrna/intern/rna_mesh.c (working copy)
@@ -2798,7 +2798,7 @@
prop = RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
- RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
+ RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight and vertex paint only)");
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask");
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5c/5e/dd3b94cf86661b5e07b58bc43861
Event Timeline
Log In to Comment