Cleanup: removed unused derivedDeform and derivedFinal
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 26 Jan 2020 15:35:42 +0000 (16:35 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 27 Jan 2020 11:18:43 +0000 (12:18 +0100)
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/makesdna/DNA_object_types.h

index ec6ec027810f2033b8eded231a9e0d0aef49771a..54cd172655e958a6b2c23ad14a27539687447250 100644 (file)
@@ -66,7 +66,6 @@ void BKE_object_free_curve_cache(struct Object *ob);
 
 void BKE_object_free(struct Object *ob);
 void BKE_object_free_derived_caches(struct Object *ob);
-void BKE_object_free_derived_mesh_caches(struct Object *ob);
 void BKE_object_free_caches(struct Object *object);
 
 void BKE_object_modifier_hook_reset(struct Object *ob, struct HookModifierData *hmd);
index a539aa45cf6acca0a4f4480bb8075b4f76fcb9f8..23fa8dd60d5f97f3658de2f9e6521321355c274d 100644 (file)
@@ -1289,13 +1289,9 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
       int i, j, numGrids, highGridSize, lowGridSize;
       const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
 
-      /* create subsurf DM from original mesh at high level */
-      if (ob->derivedDeform) {
-        cddm = CDDM_copy(ob->derivedDeform);
-      }
-      else {
-        cddm = CDDM_from_mesh(me);
-      }
+      /* Create subsurf DM from original mesh at high level. */
+      /* TODO: use mesh_deform_eval when sculpting on deformed mesh. */
+      cddm = CDDM_from_mesh(me);
       DM_set_only_copy(cddm, &CD_MASK_BAREMESH);
 
       highdm = subsurf_dm_create_local(scene,
@@ -1369,12 +1365,8 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
       DerivedMesh *cddm, *subdm;
       const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
 
-      if (ob->derivedDeform) {
-        cddm = CDDM_copy(ob->derivedDeform);
-      }
-      else {
-        cddm = CDDM_from_mesh(me);
-      }
+      /* TODO: use mesh_deform_eval when sculpting on deformed mesh. */
+      cddm = CDDM_from_mesh(me);
       DM_set_only_copy(cddm, &CD_MASK_BAREMESH);
 
       subdm = subsurf_dm_create_local(scene,
index d0bbbe997cb663d68d041c9b29a3b68c1b65b66c..90205286a720121f3ecb82600832d85da8eb8f6c 100644 (file)
@@ -430,7 +430,6 @@ void BKE_object_free_derived_caches(Object *ob)
   MEM_SAFE_FREE(ob->runtime.bb);
 
   object_update_from_subsurf_ccg(ob);
-  BKE_object_free_derived_mesh_caches(ob);
 
   /* Restore initial pointer. */
   if (ob->runtime.mesh_orig != NULL) {
@@ -457,20 +456,6 @@ void BKE_object_free_derived_caches(Object *ob)
   DRW_gpencil_freecache(ob);
 }
 
-void BKE_object_free_derived_mesh_caches(struct Object *ob)
-{
-  if (ob->derivedFinal) {
-    ob->derivedFinal->needsFree = 1;
-    ob->derivedFinal->release(ob->derivedFinal);
-    ob->derivedFinal = NULL;
-  }
-  if (ob->derivedDeform) {
-    ob->derivedDeform->needsFree = 1;
-    ob->derivedDeform->release(ob->derivedDeform);
-    ob->derivedDeform = NULL;
-  }
-}
-
 void BKE_object_free_caches(Object *object)
 {
   ModifierData *md;
@@ -1427,9 +1412,6 @@ void BKE_object_copy_data(Main *bmain, Object *ob_dst, const Object *ob_src, con
 
   BKE_object_copy_particlesystems(ob_dst, ob_src, flag_subdata);
 
-  ob_dst->derivedDeform = NULL;
-  ob_dst->derivedFinal = NULL;
-
   BLI_listbase_clear((ListBase *)&ob_dst->drawdata);
   BLI_listbase_clear(&ob_dst->pc_ids);
 
index e1424da2207616e730082c5d602ed7cb7b8215b7..d9d89592e85839c48dcf6cab13f356824f7a619f 100644 (file)
@@ -6220,8 +6220,6 @@ static void direct_link_object(FileData *fd, Object *ob)
     BKE_object_empty_draw_type_set(ob, ob->empty_drawtype);
   }
 
-  ob->derivedDeform = NULL;
-  ob->derivedFinal = NULL;
   BKE_object_runtime_reset(ob);
   link_list(fd, &ob->pc_ids);
 
index fbed07540466eed5e770c645f689259505b12a3a..cbed2af7df2e793a5dd17b7953819740a9786f6f 100644 (file)
@@ -374,8 +374,6 @@ typedef struct Object {
   struct FluidsimSettings *fluidsimSettings
       DNA_DEPRECATED;  // XXX deprecated... replaced by mantaflow, keep for readfile
 
-  struct DerivedMesh *derivedDeform, *derivedFinal;
-
   ListBase pc_ids;
 
   /** Settings for Bullet rigid body. */