10# include "openvdb/tools/LevelSetFilter.h"
17 b.use_custom_socket_order();
18 b.allow_any_socket_order();
20 b.add_output<
decl::Float>(
"Grid").structure_type(StructureType::Grid).align_with_previous();
24 .description(
"Object-space distance to offset the SDF surface");
32 params.set_default_remaining_outputs();
38 bke::VolumeTreeAccessToken tree_token;
39 openvdb::FloatGrid &vdb_grid = grid.grid_for_write(tree_token);
42 openvdb::tools::LevelSetFilter<openvdb::FloatGrid>
filter(vdb_grid);
45 catch (
const openvdb::RuntimeError & ) {
50 params.set_output(
"Grid", std::move(grid));
60 ntype.
ui_name =
"SDF Grid Offset";
62 "Offset a signed distance field surface by a world-space distance. Dilates (positive) or "
63 "erodes (negative) while maintaining the signed distance property";
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
StructureType structure_type
float distance(VecOp< float, D >, VecOp< float, D >) RET
void node_register_type(bNodeType &ntype)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
void node_geo_sdf_grid_error_not_levelset(GeoNodeExecParams ¶ms)
void node_geo_exec_with_missing_openvdb(GeoNodeExecParams ¶ms)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare