22 b.use_custom_socket_order();
23 b.allow_any_socket_order();
24 b.add_default_layout();
25 const bNode *node =
b.node_or_null();
30 b.add_input(data_type,
"Grid").hide_value().structure_type(StructureType::Grid);
31 b.add_output(data_type,
"Grid").structure_type(StructureType::Grid).align_with_previous();
41 switch (socket.
type) {
64 bNode &node =
params.add_node(
"GeometryNodeGridVoxelize");
66 params.update_and_connect_available_socket(node,
"Grid");
73 bke::GVolumeGrid grid =
params.extract_input<bke::GVolumeGrid>(
"Grid");
75 params.set_default_remaining_outputs();
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", 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 node_register_type(bNodeType &ntype)
static void node_gather_link_search_ops(GatherLinkSearchOpParams ¶ms)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_init(bNodeTree *, bNode *node)
static void node_register()
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)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const EnumPropertyItem rna_enum_node_socket_data_type_items[]
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)