32 {
SOCK_INT,
N_(
"Seed"), 0, 0, 0, 0, -10000, 10000},
45 uiItemR(layout,
ptr,
"use_whole_collection", 0,
nullptr, ICON_NONE);
59 const bool use_whole_collection = (node_storage->
flag &
69 MutableSpan<std::optional<InstancedData>> r_instances_data)
73 Object *
object =
params.handle_map().lookup(object_handle);
74 if (
object ==
params.self_object()) {
77 if (
object !=
nullptr) {
81 r_instances_data.fill(instance);
88 MutableSpan<std::optional<InstancedData>> r_instances_data)
96 if (collection ==
nullptr) {
106 const bool use_whole_collection = (node_storage->
flag &
108 if (use_whole_collection) {
112 r_instances_data.fill(instance);
122 possible_instances.
append(instance);
126 Collection *child_collection = child->collection;
130 possible_instances.
append(instance);
133 if (!possible_instances.
is_empty()) {
134 const int seed =
params.get_input<
int>(
"Seed");
136 for (
const int i : r_instances_data.index_range()) {
138 r_instances_data[i] = possible_instances[index];
164 return instances_data;
175 params, src_geometry, domain_size);
178 "position", domain, {0, 0, 0});
180 "rotation", domain, {0, 0, 0});
182 "scale", domain, {1, 1, 1});
186 if (instances_data[i].has_value()) {
188 instances.
add_instance(*instances_data[i], matrix, ids[i]);
212 params.set_output(
"Geometry", std::move(geometry_set_out));
@ INSTANCE_DATA_TYPE_OBJECT
@ INSTANCE_DATA_TYPE_COLLECTION
void nodeSetSocketAvailability(struct bNodeSocket *sock, bool is_available)
#define GEO_NODE_POINT_INSTANCE
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_CLASS_GEOMETRY
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
void nodeRegisterType(struct bNodeType *ntype)
BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static uint8 component(Color32 c, uint i)
Object groups, one object can be in many groups at once.
@ GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION
GeometryNodePointInstanceType
@ GEO_NODE_POINT_INSTANCE_TYPE_OBJECT
@ GEO_NODE_POINT_INSTANCE_TYPE_COLLECTION
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
static unsigned long seed
virtual int attribute_domain_size(const AttributeDomain domain) const
blender::bke::ReadAttributePtr attribute_get_for_read(const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type, const void *default_value) const
void add_instance(Object *object, blender::float4x4 transform, const int id=-1)
void append(const T &value)
void *(* MEM_callocN)(size_t len, const char *str)
TypedReadAttribute< float3 > Float3ReadAttribute
TypedReadAttribute< int > Int32ReadAttribute
GeometrySet geometry_set_realize_instances(const GeometrySet &geometry_set)
static void get_instanced_data__collection(const GeoNodeExecParams ¶ms, const GeometryComponent &component, MutableSpan< std::optional< InstancedData >> r_instances_data)
static void geo_node_point_instance_update(bNodeTree *UNUSED(tree), bNode *node)
static void geo_node_point_instance_exec(GeoNodeExecParams params)
static void get_instanced_data__object(const GeoNodeExecParams ¶ms, MutableSpan< std::optional< InstancedData >> r_instances_data)
static void add_instances_from_geometry_component(InstancesComponent &instances, const GeometryComponent &src_geometry, const GeoNodeExecParams ¶ms)
static void geo_node_point_instance_init(bNodeTree *UNUSED(tree), bNode *node)
static Array< std::optional< InstancedData > > get_instanced_data(const GeoNodeExecParams ¶ms, const GeometryComponent &component, const int amount)
Array< uint32_t > get_geometry_element_ids_as_uints(const GeometryComponent &component, const AttributeDomain domain)
static bNodeSocketTemplate geo_node_point_instance_out[]
static void geo_node_point_instance_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
void register_node_type_geo_point_instance()
static bNodeSocketTemplate geo_node_point_instance_in[]
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
int RNA_enum_get(PointerRNA *ptr, const char *name)
bool has(const GeometryComponentType component_type) const
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
union InstancedData::@19 data
struct Collection * collection
Compact definition of a node socket.
struct bNodeSocket * next
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
static float4x4 from_loc_eul_scale(const float3 location, const float3 rotation, const float3 scale)