34 b.add_input(data_type,
"Grid"_ustr).hide_value().structure_type(StructureType::Grid);
37 .description(
"Transform from grid index space to object space");
38 b.add_output(data_type,
"Background Value"_ustr)
39 .description(
"Default value outside of grid voxels");
51 switch (socket.
type) {
70 const bool is_grid = structure_type == StructureType::Grid;
71 const bool is_dynamic = structure_type == StructureType::Dynamic;
75 if (is_grid || is_dynamic) {
80 node.custom1 = *data_type;
97 node.custom1 = *data_type;
109 const auto grid = params.
extract_input<bke::GVolumeGrid>(
"Grid"_ustr);
115 bke::VolumeTreeAccessToken tree_token;
116 const std::shared_ptr<const openvdb::GridBase> vdb_grid = grid->grid_ptr(tree_token);
117 params.
set_output(
"Transform"_ustr, BKE_volume_transform_to_blender(vdb_grid->transform()));
121 using type_traits =
typename bke::VolumeGridTraits<ValueT>;
122 using TreeType =
typename type_traits::TreeType;
124 if constexpr (!std::is_same_v<TreeType, void>) {
125 using GridType = openvdb::Grid<TreeType>;
126 const std::shared_ptr<const GridType> vdb_typed_grid = openvdb::GridBase::grid<GridType>(
129 type_traits::to_blender(vdb_typed_grid->background()));
147 "Node socket data type",
160 ntype.
ui_description =
"Retrieve information about a volume grid";
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
nodes::StructureType inferred_structure_type
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeTree & node_tree() const
const bNodeSocket & other_socket() const
eNodeSocketInOut in_out() const
T extract_input(const UString identifier)
const bNode & node() const
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
bNode & add_node(UString idname)
void to_static_type(const CPPType &cpp_type, Fn &&fn)
void node_register_type(bNodeType &ntype)
const CPPType * socket_type_to_geo_nodes_base_cpp_type(eNodeSocketDatatype type)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
static void node_rna(StructRNA *srna)
static std::optional< eNodeSocketDatatype > node_type_for_socket_type(const bNodeSocket &socket)
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_gather_link_search_ops(GatherLinkSearchOpParams ¶ms)
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)
bke::bNodeSocketRuntime * runtime
bke::bNodeTreeType * typeinfo
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
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 use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
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)