18 b.use_custom_socket_order();
19 b.allow_any_socket_order();
23 b.add_output<
decl::Geometry>(
"Instances").propagate_all().align_with_previous();
27 b.add_input<
decl::Bool>(
"Local Space").default_value(
true).field_on_all();
49 float4x4 &instance_transform = transforms[
i];
51 if (local_spaces[
i]) {
57 const float4x4 original_transform = instance_transform;
61 instance_transform *= original_transform;
72 params.set_output(
"Instances", std::move(geometry_set));
80 ntype.
ui_name =
"Scale Instances";
81 ntype.
ui_description =
"Scale geometry instances in local or global space";
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_SCALE_INSTANCES
void rescale_m4(float mat[4][4], const float scale[3])
#define NOD_REGISTER_NODE(REGISTER_FUNC)
int instances_num() const
MutableSpan< float4x4 > transforms_for_write()
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
void foreach_index(Fn &&fn) const
void node_register_type(bNodeType &ntype)
MatT from_location(const typename MatT::loc_type &location)
static void scale_instances(GeoNodeExecParams ¶ms, bke::Instances &instances)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
MatBase< float, 4, 4 > float4x4
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const c_style_mat & ptr() const
Instances * get_instances_for_write()
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare