22 b.use_custom_socket_order();
23 b.allow_any_socket_order();
25 .description(
"Geometry whose instances are (partially) realized");
26 b.add_output<
decl::Geometry>(
"Geometry"_ustr).propagate_all_geometry().align_with_previous();
30 .evaluated_geometry_field()
31 .description(
"Which top-level instances to realize");
34 .evaluated_geometry_field()
36 "Realize all levels of nested instances for a top-level instances. Overrides the value "
37 "of the Depth input");
41 .evaluated_geometry_field()
42 .
description(
"Number of levels of nested instances to realize for each top-level instance");
45 .
description(
"Preserve the apparent face orientation of mirrored mesh instances");
50 layout.
prop(ptr,
"realize_to_point_domain",
UI_ITEM_NONE, std::nullopt, ICON_NONE);
57 params.
set_output(
"Geometry"_ustr, std::move(geometry_set));
68 static auto depth_override = mf::build::SI2_SO<int, bool, int>(
69 "depth_override", [](
int depth,
bool realize_all_field) {
74 depth_override, {std::move(depth_field), std::move(realize_all_field)}));
78 static auto selection_override = mf::build::SI2_SO<int, bool, bool>(
80 [](
int depth_override,
bool selection) {
return depth_override == 0 ?
false : selection; });
83 selection_override, {depth_field_overridden, std::move(selection_field)}));
89 const int evaluated_depth_index = evaluator.
add(depth_field_overridden);
98 options.keep_original_ids =
false;
99 options.realize_instance_attributes =
true;
100 options.realize_to_point_domain = realize_to_point_domain;
103 options.attribute_filter = attribute_filter;
105 geometry_set,
options, varied_depth_option);
116 "realize_to_point_domain",
117 "Realize to Point Domain",
118 "Propagate instance attributes to the point domain rather than the curve "
119 "domain. This property exists for compatibility with 5.0 and earlier.",
128 ntype.
ui_name =
"Realize Instances";
129 ntype.
ui_description =
"Convert instances into real geometry data";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_REALIZE_INSTANCES
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_boolean_accessors(member, flag)
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 FieldOperationPtr from(std::shared_ptr< const mf::MultiFunction > fn, Vector< GField > inputs)
void error_message_add(const NodeWarningType type, StringRef message) const
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
T extract_input(const UString identifier)
const bNode & node() const
void set_output(const UString identifier, T &&value)
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
CCL_NAMESPACE_BEGIN struct Options options
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_layout_ex(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_register()
static void node_rna(StructRNA *srna)
static void node_declare(NodeDeclarationBuilder &b)
PropertyRNA * RNA_def_node_boolean(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const BooleanRNAAccessors accessors, std::optional< bool > default_value, bool allow_animation)
@ GEO_NODE_REALIZE_TO_POINT_DOMAIN
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
StringRefNull name() const
void set_name(std::string name)
const Instances * get_instances() const
bool has_instances() const
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) draw_buttons_ex(ui::Layout &, bContext *C, PointerRNA *ptr)
const char * enum_name_legacy
NodeDeclareFunction declare
bke::GeometrySet geometry
Vector< std::string > errors
static constexpr int MAX_DEPTH
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)