diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-22 16:15:03 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-22 16:15:03 +0300 |
commit | dd5131bd700c7eae9772b54de1640ef15edff28f (patch) | |
tree | dd99c58c66ff30392ae75890e17e8ef469c12ab3 /source/blender/blenkernel/intern/node.cc | |
parent | dc06bf2cb6b1289cdb90b960b8f125f99e57946b (diff) |
Geometry Nodes: Add Self Object Node
From the nodes' description: "Retrieve the object that contains
the geometry nodes modifier currently being executed". This was
discussed in the most recent geometry nodes module meeting.
Because the node allows you to retrieve the position of the modifier
object, it has to add a depsgraph relation to object transform.
Expect that modifiers will be reevaluated when moving the object.
In the future, better static analysis of node trees could make this
check smarter.
Differential Revision: https://developer.blender.org/D16037
Diffstat (limited to 'source/blender/blenkernel/intern/node.cc')
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 3a241efdac2..e5eb7a6c59a 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -2178,7 +2178,7 @@ bNode *nodeAddNode(const struct bContext *C, bNodeTree *ntree, const char *idnam BKE_ntree_update_tag_node_new(ntree, node); - if (node->type == GEO_NODE_INPUT_SCENE_TIME) { + if (ELEM(node->type, GEO_NODE_INPUT_SCENE_TIME, GEO_NODE_SELF_OBJECT)) { DEG_relations_tag_update(CTX_data_main(C)); } @@ -3021,7 +3021,7 @@ void nodeRemoveNode(Main *bmain, bNodeTree *ntree, bNode *node, bool do_id_user) /* Also update relations for the scene time node, which causes a dependency * on time that users expect to be removed when the node is removed. */ - if (node_has_id || node->type == GEO_NODE_INPUT_SCENE_TIME) { + if (node_has_id || ELEM(node->type, GEO_NODE_INPUT_SCENE_TIME, GEO_NODE_SELF_OBJECT)) { if (bmain != nullptr) { DEG_relations_tag_update(bmain); } @@ -4804,6 +4804,7 @@ static void registerGeometryNodes() register_node_type_geo_scale_instances(); register_node_type_geo_separate_components(); register_node_type_geo_separate_geometry(); + register_node_type_geo_self_object(); register_node_type_geo_set_curve_handles(); register_node_type_geo_set_curve_radius(); register_node_type_geo_set_curve_tilt(); |