12 b.add_input<
decl::Bool>(
N_(
"Selection")).default_value(
true).hide_value().supports_field();
14 b.add_input<
decl::Bool>(
N_(
"Local Space")).default_value(
true).supports_field();
28 const IndexMask selection = evaluator.get_evaluated_selection_as_mask();
30 const VArray<bool> local_spaces = evaluator.get_evaluated<
bool>(1);
35 for (const int i_selection : range) {
36 const int i = selection[i_selection];
37 if (local_spaces[i]) {
38 instance_transforms[i] *= float4x4::from_location(translations[i]);
41 add_v3_v3(instance_transforms[i].values[3], translations[i]);
54 params.set_output(
"Instances", std::move(geometry_set));
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_TRANSLATE_INSTANCES
void nodeRegisterType(struct bNodeType *ntype)
blender::MutableSpan< blender::float4x4 > instance_transforms()
int instances_num() const
IndexRange index_range() const
static void node_geo_exec(GeoNodeExecParams params)
static void translate_instances(GeoNodeExecParams ¶ms, InstancesComponent &instances_component)
static void node_declare(NodeDeclarationBuilder &b)
void parallel_for(IndexRange range, int64_t grain_size, const Function &function)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_translate_instances()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
bool has_instances() const
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare