[Bf-blender-cvs] [3c626fd] depsgraph_refactor: Depsgraph: Fill in callbacks for mesh/curve geometry update

Sergey Sharybin noreply at git.blender.org
Wed Jan 14 15:36:52 CET 2015


Commit: 3c626fdc32dd556647cfa5f7d240fc010b1a09b2
Author: Sergey Sharybin
Date:   Wed Jan 14 19:35:59 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB3c626fdc32dd556647cfa5f7d240fc010b1a09b2

Depsgraph: Fill in callbacks for mesh/curve geometry update

For now they'll only calculate bounding box there. in the future it might be
extended further.

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

M	source/blender/blenkernel/intern/curve.c
M	source/blender/blenkernel/intern/mesh.c

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

diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 4d7bac1..edde799 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -4496,11 +4496,23 @@ void BKE_curve_rect_from_textbox(const struct Curve *cu, const struct TextBox *t
 /* **** Depsgraph evaluation **** */
 
 void BKE_curve_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
-                             Curve *UNUSED(curve))
+                             Curve *curve)
 {
+	if (G.debug & G_DEBUG_DEPSGRAPH) {
+		printf("%s on %s\n", __func__, curve->id.name);
+	}
+	if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) {
+		BKE_curve_texspace_calc(curve);
+	}
 }
 
 void BKE_curve_eval_path(EvaluationContext *UNUSED(eval_ctx),
-                         Curve *UNUSED(curve))
+                         Curve *curve)
 {
+	/* TODO(sergey): This will probably need to be a part of
+	 * the modifier stack still.
+	 */
+	if (G.debug & G_DEBUG_DEPSGRAPH) {
+		printf("%s on %s\n", __func__, curve->id.name);
+	}
 }
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 047efc2..04bf679 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -2334,6 +2334,12 @@ Mesh *BKE_mesh_new_from_object(
 /* **** Depsgraph evaluation **** */
 
 void BKE_mesh_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
-                            Mesh *UNUSED(mesh))
+                            Mesh *mesh)
 {
+	if (G.debug & G_DEBUG_DEPSGRAPH) {
+		printf("%s on %s\n", __func__, mesh->id.name);
+	}
+	if (mesh->bb == NULL || (mesh->bb->flag & BOUNDBOX_DIRTY)) {
+		BKE_mesh_texspace_calc(mesh);
+	}
 }




More information about the Bf-blender-cvs mailing list