Depsgraph: Remove confusing metaball logic
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 6 Jun 2018 07:54:58 +0000 (09:54 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 6 Jun 2018 10:36:51 +0000 (12:36 +0200)
DATA datablock must evaluation must never depend on object it is
used for. If there is something what depends on an object, it must
be done on object level.

At least the actual callback was empty.

source/blender/blenkernel/BKE_mball.h
source/blender/blenkernel/intern/mball.c
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc

index 41f04c09e69be561622a9d648dc9194e74d66be6..74ef9d9dbc0c638504a4c78b33d383cfc1ece983 100644 (file)
@@ -76,8 +76,6 @@ void BKE_mball_select_swap(struct MetaBall *mb);
 
 struct Depsgraph;
 
-void BKE_mball_eval_geometry(struct Depsgraph *depsgraph,
-                             struct MetaBall *mball);
 /* Draw Cache */
 
 enum {
index 339e79f2757a340b319e3a7fff119ca82d69d183..3afaf2d569ec929830b6c495c538e72ca25128ae 100644 (file)
@@ -563,11 +563,6 @@ void BKE_mball_select_swap(struct MetaBall *mb)
 
 /* **** Depsgraph evaluation **** */
 
-void BKE_mball_eval_geometry(struct Depsgraph *UNUSED(depsgraph),
-                             MetaBall *UNUSED(mball))
-{
-}
-
 /* Draw Engine */
 
 void (*BKE_mball_batch_cache_dirty_cb)(MetaBall *mb, int mode) = NULL;
index f01baed06c3605756729f37e0b0e57b2c2d6259b..73bacbc61920e62faff3f8d1a6f44512c431aa3b 100644 (file)
@@ -1077,29 +1077,12 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *object)
 
                case OB_MBALL:
                {
-                       Object *mom = BKE_mball_basis_find(scene_, object);
-                       /* NOTE: Only the motherball gets evaluated, it's children are
-                        * having empty placeholders for the correct relations being built.
-                        */
-                       if (mom == object) {
-                               /* metaball evaluation operations */
-                               op_node = add_operation_node(obdata,
-                                                            DEG_NODE_TYPE_GEOMETRY,
-                                                            function_bind(
-                                                                    BKE_mball_eval_geometry,
-                                                                    _1,
-                                                                    (MetaBall *)obdata_cow),
-                                                            DEG_OPCODE_PLACEHOLDER,
-                                                            "Geometry Eval");
-                       }
-                       else {
-                               op_node = add_operation_node(obdata,
-                                                            DEG_NODE_TYPE_GEOMETRY,
-                                                            NULL,
-                                                            DEG_OPCODE_PLACEHOLDER,
-                                                            "Geometry Eval");
-                               op_node->set_as_entry();
-                       }
+                       op_node = add_operation_node(obdata,
+                                                    DEG_NODE_TYPE_GEOMETRY,
+                                                    NULL,
+                                                    DEG_OPCODE_PLACEHOLDER,
+                                                    "Geometry Eval");
+                       op_node->set_as_entry();
                        break;
                }