[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30173] branches/soc-2010-nicolasbishop/ source/blender: * VPaint brush strength works again
Nicholas Bishop
nicholasbishop at gmail.com
Sat Jul 10 06:48:39 CEST 2010
Revision: 30173
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30173
Author: nicholasbishop
Date: 2010-07-10 06:48:38 +0200 (Sat, 10 Jul 2010)
Log Message:
-----------
* VPaint brush strength works again
* Finally fixed the mesh-turns-orange problem with glColorMaterial
Modified Paths:
--------------
branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/cdderivedmesh.c
branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_vertex.c
branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/drawobject.c
branches/soc-2010-nicolasbishop/source/blender/gpu/intern/gpu_buffers.c
Modified: branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/cdderivedmesh.c 2010-07-10 03:48:23 UTC (rev 30172)
+++ branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/cdderivedmesh.c 2010-07-10 04:48:38 UTC (rev 30173)
@@ -440,11 +440,7 @@
if(mface->flag & ME_SMOOTH)
drawflags |= GPU_DRAW_SMOOTH;
- glEnable(GL_LIGHTING);
-
BLI_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, drawflags);
-
- glDisable(GL_LIGHTING);
}
return 1;
Modified: branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_vertex.c 2010-07-10 03:48:23 UTC (rev 30172)
+++ branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/paint_vertex.c 2010-07-10 04:48:38 UTC (rev 30173)
@@ -1967,8 +1967,9 @@
if(dist_squared < radius_squared) {
dist = sqrtf(dist_squared);
- str = brush_curve_strength(brush, dist,
- radius);
+ str = brush->alpha *
+ brush_curve_strength(brush, dist,
+ radius);
vpaint_blend(vp, col, orig_col,
vpd->paintcol,
@@ -2012,6 +2013,10 @@
if(nodes)
MEM_freeN(nodes);
+ /* was disabled because it is slow, but necessary for blur */
+ if(brush->vertexpaint_tool == VP_BLUR)
+ do_shared_vertexcol(ob->data);
+
ED_region_tag_redraw(vc->ar);
}
Modified: branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/drawobject.c 2010-07-10 03:48:23 UTC (rev 30172)
+++ branches/soc-2010-nicolasbishop/source/blender/editors/space_view3d/drawobject.c 2010-07-10 04:48:38 UTC (rev 30173)
@@ -2635,8 +2635,17 @@
GPU_disable_material();
}
else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_TEXTURE_PAINT)) {
- if(me->mcol)
+ if(me->mcol) {
+ VPaint *vp = scene->toolsettings->vpaint;
+ /* XXX - temporary - set up nicer drawing for new vpaint */
+ if(!(vp->flag & VP_BACKBUF)) {
+ MFace *mface = get_mesh(ob)->mface;
+ GPU_enable_material(mface->mat_nr+1, NULL);
+ glEnable(GL_LIGHTING);
+ }
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1);
+ glDisable(GL_LIGHTING);
+ }
else {
glColor3f(1.0f, 1.0f, 1.0f);
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 0);
Modified: branches/soc-2010-nicolasbishop/source/blender/gpu/intern/gpu_buffers.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/gpu/intern/gpu_buffers.c 2010-07-10 03:48:23 UTC (rev 30172)
+++ branches/soc-2010-nicolasbishop/source/blender/gpu/intern/gpu_buffers.c 2010-07-10 04:48:38 UTC (rev 30173)
@@ -867,6 +867,7 @@
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
if(buffers->color_buf) {
+ glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glGetBooleanv(GL_COLOR_MATERIAL, &colmat);
glEnable(GL_COLOR_MATERIAL);
}
@@ -897,7 +898,7 @@
}
if(buffers->color_buf && !colmat)
- glDisable(GL_COLOR_MATERIAL);
+ glDisable(GL_COLOR_MATERIAL);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
More information about the Bf-blender-cvs
mailing list