17 b.use_custom_socket_order();
18 b.allow_any_socket_order();
20 .description(
"Geometry whose instances are (partially) realized");
21 b.add_output<
decl::Geometry>(
"Geometry").propagate_all().align_with_previous();
26 .description(
"Which top-level instances to realize");
31 "Realize all levels of nested instances for a top-level instances. Overrides the value "
32 "of the Depth input");
34 "Number of levels of nested instances to realize for each top-level instance");
41 params.set_output(
"Geometry", std::move(geometry_set));
50 static auto depth_override = mf::build::SI2_SO<int, bool, int>(
51 "depth_override", [](
int depth,
bool realize_all_field) {
56 depth_override, {std::move(depth_field), std::move(realize_all_field)}));
60 static auto selection_override = mf::build::SI2_SO<int, bool, bool>(
62 [](
int depth_override,
bool selection) {
return depth_override == 0 ?
false : selection; });
65 selection_override, {depth_field_overridden, std::move(selection_field)}));
71 const int evaluated_depth_index = evaluator.
add(depth_field_overridden);
80 options.keep_original_ids =
false;
81 options.realize_instance_attributes =
true;
83 options.attribute_filter = attribute_filter;
85 geometry_set,
options, varied_depth_option);
98 ntype.
ui_name =
"Realize Instances";
99 ntype.
ui_description =
"Convert instances into real geometry data";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_REALIZE_INSTANCES
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_selection(Field< bool > selection)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_selection_as_mask() const
const GVArray & get_evaluated(const int field_index) const
static std::shared_ptr< FieldOperation > from(std::shared_ptr< const mf::MultiFunction > function, Vector< GField > inputs={})
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
CCL_NAMESPACE_BEGIN struct Options options
static void error(const char *str)
void node_register_type(bNodeType &ntype)
RealizeInstancesResult realize_instances(bke::GeometrySet geometry_set, const RealizeInstancesOptions &options)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const Instances * get_instances() const
bool has_instances() const
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
bke::GeometrySet geometry
Vector< std::string > errors
static constexpr int MAX_DEPTH