Cleanup: extract function to show missing openvdb error message

This commit is contained in:
Jacques Lucke
2023-12-20 15:58:56 +01:00
parent a72e7a220d
commit 59c84ee95b
7 changed files with 14 additions and 15 deletions

View File

@@ -93,6 +93,13 @@ const EnumPropertyItem *domain_without_corner_experimental_grease_pencil_version
} // namespace enums
void node_geo_exec_with_missing_openvdb(GeoNodeExecParams &params)
{
params.set_default_remaining_outputs();
params.error_message_add(NodeWarningType::Error,
TIP_("Disabled, Blender was compiled without OpenVDB"));
}
} // namespace blender::nodes
bool geo_node_poll_default(const bNodeType * /*ntype*/,

View File

@@ -157,4 +157,6 @@ const EnumPropertyItem *domain_without_corner_experimental_grease_pencil_version
} // namespace enums
void node_geo_exec_with_missing_openvdb(GeoNodeExecParams &params);
} // namespace blender::nodes

View File

@@ -260,9 +260,7 @@ static void node_geo_exec(GeoNodeExecParams params)
params.set_output("Points", std::move(geometry_set));
#else
params.set_default_remaining_outputs();
params.error_message_add(NodeWarningType::Error,
TIP_("Disabled, Blender was compiled without OpenVDB"));
node_geo_exec_with_missing_openvdb(params);
#endif
}

View File

@@ -140,9 +140,7 @@ static void node_geo_exec(GeoNodeExecParams params)
});
params.set_output("Volume", std::move(geometry_set));
#else
params.set_default_remaining_outputs();
params.error_message_add(NodeWarningType::Error,
TIP_("Disabled, Blender was compiled without OpenVDB"));
node_geo_exec_with_missing_openvdb(params);
return;
#endif
}

View File

@@ -209,9 +209,7 @@ static void node_geo_exec(GeoNodeExecParams params)
});
params.set_output("Volume", std::move(geometry_set));
#else
params.set_default_remaining_outputs();
params.error_message_add(NodeWarningType::Error,
TIP_("Disabled, Blender was compiled without OpenVDB"));
node_geo_exec_with_missing_openvdb(params);
#endif
}

View File

@@ -177,9 +177,7 @@ static void node_geo_exec(GeoNodeExecParams params)
r_geometry_set.replace_volume(volume);
params.set_output("Volume", r_geometry_set);
#else
params.set_default_remaining_outputs();
params.error_message_add(NodeWarningType::Error,
TIP_("Disabled, Blender was compiled without OpenVDB"));
node_geo_exec_with_missing_openvdb(params);
#endif
}

View File

@@ -214,9 +214,7 @@ static void node_geo_exec(GeoNodeExecParams params)
});
params.set_output("Mesh", std::move(geometry_set));
#else
params.set_default_remaining_outputs();
params.error_message_add(NodeWarningType::Error,
TIP_("Disabled, Blender was compiled without OpenVDB"));
node_geo_exec_with_missing_openvdb(params);
#endif
}