[Bf-blender-cvs] [5ce1b86] temp_depsgraph_split_ubereval: Split the "uber-eval" function for object data into individual operations based on object type.

Lukas Tönne noreply at git.blender.org
Wed Sep 23 19:31:42 CEST 2015


Commit: 5ce1b86aaaed8ad19e2e8118e71d9a32b6c62468
Author: Lukas Tönne
Date:   Wed Sep 23 10:10:59 2015 +0200
Branches: temp_depsgraph_split_ubereval
https://developer.blender.org/rB5ce1b86aaaed8ad19e2e8118e71d9a32b6c62468

Split the "uber-eval" function for object data into individual operations based on object type.

This means making a dedicated data generation function for object types that need it,
and a few utility functions for particles and extra driver evaluation (hopefully soon to be deprecated).

Remaining "uber" functions in the depsgraph should be split in a similar manner in future.

The splitting allows us to go deeper into the design of certain object types (meshes in particular)
and improve these without having to deal with all the other types.

Note on mesh vs editmesh operations:

Mesh and editmesh are calculated in separate functions. In order to get to a point
where splitting into individual modifiers makes sense, the first step is to have
two separate operations for these.

Changing edit mode does not rebuild the depsgraph, so we cannot selectively
add only one or the other at build time. Instead both operations are added, but only
one of them is actually executed. Currently this uses an internal test for the edit
mesh, but could later be controlled on the depsgraph level based on active branches.

Differential Revision: https://developer.blender.org/D1527

===================================================================

M	source/blender/blenkernel/BKE_armature.h
M	source/blender/blenkernel/BKE_curve.h
M	source/blender/blenkernel/BKE_lattice.h
M	source/blender/blenkernel/BKE_mball.h
M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/intern/armature_update.c
M	source/blender/blenkernel/intern/curve.c
M	source/blender/blenkernel/intern/lattice.c
M	source/blender/blenkernel/intern/mball.c
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/depsgraph/intern/depsgraph_build_nodes.cc

===================================================================

diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index e1885e4..a521dcb 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -195,6 +195,10 @@ void BKE_pose_eval_flush(struct EvaluationContext *eval_ctx,
 void BKE_pose_eval_proxy_copy(struct EvaluationContext *eval_ctx,
                               struct Object *ob);
 
+void BKE_object_eval_armature(struct EvaluationContext *eval_ctx,
+                              struct Scene *scene,
+                              struct Object *ob);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index a03dd28..14d4198 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -200,4 +200,8 @@ void BKE_curve_eval_geometry(struct EvaluationContext *eval_ctx,
 void BKE_curve_eval_path(struct EvaluationContext *eval_ctx,
                          struct Curve *curve);
 
+void BKE_object_eval_curve(struct EvaluationContext *eval_ctx,
+                           struct Scene *scene,
+                           struct Object *ob);
+
 #endif  /* __BKE_CURVE_H__ */
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index 677d8e3..07e3968 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -102,4 +102,8 @@ struct EvaluationContext;
 void BKE_lattice_eval_geometry(struct EvaluationContext *eval_ctx,
                                struct Lattice *latt);
 
+void BKE_object_eval_lattice(struct EvaluationContext *eval_ctx,
+                             struct Scene *scene,
+                             struct Object *ob);
+
 #endif  /* __BKE_LATTICE_H__ */
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h
index 62cd500..638a04d 100644
--- a/source/blender/blenkernel/BKE_mball.h
+++ b/source/blender/blenkernel/BKE_mball.h
@@ -75,4 +75,8 @@ struct EvaluationContext;
 void BKE_mball_eval_geometry(struct EvaluationContext *eval_ctx,
                              struct MetaBall *mball);
 
+void BKE_object_eval_mball(struct EvaluationContext *eval_ctx,
+                           struct Scene *scene,
+                           struct Object *ob);
+
 #endif
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index e286a78..2df666e 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -207,14 +207,9 @@ void BKE_object_eval_data_ready(struct EvaluationContext *eval_ctx,
                                 struct Object *ob);
 
 void BKE_object_handle_data_update(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
-void BKE_object_eval_armature(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
-void BKE_object_eval_mball(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
-void BKE_object_eval_curve(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
-void BKE_object_eval_lattice(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
 void BKE_object_eval_empty(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
 void BKE_object_eval_material_drivers(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
 void BKE_object_eval_lamp_drivers(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
-void BKE_object_eval_particles(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
 
 void BKE_object_handle_update(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
 void BKE_object_handle_update_ex(struct EvaluationContext *eval_ctx,
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 89cfb3a..a40a56e 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -468,4 +468,8 @@ void BKE_particle_system_eval(struct EvaluationContext *eval_ctx,
                               struct Object *ob,
                               struct ParticleSystem *psys);
 
+void BKE_object_eval_particles(struct EvaluationContext *eval_ctx,
+                               struct Scene *scene,
+                               struct Object *ob);
+
 #endif
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index ceda9f0..1e09b20 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -695,3 +695,18 @@ void BKE_pose_eval_proxy_copy(EvaluationContext *UNUSED(eval_ctx), Object *ob)
 		       ob->id.name + 2, ob->proxy_from->id.name + 2);
 	}
 }
+
+void BKE_object_eval_armature(EvaluationContext *UNUSED(eval_ctx),
+                                            Scene *scene,
+                                            Object *ob)
+{
+	if (ob->id.lib && ob->proxy_from) {
+		if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
+			printf("Proxy copy error, lib Object: %s proxy Object: %s\n",
+			       ob->id.name + 2, ob->proxy_from->id.name + 2);
+		}
+	}
+	else {
+		BKE_pose_where_is(scene, ob);
+	}
+}
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 8d7d62b..ac39a9f 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -4655,3 +4655,10 @@ void BKE_curve_eval_path(EvaluationContext *UNUSED(eval_ctx),
 		printf("%s on %s\n", __func__, curve->id.name);
 	}
 }
+
+void BKE_object_eval_curve(EvaluationContext *UNUSED(eval_ctx),
+                           Scene *scene,
+                           Object *ob)
+{
+	BKE_displist_make_curveTypes(scene, ob, false);
+}
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 009e1d2..f5244ff 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -1257,3 +1257,9 @@ void BKE_lattice_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
 {
 }
 
+void BKE_object_eval_lattice(EvaluationContext *UNUSED(eval_ctx),
+                             Scene *scene,
+                             Object *ob)
+{
+	BKE_lattice_modifiers_calc(scene, ob);
+}
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index c09cd1a..a3dd413 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -592,3 +592,10 @@ void BKE_mball_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
                              MetaBall *UNUSED(mball))
 {
 }
+
+void BKE_object_eval_mball(EvaluationContext *eval_ctx,
+                                         Scene *scene,
+                                         Object *ob)
+{
+	BKE_displist_make_mball(eval_ctx, scene, ob);
+}
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 6812a96..1233e28 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -57,6 +57,8 @@
 #include "BKE_scene.h"
 #include "BKE_material.h"
 #include "BKE_image.h"
+#include "BKE_mball.h"
+#include "BKE_curve.h"
 
 #include "DEG_depsgraph.h"
 
@@ -156,42 +158,6 @@ void BKE_object_eval_modifier(struct EvaluationContext *eval_ctx,
 	(void) md;  /* Ignored. */
 }
 
-void BKE_object_eval_armature(EvaluationContext *UNUSED(eval_ctx),
-                                            Scene *scene,
-                                            Object *ob)
-{
-	if (ob->id.lib && ob->proxy_from) {
-		if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
-			printf("Proxy copy error, lib Object: %s proxy Object: %s\n",
-			       ob->id.name + 2, ob->proxy_from->id.name + 2);
-		}
-	}
-	else {
-		BKE_pose_where_is(scene, ob);
-	}
-}
-
-void BKE_object_eval_mball(EvaluationContext *eval_ctx,
-                                         Scene *scene,
-                                         Object *ob)
-{
-	BKE_displist_make_mball(eval_ctx, scene, ob);
-}
-
-void BKE_object_eval_curve(EvaluationContext *UNUSED(eval_ctx),
-                                         Scene *scene,
-                                         Object *ob)
-{
-	BKE_displist_make_curveTypes(scene, ob, 0);
-}
-
-void BKE_object_eval_lattice(EvaluationContext *UNUSED(eval_ctx),
-                                           Scene *scene,
-                                           Object *ob)
-{
-	BKE_lattice_modifiers_calc(scene, ob);
-}
-
 void BKE_object_eval_empty(EvaluationContext *UNUSED(eval_ctx),
                                          Scene *scene,
                                          Object *ob)
@@ -228,55 +194,6 @@ void BKE_object_eval_lamp_drivers(EvaluationContext *UNUSED(eval_ctx),
 	lamp_drivers_update(scene, ob->data, ctime);
 }
 
-void BKE_object_eval_particles(EvaluationContext *eval_ctx,
-                                      Scene *scene,
-                                      Object *ob)
-{
-	ParticleSystem *tpsys, *psys;
-	DerivedMesh *dm;
-	ob->transflag &= ~OB_DUPLIPARTS;
-	psys = ob->particlesystem.first;
-	while (psys) {
-		/* ensure this update always happens even if psys is disabled */
-		if (psys->recalc & PSYS_RECALC_TYPE) {
-			psys_changed_type(ob, psys);
-		}
-		
-		if (psys_check_enabled(ob, psys)) {
-			/* check use of dupli objects here */
-			if (psys->part && (psys->part->draw_as == PART_DRAW_REND || eval_ctx->mode == DAG_EVAL_RENDER) &&
-			    ((psys->part->ren_as == PART_DRAW_OB && psys->part->dup_ob) ||
-			     (psys->part->ren_as == PART_DRAW_GR && psys->part->dup_group)))
-			{
-				ob->transflag |= OB_DUPLIPARTS;
-			}
-			
-			particle_system_update(scene, ob, psys);
-			psys = psys->next;
-		}
-		else if (psys->flag & PSYS_DELETE) {
-			tpsys = psys->next;
-			BLI_remlink(&ob->particlesystem, psys);
-			psys_free(ob, psys);
-			psys = tpsys;
-		}
-		else
-			psys = psys->next;
-	}
-	
-	if (eval_ctx->mode == DAG_

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list