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()) {
61 case blender::bke::InstanceReference::Type::GeometrySet:
62 instance_geometry = reference.geometry_set();
64 case blender::bke::InstanceReference::Type::Object:
65 instance_geometry = blender::bke::object_get_evaluated_geometry_set(reference.object());
67 case blender::bke::InstanceReference::Type::Collection:
69 case blender::bke::InstanceReference::Type::None:
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)
Span< T > as_span() const
constexpr int64_t size() const
static VArray ForContainer(ContainerT container)
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
void foreach_index(Fn &&fn) const
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void node_register_type(bNodeType &ntype)
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)
unsigned __int64 uint64_t
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