17 "For curves, point clouds, and Grease Pencil, take the radius attribute into account "
18 "when computing the bounds.");
30 :
bke::InstancesFieldInput(
CPPType::get<
float3>(), return_max ?
"Max" :
"Min"),
31 use_radius_(use_radius),
32 return_max_(return_max)
48 if (handle < reference_in_mask.
size()) {
49 reference_in_mask[handle] =
true;
60 switch (reference.
type()) {
73 std::optional<Bounds<float3>> sub_bounds =
77 reference_bounds[reference_index] = return_max_ ? sub_bounds->max : sub_bounds->min;
80 reference_bounds[reference_index] =
float3(0.0f);
85 mask.foreach_index(
GrainSize(4096), [&](
const int instance_index) {
86 output_bounds[instance_index] = reference_bounds[
handles[instance_index]];
100 return use_radius_ == other_field->use_radius_ && return_max_ == other_field->return_max_;
108 const bool use_radius =
params.extract_input<
bool>(
"Use Radius");
110 Field<float3>(std::make_shared<InstanceBoundsField>(use_radius,
false)));
111 params.set_output(
"Max",
Field<float3>(std::make_shared<InstanceBoundsField>(use_radius,
true)));
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)
unsigned long long int uint64_t
Span< T > as_span() const
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
constexpr int64_t size() const
static VArray from_container(ContainerT container)
GeometrySet & geometry_set()
void foreach_index(Fn &&fn) const
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void node_register_type(bNodeType &ntype)
GeometrySet object_get_evaluated_geometry_set(const Object &object, bool apply_subdiv=true)
uint64_t get_default_hash(const T &v, const Args &...args)
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string 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