33 b.use_custom_socket_order();
34 b.allow_any_socket_order();
35 b.add_default_layout();
37 .description(
"The new transform is valid and was successfully applied to the grid.");
38 b.add_input(data_type,
"Grid"_ustr)
40 .structure_type(StructureType::Grid)
41 .is_default_link_socket();
42 b.add_output(data_type,
"Grid"_ustr).structure_type(StructureType::Grid).align_with_previous();
44 .description(
"The new transform from grid index space to object space.");
56 switch (socket.
type) {
75 const bool is_grid = structure_type == StructureType::Grid;
76 const bool is_dynamic = structure_type == StructureType::Dynamic;
80 if (is_grid || is_dynamic) {
85 node.custom1 = *data_type;
102 node.custom1 = *data_type;
118 bke::GVolumeGrid grid = params.
extract_input<bke::GVolumeGrid>(
"Grid"_ustr);
127 bke::VolumeGridData &grid_data = grid.get_for_write();
131 catch (
const openvdb::ArithmeticError & ) {
133 TIP_(
"Failed to set the new grid transform."));
137 params.
set_output(
"Grid"_ustr, std::move(grid));
153 "Node socket data type",
165 ntype.
ui_name =
"Set Grid Transform";
166 ntype.
ui_description =
"Set the transform for the grid from index space into object space.";
#define NODE_CLASS_GEOMETRY
#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
void error_message_add(const NodeWarningType type, StringRef message) const
T extract_input(const UString identifier)
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 set_transform_matrix(VolumeGridData &grid, const float4x4 &matrix)
void node_register_type(bNodeType &ntype)
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)
MatBase< float, 4, 4 > float4x4
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)