[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39157] branches/soc-2011-onion/source/ blender/editors/sculpt_paint/paint_vertex.c: some more changes from previous patch that got left out
Jason Wilkins
Jason.A.Wilkins at gmail.com
Sun Aug 7 19:04:11 CEST 2011
Revision: 39157
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39157
Author: jwilkins
Date: 2011-08-07 17:04:11 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
some more changes from previous patch that got left out
Modified Paths:
--------------
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c
Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c 2011-08-07 17:01:44 UTC (rev 39156)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_vertex.c 2011-08-07 17:04:11 UTC (rev 39157)
@@ -104,7 +104,7 @@
{
Object *ob = CTX_data_active_object(C);
- return ob && ob->mode == OB_MODE_VERTEX_PAINT && ((Mesh *)ob->data)->totface;
+ return ob && (ob->mode == OB_MODE_VERTEX_PAINT) && get_mesh(ob);
}
int weight_paint_mode_poll(const struct bContext *C)
@@ -185,72 +185,6 @@
return rgba_to_mcol(brush->rgb[0], brush->rgb[1], brush->rgb[2], 1.0f);
}
-static void do_shared_vertexcol(Mesh *me)
-{
- /* if no mcol: do not do */
- /* if tface: only the involved faces, otherwise all */
- MFace *mface;
- MTFace *tface;
- int a;
- short *scolmain, *scol;
- char *mcol;
-
- if(me->mcol==NULL || me->totvert==0 || me->totface==0) return;
-
- scolmain= MEM_callocN(4*sizeof(short)*me->totvert, "colmain");
-
- tface= me->mtface;
- mface= me->mface;
- mcol= (char *)me->mcol;
- for(a=me->totface; a>0; a--, mface++, mcol+=16) {
- if((tface && tface->mode & TF_SHAREDCOL) || (me->editflag & ME_EDIT_PAINT_MASK)==0) {
- scol= scolmain+4*mface->v1;
- scol[0]++; scol[1]+= mcol[1]; scol[2]+= mcol[2]; scol[3]+= mcol[3];
- scol= scolmain+4*mface->v2;
- scol[0]++; scol[1]+= mcol[5]; scol[2]+= mcol[6]; scol[3]+= mcol[7];
- scol= scolmain+4*mface->v3;
- scol[0]++; scol[1]+= mcol[9]; scol[2]+= mcol[10]; scol[3]+= mcol[11];
- if(mface->v4) {
- scol= scolmain+4*mface->v4;
- scol[0]++; scol[1]+= mcol[13]; scol[2]+= mcol[14]; scol[3]+= mcol[15];
- }
- }
- if(tface) tface++;
- }
-
- a= me->totvert;
- scol= scolmain;
- while(a--) {
- if(scol[0]>1) {
- scol[1]/= scol[0];
- scol[2]/= scol[0];
- scol[3]/= scol[0];
- }
- scol+= 4;
- }
-
- tface= me->mtface;
- mface= me->mface;
- mcol= (char *)me->mcol;
- for(a=me->totface; a>0; a--, mface++, mcol+=16) {
- if((tface && tface->mode & TF_SHAREDCOL) || (me->editflag & ME_EDIT_PAINT_MASK)==0) {
- scol= scolmain+4*mface->v1;
- mcol[1]= scol[1]; mcol[2]= scol[2]; mcol[3]= scol[3];
- scol= scolmain+4*mface->v2;
- mcol[5]= scol[1]; mcol[6]= scol[2]; mcol[7]= scol[3];
- scol= scolmain+4*mface->v3;
- mcol[9]= scol[1]; mcol[10]= scol[2]; mcol[11]= scol[3];
- if(mface->v4) {
- scol= scolmain+4*mface->v4;
- mcol[13]= scol[1]; mcol[14]= scol[2]; mcol[15]= scol[3];
- }
- }
- if(tface) tface++;
- }
-
- MEM_freeN(scolmain);
-}
-
static void make_vertexcol(Object *ob) /* single ob */
{
Mesh *me;
@@ -1527,7 +1461,7 @@
float fac;
} VPaintData;
-void paint_raycast_cb(PBVHNode *node, PaintRaycastData *data, float *tmin)
+static void paint_raycast_cb(PBVHNode *node, PaintRaycastData *data, float *tmin)
{
if (BLI_pbvh_node_get_tmin(node) < *tmin &&
BLI_pbvh_node_raycast(
More information about the Bf-blender-cvs
mailing list