From c5569ba140382015c32bd638532097ea05168607 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 18 Dec 2020 13:28:43 +0100 Subject: Geometry Nodes: do not crash when there are undefined nodes Undefined geometry nodes will just output a default value now. --- source/blender/nodes/NOD_geometry_exec.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh index cac04e18fc7..f278d6b4107 100644 --- a/source/blender/nodes/NOD_geometry_exec.hh +++ b/source/blender/nodes/NOD_geometry_exec.hh @@ -44,6 +44,7 @@ using bke::WriteAttribute; using bke::WriteAttributePtr; using fn::CPPType; using fn::GMutablePointer; +using fn::GPointer; using fn::GValueMap; class GeoNodeExecParams { @@ -123,6 +124,16 @@ class GeoNodeExecParams { output_values_.add_new_by_move(identifier, value); } + void set_output_by_copy(StringRef identifier, GPointer value) + { +#ifdef DEBUG + BLI_assert(value.type() != nullptr); + BLI_assert(value.get() != nullptr); + this->check_set_output(identifier, *value.type()); +#endif + output_values_.add_new_by_copy(identifier, value); + } + /** * Store the output value for the given socket identifier. */ -- cgit v1.2.3