svn merge ^/trunk/blender -r43220:43278 --accept postpone
authorCampbell Barton <ideasman42@gmail.com>
Wed, 11 Jan 2012 14:14:04 +0000 (14:14 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 11 Jan 2012 14:14:04 +0000 (14:14 +0000)
16 files changed:
1  2 
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/multires.c
source/blender/editors/include/ED_view3d.h
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/SConscript
source/blender/windowmanager/intern/wm_init_exit.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt

@@@ -1018,24 -757,32 +1018,38 @@@ static unsigned char *calc_weightpaint_
  static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
  {
        ColorBand *coba= stored_cb;     /* warning, not a local var */
 -
 -      Mesh *me = ob->data;
        unsigned char *wtcol_v = calc_weightpaint_vert_array(ob, draw_flag, coba);
 -      unsigned char *wtcol_f = MEM_mallocN (sizeof(unsigned char) * me->totface*4*4, "weightmap_f");
 +      unsigned char *wtcol_f;
 +      unsigned char(*wtcol_l)[4] = NULL;
 +      BLI_array_declare(wtcol_l);
 +      MFace *mf = dm->getTessFaceArray(dm);
 +      MLoop *mloop = dm->getLoopArray(dm), *ml;
 +      MPoly *mp = dm->getPolyArray(dm);
 +      int i, j, totface=dm->getNumTessFaces(dm), totloop;
 +      int *origIndex = dm->getVertDataArray(dm, CD_ORIGINDEX);
+       unsigned char *wtcol_f_step = wtcol_f;
  
 -      MFace *mf = me->mface;
 -      int i;
 +      wtcol_f = MEM_mallocN(sizeof (unsigned char) * totface*4*4, "weightmap_f");
  
 -      for (i=0; i<me->totface; i++, mf++, wtcol_f_step += (4 * 4)) {
 +      /*first add colors to the tesselation faces*/
-       for (i=0; i<totface; i++, mf++) {
++      for (i=0; i<totface; i++, mf++, wtcol_f_step += (4 * 4)) {
 +              /*origindex being NULL means we're operating on original mesh data*/
+ #if 0
                unsigned int fidx= mf->v4 ? 3:2;
+ #else /* better zero out triangles 4th component. else valgrind complains when the buffer's copied */
+               unsigned int fidx;
+               if (mf->v4) {
+                       fidx = 3;
+               }
+               else {
+                       fidx = 2;
+                       *(int *)(&wtcol_f_step[3 * 4]) = 0;
+               }
+ #endif
                do {
-                       copy_v4_v4_char((char *)&wtcol_f[(4 * i + fidx) * 4],
+                       copy_v4_v4_char((char *)&wtcol_f_step[fidx * 4],
                                        (char *)&wtcol_v[4 * (*(&mf->v1 + fidx))]);
                } while (fidx--);
        }
@@@ -1777,10 -1613,10 +1777,10 @@@ static void multires_apply_smat(Scene *
        MultiresModifierData *mmd= get_multires_modifier(scene, ob, 1);
        MultiresModifierData high_mmd;
  
 -      CustomData_external_read(&me->fdata, &me->id, CD_MASK_MDISPS, me->totface);
 -      mdisps= CustomData_get_layer(&me->fdata, CD_MDISPS);
 +      CustomData_external_read(&me->ldata, &me->id, CD_MASK_MDISPS, me->totloop);
 +      mdisps= CustomData_get_layer(&me->ldata, CD_MDISPS);
  
-       if(!mdisps || !mmd) return;
+       if(!mdisps || !mmd || !mmd->totlvl) return;
  
        /* we need derived mesh created from highest resolution */
        high_mmd= *mmd;
Simple merge
@@@ -12,6 -12,6 +12,9 @@@ incs += ' ../render/extern/include #/in
  incs += ' ../nodes'
  incs += ' #/extern/glew/include'
  
++incs += ' ../bmesh'
++
++
  defs = []
  
  if env['WITH_BF_OPENEXR']:
@@@ -32,8 -32,8 +32,8 @@@ defs = [
  incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel ../../blenloader'
  incs += ' ../../imbuf ../../makesdna ../../makesrna ../../ikplugin'
  incs += ' ../../windowmanager ../../editors/include ../../blenfont'
 -incs += ' ../../render/extern/include'
 +incs += ' ../../render/extern/include ../../bmesh'
- incs += ' #/intern/audaspace/intern '
+ incs += ' #/intern/audaspace/intern #/intern/cycles/blender'
  incs += ' #/extern/glew/include '
  
  if env['WITH_BF_OPENEXR']:
Simple merge