25 const bNode *node =
b.node_or_null();
32 b.use_custom_socket_order();
33 b.allow_any_socket_order();
34 b.add_default_layout();
36 .description(
"The new transform is valid and was successfully applied to the grid.");
37 b.add_input(data_type,
"Grid")
39 .structure_type(StructureType::Grid)
40 .is_default_link_socket();
41 b.add_output(data_type,
"Grid").structure_type(StructureType::Grid).align_with_previous();
43 .description(
"The new transform from grid index space to object space.");
55 switch (socket.
type) {
73 const StructureType structure_type = other_socket.
runtime->inferred_structure_type;
74 const bool is_grid = structure_type == StructureType::Grid;
75 const bool is_dynamic = structure_type == StructureType::Dynamic;
79 if (is_grid || is_dynamic) {
83 bNode &node =
params.add_node(
"GeometryNodeSetGridTransform");
85 params.update_and_connect_available_socket(node,
"Grid");
89 if (!is_grid &&
params.node_tree().typeinfo->validate_link(other_type,
SOCK_MATRIX)) {
91 bNode &node =
params.add_node(
"GeometryNodeSetGridTransform");
92 params.update_and_connect_available_socket(node,
"Transform");
100 bNode &node =
params.add_node(
"GeometryNodeSetGridTransform");
102 params.update_and_connect_available_socket(node,
"Grid");
107 bNode &node =
params.add_node(
"GeometryNodeSetGridTransform");
108 params.update_and_connect_available_socket(node,
"Is Valid");
117 bke::GVolumeGrid grid =
params.extract_input<bke::GVolumeGrid>(
"Grid");
119 params.set_default_remaining_outputs();
126 bke::VolumeGridData &grid_data = grid.get_for_write();
128 params.set_output(
"Is Valid",
true);
130 catch (
const openvdb::ArithmeticError & ) {
132 TIP_(
"Failed to set the new grid transform."));
133 params.set_output(
"Is Valid",
false);
136 params.set_output(
"Grid", std::move(grid));
152 "Node socket data type",
164 ntype.
ui_name =
"Set Grid Transform";
165 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)
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
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
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[]
bNodeSocketRuntimeHandle * runtime
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 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)