[Bf-blender-cvs] [e176d66cbe8] greasepencil-object: Fix: Depsgraph was complaining in debug mode about the "geometry_eval" opnode for GPencil not having any function attached
Joshua Leung
noreply at git.blender.org
Tue Nov 7 08:54:18 CET 2017
Commit: e176d66cbe84b7365bf3bf953ab314bdf82f00f3
Author: Joshua Leung
Date: Tue Nov 7 20:51:54 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBe176d66cbe84b7365bf3bf953ab314bdf82f00f3
Fix: Depsgraph was complaining in debug mode about the "geometry_eval" opnode for GPencil not having any function attached
In future, maybe we should move the derived_gpf calculations
(and by extension, the modifier-evaluation loops) into the
BKE_gpencil_eval_geometry() callback added in this commit.
===================================================================
M source/blender/blenkernel/BKE_gpencil.h
M source/blender/blenkernel/intern/gpencil_modifier.c
M source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 48ad56c74af..ac242620005 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -187,6 +187,9 @@ struct bGPDweight *BKE_gpencil_vgroup_add_point_weight(struct bGPDspoint *pt, in
bool BKE_gpencil_vgroup_remove_point_weight(struct bGPDspoint *pt, int index);
void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst);
+/* GPencil geometry evaluation */
+void BKE_gpencil_eval_geometry(const struct EvaluationContext *eval_ctx, struct bGPdata *gpd);
+
/* modifiers */
bool BKE_gpencil_has_geometry_modifiers(struct Object *ob);
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 7d50e9cb454..9fc535bcd16 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -362,4 +362,16 @@ void BKE_gpencil_geometry_modifiers(EvaluationContext *eval_ctx, Object *ob, bGP
}
}
+/* *************************************************** */
+
+void BKE_gpencil_eval_geometry(const EvaluationContext *UNUSED(eval_ctx),
+ bGPdata *UNUSED(gpd))
+{
+ /* TODO: Move "derived_gpf" logic here from DRW_gpencil_populate_datablock()?
+ * This way, we wouldn't have to mess around trying to figure out how to pass
+ * an EvaluationContext to each of the modifiers.
+ */
+}
+
+
/* *************************************************** */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 26700b26d8d..1a5027953b2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -75,6 +75,7 @@ extern "C" {
#include "BKE_curve.h"
#include "BKE_effect.h"
#include "BKE_fcurve.h"
+#include "BKE_gpencil.h"
#include "BKE_idcode.h"
#include "BKE_group.h"
#include "BKE_key.h"
@@ -1030,8 +1031,13 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
bGPdata *gpd = (bGPdata *)obdata;
ID *gpd_id = &gpd->id; /* No COW for now, as GP uses its own cache system. See gpencil_engine.c */
- op_node = add_operation_node(gpd_id, DEG_NODE_TYPE_GEOMETRY, NULL, // XXX: cannot be null
- DEG_OPCODE_PLACEHOLDER, "GP Geometry Eval");
+ op_node = add_operation_node(gpd_id,
+ DEG_NODE_TYPE_GEOMETRY,
+ function_bind(BKE_gpencil_eval_geometry,
+ _1,
+ gpd),
+ DEG_OPCODE_PLACEHOLDER,
+ "Geometry Eval");
op_node->set_as_entry();
break;
}
More information about the Bf-blender-cvs
mailing list