23 b.use_custom_socket_order();
24 b.allow_any_socket_order();
25 b.add_default_layout();
26 b.add_input<
decl::Geometry>(
"Volume").description(
"Volume geometry to add a grid to");
30 const bNode *node =
b.node_or_null();
37 .structure_type(StructureType::Grid);
44 bNode &node =
params.add_node(
"GeometryNodeStoreNamedGrid");
45 params.update_and_connect_available_socket(node,
"Volume");
51 bNode &node =
params.add_node(
"GeometryNodeStoreNamedGrid");
52 params.update_and_connect_available_socket(node,
"Name");
59 bNode &node =
params.add_node(
"GeometryNodeStoreNamedGrid");
61 params.update_and_connect_available_socket(node,
"Grid");
83 const std::string grid_name =
params.extract_input<std::string>(
"Name");
85 bke::GVolumeGrid grid =
params.extract_input<bke::GVolumeGrid>(
"Grid");
93 grid.get_for_write().set_name(grid_name);
100 GeometrySet geometry_set =
params.extract_input<GeometrySet>(
"Volume");
107 try_store_grid(
params, *volume);
109 params.set_output(
"Volume", geometry_set);
138 ntype.
ui_name =
"Store Named Grid";
139 ntype.
ui_description =
"Store grid data in a volume geometry with the specified name";
void * BKE_id_new_nomain(short type, const char *name)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_STORE_NAMED_GRID
void BKE_volume_grid_add(Volume *volume, const blender::bke::VolumeGridData &grid)
const blender::bke::VolumeGridData * BKE_volume_grid_find(const Volume *volume, blender::StringRef name)
void BKE_volume_grid_remove(Volume *volume, const blender::bke::VolumeGridData *grid)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
std::optional< VolumeGridType > socket_type_to_grid_type(eNodeSocketDatatype type)
void node_register_type(bNodeType &ntype)
std::optional< eNodeSocketDatatype > grid_type_to_socket_type(VolumeGridType type)
static void node_rna(StructRNA *srna)
static void node_register()
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void search_link_ops(GatherLinkSearchOpParams ¶ms)
static void node_init(bNodeTree *, bNode *node)
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_data_type_socket_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_volume_grid_data_type_items[]
void replace_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Volume * get_volume_for_write()
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void use_property_decorate_set(bool is_sep)
void use_property_split_set(bool value)
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)