27 const bNode *node =
b.node_or_null();
37 if (!
U.experimental.use_new_volume_nodes) {
42 bNode &node =
params.add_node(
"GeometryNodeStoreNamedGrid");
43 params.update_and_connect_available_socket(node,
"Volume");
49 bNode &node =
params.add_node(
"GeometryNodeStoreNamedGrid");
50 params.update_and_connect_available_socket(node,
"Name");
58 bNode &node =
params.add_node(
"GeometryNodeStoreNamedGrid");
59 node.custom1 = *data_type;
60 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");
90 if (
const bke::VolumeGridData *existing_grid =
BKE_volume_grid_find(&volume, grid_name.data())) {
93 grid.get_for_write().set_name(grid_name);
100 GeometrySet geometry_set =
params.extract_input<GeometrySet>(
"Volume");
101 Volume *volume = geometry_set.get_volume_for_write();
104 geometry_set.replace_volume(volume);
107 try_store_grid(
params, *volume);
109 params.set_output(
"Volume", geometry_set);
void * BKE_id_new_nomain(short type, const char *name)
#define NODE_CLASS_GEOMETRY
void BKE_volume_grid_add(Volume *volume, const blender::bke::VolumeGridData &grid)
void BKE_volume_grid_remove(Volume *volume, const blender::bke::VolumeGridData *grid)
const blender::bke::VolumeGridData * BKE_volume_grid_find(const Volume *volume, const char *name)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
std::optional< eCustomDataType > socket_type_to_custom_data_type(eNodeSocketDatatype 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)
bool custom_data_type_supports_grids(const eCustomDataType data_type)
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_custom_data_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, int type, const char *name, short nclass)
const EnumPropertyItem rna_enum_attribute_type_items[]
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