Cleanup: Nodes: Use consistent errors for nodes built without features

This commit is contained in:
Hans Goudey 2021-04-12 17:43:36 -05:00
parent 1e8a808910
commit 8d9fd0427d
Notes: blender-bot 2023-09-08 04:55:43 +02:00
Referenced by commit 721ff6ad12, Fix compile error: Missing include paths
4 changed files with 15 additions and 22 deletions

View File

@ -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}

View File

@ -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;

View File

@ -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()

View File

@ -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);
}