Merging r57546 through r57569 from trunk into soc-2013-depsgraph_mt
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 19 Jun 2013 08:57:02 +0000 (08:57 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 19 Jun 2013 08:57:02 +0000 (08:57 +0000)
1  2 
source/blender/blenkernel/intern/displist.c

index 7ae9fa0b0c3da98a1a0bb768bf993fe65d83181d,ed8d7bd3d2f517ca60661d4e29baba54f290514f..243276ca55262fdaa4f193def10bac2adf36a287
@@@ -712,11 -712,17 +712,11 @@@ void BKE_displist_make_mball(Scene *sce
        if (!ob || ob->type != OB_MBALL)
                return;
  
 -      /* XXX: mball stuff uses plenty of global variables
 -       *      while this is unchanged updating during render is unsafe
 -       */
 -      if (G.is_rendering)
 -              return;
 -
        BKE_displist_free(&(ob->disp));
  
        if (ob->type == OB_MBALL) {
                if (ob == BKE_mball_basis_find(scene, ob)) {
 -                      BKE_mball_polygonize(scene, ob, &ob->disp);
 +                      BKE_mball_polygonize(scene, ob, &ob->disp, false);
                        BKE_mball_texspace_calc(ob);
  
                        object_deform_mball(ob, &ob->disp);
  
  void BKE_displist_make_mball_forRender(Scene *scene, Object *ob, ListBase *dispbase)
  {
 -      BKE_mball_polygonize(scene, ob, dispbase);
 +      BKE_mball_polygonize(scene, ob, dispbase, true);
        BKE_mball_texspace_calc(ob);
  
        object_deform_mball(ob, dispbase);
@@@ -970,7 -976,6 +970,6 @@@ static void curve_calc_modifiers_post(S
                                        dm = tdm;
  
                                        CDDM_apply_vert_coords(dm, vertCos);
-                                       CDDM_calc_normals_mapping(dm);
                                }
                        }
                        else {
                                }
  
                                dm = CDDM_from_curve_displist(ob, dispbase);
-                               CDDM_calc_normals_mapping(dm);
                        }
  
                        if (vertCos) {
  
                        if (useCache)
                                appf |= MOD_APPLY_USECACHE;
-                       ndm = mti->applyModifier(md, ob, dm, appf);
+                       ndm = modwrap_applyModifier(md, ob, dm, appf);
  
                        if (ndm) {
                                /* Modifier returned a new derived mesh */
        }
  
        if (derivedFinal) {
-               if (dm)
-                       DM_ensure_tessface(dm);  /* needed for drawing */
+               if (dm) {
+                       /* see: mesh_calc_modifiers */
+                       if (dm->getNumTessFaces(dm) == 0) {
+                               dm->recalcTessellation(dm);
+                       }
+                       /* Even if tessellation is not needed, some modifiers might have modified CD layers
+                        * (like mloopcol or mloopuv), hence we have to update those. */
+                       else if (dm->dirty & DM_DIRTY_TESS_CDLAYERS) {
+                               DM_update_tessface_data(dm);
+                       }
+                       CDDM_calc_normals_mapping_ex(dm, (dm->dirty & DM_DIRTY_NORMALS) ? false : true);
+               }
                (*derivedFinal) = dm;
        }
  
@@@ -1390,7 -1405,7 +1399,7 @@@ static void do_makeDispListCurveTypes(S
                if (!forOrco)
                        curve_calc_modifiers_pre(scene, ob, forRender, renderResolution, &originalVerts, &deformedVerts, &numVerts);
  
 -              BKE_curve_bevelList_make(ob);
 +              BKE_curve_bevelList_make(ob, forRender != FALSE);
  
                /* If curve has no bevel will return nothing */
                BKE_curve_bevel_make(scene, ob, &dlbev, forRender, renderResolution);