diff options
author | Hans Goudey <h.goudey@me.com> | 2021-04-13 01:43:36 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-04-13 01:43:36 +0300 |
commit | 8d9fd0427dd6cf9556f2bb4415ead82c73300d32 (patch) | |
tree | f0c7058fe4b05bced5a083d1ebc046beae1dae5d | |
parent | 1e8a808910996af132629dce961aa9576dcba50f (diff) |
Cleanup: Nodes: Use consistent errors for nodes built without features
4 files changed, 15 insertions, 22 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 88482b71f68..f9331d8aa7f 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -392,6 +392,10 @@ if(WITH_OPENSUBDIV) add_definitions(-DWITH_OPENSUBDIV) endif() +if(WITH_GMP) + add_definitions(-DWITH_GMP) +endif() + if(WITH_OPENVDB) list(APPEND INC_SYS ${OPENVDB_INCLUDE_DIRS} diff --git a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc index 34fff596902..d8029ea1eeb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc @@ -85,11 +85,10 @@ static void geo_node_boolean_exec(GeoNodeExecParams params) const bool use_self = params.get_input<bool>("Self Intersection"); const bool hole_tolerant = params.get_input<bool>("Hole Tolerant"); - if (operation < 0 || operation > 2) { - BLI_assert(false); - params.set_output("Geometry", GeometrySet()); - return; - } +#ifndef WITH_GMP + params.error_message_add(NodeWarningType::Error, + TIP_("Disabled, Blender was compiled without GMP")); +#endif Vector<const Mesh *> meshes; Vector<const float4x4 *> transforms; diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivide.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivide.cc index d233fd03254..4b7acf2edc0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivide.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivide.cc @@ -49,7 +49,7 @@ static void geo_node_subdivide_exec(GeoNodeExecParams params) #ifndef WITH_OPENSUBDIV params.error_message_add(NodeWarningType::Error, - TIP_("Disabled, Blender was built without OpenSubdiv")); + TIP_("Disabled, Blender was compiled without OpenSubdiv")); params.set_output("Geometry", std::move(geometry_set)); return; #endif @@ -98,6 +98,7 @@ static void geo_node_subdivide_exec(GeoNodeExecParams params) params.set_output("Geometry", std::move(geometry_set)); } + } // namespace blender::nodes void register_node_type_geo_subdivide() diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc index ded39b7d3de..20ffcdb516d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc @@ -37,17 +37,6 @@ static bNodeSocketTemplate geo_node_subdivision_surface_out[] = { {-1, ""}, }; -static void geo_node_subdivision_surface_layout(uiLayout *layout, - bContext *UNUSED(C), - PointerRNA *UNUSED(ptr)) -{ -#ifndef WITH_OPENSUBDIV - uiItemL(layout, IFACE_("Disabled, built without OpenSubdiv"), ICON_ERROR); -#else - UNUSED_VARS(layout); -#endif -} - namespace blender::nodes { static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) { @@ -61,9 +50,8 @@ static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) } #ifndef WITH_OPENSUBDIV - /* Return input geometry if Blender is built without OpenSubdiv. */ - params.set_output("Geometry", std::move(geometry_set)); - return; + params.error_message_add(NodeWarningType::Error, + TIP_("Disabled, Blender was compiled without OpenSubdiv")); #else const int subdiv_level = clamp_i(params.extract_input<int>("Level"), 0, 30); @@ -113,9 +101,11 @@ static void geo_node_subdivision_surface_exec(GeoNodeExecParams params) // BKE_subdiv_stats_print(&subdiv->stats); BKE_subdiv_free(subdiv); - params.set_output("Geometry", std::move(geometry_set)); #endif + + params.set_output("Geometry", std::move(geometry_set)); } + } // namespace blender::nodes void register_node_type_geo_subdivision_surface() @@ -127,6 +117,5 @@ void register_node_type_geo_subdivision_surface() node_type_socket_templates( &ntype, geo_node_subdivision_surface_in, geo_node_subdivision_surface_out); ntype.geometry_node_execute = blender::nodes::geo_node_subdivision_surface_exec; - ntype.draw_buttons = geo_node_subdivision_surface_layout; nodeRegisterType(&ntype); } |