[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20654] branches/soc-2009-yukishiro/source /blender: fix multiple objects update and object seelction with modifiers with an awkward change in cdDM_drawMappedFaces
Jingyuan Huang
jingyuan.huang at gmail.com
Fri Jun 5 17:48:07 CEST 2009
Revision: 20654
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20654
Author: yukishiro
Date: 2009-06-05 17:48:07 +0200 (Fri, 05 Jun 2009)
Log Message:
-----------
fix multiple objects update and object seelction with modifiers with an awkward change in cdDM_drawMappedFaces
Modified Paths:
--------------
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/cdderivedmesh.c
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_draw.c
Modified: branches/soc-2009-yukishiro/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenkernel/intern/cdderivedmesh.c 2009-06-05 15:19:13 UTC (rev 20653)
+++ branches/soc-2009-yukishiro/source/blender/blenkernel/intern/cdderivedmesh.c 2009-06-05 15:48:07 UTC (rev 20654)
@@ -484,7 +484,7 @@
MFace *mf = cddm->mface;
MCol *mc;
float *nors= dm->getFaceDataArray(dm, CD_NORMAL);
- int i, orig, *index = DM_get_face_data_layer(dm, CD_ORIGINDEX);
+ int i, orig, *index=0;// TODO = DM_get_face_data_layer(dm, CD_ORIGINDEX);
mc = DM_get_face_data_layer(dm, CD_WEIGHT_MCOL);
if(!mc)
Modified: branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c 2009-06-05 15:19:13 UTC (rev 20653)
+++ branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c 2009-06-05 15:48:07 UTC (rev 20654)
@@ -435,6 +435,9 @@
case MOUSEMOVE:
{
Mesh *me= ob->data;
+ DerivedMesh *dm = mesh_get_derived_final(scene, ob, vc->v3d->customdata_mask);
+ int totface = dm->getNumFaces(dm);
+ MFace *mface = dm->getFaceArray(dm);
float mat[4][4];
int *indexar= pop->indexar;
int totindex, index;
@@ -450,17 +453,16 @@
mval[0]= event->x - vc->ar->winrct.xmin;
mval[1]= event->y - vc->ar->winrct.ymin;
- totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], lp->brush->size);
+ totindex= sample_backbuf_area(vc, indexar, totface, mval[0], mval[1], lp->brush->size);
ps->ob = ob;
for(index=0; index<totindex; index++) {
- if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= ((MFace *)me->mface) + (indexar[index]-1);
- DerivedMesh *dm = mesh_get_derived_final(scene, ob, vc->v3d->customdata_mask);
+ if(indexar[index] && indexar[index]<=totface) {
+ MFace *mf= mface + (indexar[index]-1);
unsigned char *shcol= DM_get_face_data_layer(dm, CD_SH_MCOL);
unsigned int *mcol= (unsigned int*)shcol + 4*(indexar[index]-1);
- add_face_vertices(ps, mface);
+ add_face_vertices(ps, mf);
// TODO: blend it using alpha
*mcol = pop->paintcol;
Modified: branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c 2009-06-05 15:19:13 UTC (rev 20653)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c 2009-06-05 15:48:07 UTC (rev 20654)
@@ -2497,7 +2497,6 @@
if (rv3d->rflag & RV3D_RECALCMCOL) {
calc_sh_color(scene, ob, dm, shcol);
- rv3d->rflag &= ~RV3D_RECALCMCOL;
}
dm->drawFacesColored(dm, me->flag, shcol, NULL);
Modified: branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_draw.c 2009-06-05 15:19:13 UTC (rev 20653)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_draw.c 2009-06-05 15:48:07 UTC (rev 20654)
@@ -2088,6 +2088,9 @@
// addafterqueue(ar->win, BACKBUFDRAW, 1);
//}
}
+
+ if (rv3d->rflag & RV3D_RECALCMCOL)
+ rv3d->rflag &= ~RV3D_RECALCMCOL;
#ifndef DISABLE_PYTHON
/* XXX here was scriptlink */
More information about the Bf-blender-cvs
mailing list