17 "For curves, point clouds, and Grease Pencil, take the radius attribute into account "
18 "when computing the bounds.");
19 b.add_output<
decl::Vector>(
"Min"_ustr).structure_type(StructureType::Field);
20 b.add_output<
decl::Vector>(
"Max"_ustr).structure_type(StructureType::Field);
31 use_radius_(use_radius),
32 return_max_(return_max)
39 const Span<int> handles = instances.reference_handles();
48 const int handle = handles[i];
49 if (handle < reference_in_mask.
size()) {
50 reference_in_mask[handle] =
true;
59 [&](
const int reference_index) {
63 switch (reference.
type()) {
76 std::optional<Bounds<float3>> sub_bounds =
80 reference_bounds[reference_index] = return_max_ ? sub_bounds->max : sub_bounds->min;
83 reference_bounds[reference_index] =
float3(0.0f);
100 static constexpr int8_t id = 0;
102 hash.add(use_radius_);
103 hash.add(return_max_);
109 const bool use_radius = params.
extract_input<
bool>(
"Use Radius"_ustr);
119 ntype.
ui_name =
"Instance Bounds";
120 ntype.
ui_description =
"Calculate position bounds of each instance's geometry set";
#define NOD_REGISTER_NODE(REGISTER_FUNC)
Span< T > as_span() const
static IndexMask from_bools(Span< bool > bools, LinearAllocator<> &memory)
constexpr int64_t size() const
static VArray from_container(ContainerT container)
GeometrySet & geometry_set()
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
static Field from_input(Args &&...args)
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
GeometrySet object_get_evaluated_geometry_set(const Object &object, bool apply_subdiv=true)
constexpr ParallelGrainSize grain_size(int grain_size)
VecBase< float, 3 > float3
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::optional< Bounds< float3 > > compute_boundbox_without_instances(bool use_radius=true, bool use_subdiv=false) const
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare