22 b.use_custom_socket_order();
23 b.allow_any_socket_order();
24 b.add_default_layout();
30 b.add_input(data_type,
"Grid"_ustr).hide_value().structure_type(StructureType::Grid);
31 b.add_output(data_type,
"Grid"_ustr).structure_type(StructureType::Grid).align_with_previous();
41 switch (socket.
type) {
64 bNode &
node = params.add_node(
"GeometryNodeGridVoxelize"_ustr);
65 node.custom1 = *data_type;
66 params.update_and_connect_available_socket(
node,
"Grid"_ustr);
73 bke::GVolumeGrid grid = params.
extract_input<bke::GVolumeGrid>(
"Grid"_ustr);
78 bke::VolumeTreeAccessToken tree_token;
79 openvdb::GridBase &vdb_grid = grid.get_for_write().grid_for_write(tree_token);
80 bke::volume_grid::to_typed_grid(vdb_grid,
81 [&](
auto &grid) { grid.tree().voxelizeActiveTiles(); });
82 params.
set_output(
"Grid"_ustr, std::move(grid));
98 "Node socket data type",
109 ntype.
ui_name =
"Voxelize Grid";
111 "Remove sparseness from a volume grid by making the active tiles into voxels";
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeSocket & other_socket() const
T extract_input(const UString identifier)
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
static void node_gather_link_search_ops(GatherLinkSearchOpParams ¶ms)
static void node_init(bNodeTree *, bNode *node)
static void node_register()
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_geo_exec(GeoNodeExecParams params)
static void node_rna(StructRNA *srna)
static std::optional< eNodeSocketDatatype > node_type_for_socket_type(const bNodeSocket &socket)
static void node_declare(NodeDeclarationBuilder &b)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
const EnumPropertyItem * grid_socket_type_items_filter_fn(bContext *, PointerRNA *, PropertyRNA *, bool *r_free)
void node_geo_exec_with_missing_openvdb(GeoNodeExecParams ¶ms)
const EnumPropertyItem rna_enum_node_socket_data_type_items[]
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)