diff --git a/props/prop_data_entry.cpp b/props/prop_data_entry.cpp index 2f0f605..cd09c66 100644 --- a/props/prop_data_entry.cpp +++ b/props/prop_data_entry.cpp @@ -48,6 +48,9 @@ void PropDataEntry::processor_process(Ref prop_data, Node *node, const Node *PropDataEntry::processor_get_node_for(const Transform &transform) { return call("_processor_get_node_for", transform); } +bool PropDataEntry::processor_evaluate_children() { + return call("_processor_evaluate_children"); +} bool PropDataEntry::_processor_handles(Node *node) { return false; @@ -57,6 +60,9 @@ void PropDataEntry::_processor_process(Ref prop_data, Node *node, cons Node *PropDataEntry::_processor_get_node_for(const Transform &transform) { return NULL; } +bool PropDataEntry::_processor_evaluate_children() { + return true; +} PropDataEntry::PropDataEntry() { } @@ -83,11 +89,15 @@ void PropDataEntry::_bind_methods() { BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"), "_processor_get_node_for", PropertyInfo(Variant::TRANSFORM, "transform"))); + BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::BOOL, "evaluate"), "_processor_evaluate_children")); + ClassDB::bind_method(D_METHOD("processor_handles", "node"), &PropDataEntry::processor_handles); ClassDB::bind_method(D_METHOD("processor_process", "prop_data", "node", "transform"), &PropDataEntry::processor_process); ClassDB::bind_method(D_METHOD("processor_get_node_for", "prop_data"), &PropDataEntry::processor_get_node_for); + ClassDB::bind_method(D_METHOD("processor_evaluate_children", "node"), &PropDataEntry::processor_evaluate_children); ClassDB::bind_method(D_METHOD("_processor_handles", "node"), &PropDataEntry::_processor_handles); ClassDB::bind_method(D_METHOD("_processor_process", "prop_data", "node", "transform"), &PropDataEntry::_processor_process); ClassDB::bind_method(D_METHOD("_processor_get_node_for", "transform"), &PropDataEntry::_processor_get_node_for); + ClassDB::bind_method(D_METHOD("_processor_evaluate_children"), &PropDataEntry::_processor_evaluate_children); } diff --git a/props/prop_data_entry.h b/props/prop_data_entry.h index dc60cb7..b9dc1b7 100644 --- a/props/prop_data_entry.h +++ b/props/prop_data_entry.h @@ -46,10 +46,12 @@ public: bool processor_handles(Node *node); void processor_process(Ref prop_data, Node *node, const Transform &transform); Node *processor_get_node_for(const Transform &transform); + bool processor_evaluate_children(); virtual bool _processor_handles(Node *node); virtual void _processor_process(Ref prop_data, Node *node, const Transform &transform); virtual Node *_processor_get_node_for(const Transform &transform); + virtual bool _processor_evaluate_children(); PropDataEntry(); ~PropDataEntry(); diff --git a/singleton/prop_utils.cpp b/singleton/prop_utils.cpp index 1c079aa..e95d253 100644 --- a/singleton/prop_utils.cpp +++ b/singleton/prop_utils.cpp @@ -54,6 +54,11 @@ void PropUtils::_convert_tree(Ref prop_data, Node *node, const Transfo if (proc->processor_handles(node)) { proc->processor_process(prop_data, node, transform); + + if (!proc->processor_evaluate_children()) { + return; + } + break; } }