51 const ID &object_data = *
static_cast<const ID *
>(
object->data);
71 mf::ParamsBuilder params(*validator.
function, &single_mask);
72 params.add_readonly_single_input(
GPointer(type, buffer));
73 params.add_uninitialized_single_output({type, validated_buffer, 1});
74 mf::ContextBuilder context;
83 PointCloud &active_pointcloud = *id_cast<PointCloud *>(active_object->
data);
94 *op->
ptr, active_type, buffer);
100 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(name);
114 if (&type != &dst_type && !conversions.
is_convertible(type, dst_type)) {
122 const GPointer dst_value(dst_type, dst_buffer);
145 PointCloud &active_pointcloud = *id_cast<PointCloud *>(active_object->
data);
167 if constexpr (!std::is_void_v<bke::attribute_math::DefaultMixer<T>>) {
170 selection.
foreach_index([&](
const int i) { mixer.mix_in(0, values_typed[i]); });
198 ot->
name =
"Set Attribute";
199 ot->
description =
"Set values of the active attribute for selected elements";
200 ot->
idname =
"POINTCLOUD_OT_attribute_set";
Generic geometry attributes built on CustomData.
General operations for point clouds.
#define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name)
#define BLI_SCOPED_DEFER(function_to_defer)
Object is a sort of wrapper for general info.
static AttributeOwner from_id(ID *id)
static const CPPType & get()
void fill_assign_indices(const void *value, void *dst, const IndexMask &mask) const
void destruct(void *ptr) const
void copy_assign(const void *src, void *dst) const
constexpr MutableSpan()=default
AttributeValidator lookup_validator(const StringRef name) const
std::optional< AttributeMetaData > lookup_meta_data(StringRef name) const
GAttributeReader lookup(const StringRef name) const
int domain_size(const AttrDomain domain) const
void convert_to_uninitialized(const CPPType &from_type, const CPPType &to_type, const void *from_value, void *to_value) const
bool is_convertible(const CPPType &from_type, const CPPType &to_type) const
bool assign_data(const StringRef name, const AttributeInit &initializer)
GSpanAttributeWriter lookup_for_write_span(StringRef name)
virtual void call(const IndexMask &mask, Params params, Context context) const =0
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
typename DefaultMixerStruct< T >::type DefaultMixer
void to_static_type(const CPPType &cpp_type, Fn &&fn)
const DataTypeConversions & get_implicit_type_conversions()
AttrType cpp_type_to_attribute_type(const CPPType &type)
const CPPType & attribute_type_to_cpp_type(AttrType type)
PropertyRNA * rna_property_for_type(PointerRNA &ptr, const bke::AttrType type)
GPointer rna_property_for_attribute_type_retrieve_value(PointerRNA &ptr, const bke::AttrType type, void *buffer)
StringRefNull rna_property_name_for_type(const bke::AttrType type)
void register_rna_properties_for_attribute_types(StructRNA &srna)
void rna_property_for_attribute_type_set_value(PointerRNA &ptr, PropertyRNA &prop, const GPointer value)
bool attribute_set_poll(bContext &C, const ID &object_data)
bool editable_pointcloud_in_edit_mode_poll(bContext *C)
static void validate_value(const bke::AttributeAccessor attributes, const StringRef name, const CPPType &type, void *buffer)
static bool active_attribute_poll(bContext *C)
static void set_attribute_ui(bContext *C, wmOperator *op)
static wmOperatorStatus set_attribute_exec(bContext *C, wmOperator *op)
static wmOperatorStatus set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event)
IndexMask retrieve_selected_points(const PointCloud &pointcloud, IndexMaskMemory &memory)
void POINTCLOUD_OT_attribute_set(wmOperatorType *ot)
VectorSet< PointCloud * > get_unique_editable_pointclouds(const bContext &C)
std::optional< StringRefNull > BKE_attributes_active_name_get(AttributeOwner &owner)
void DEG_id_tag_update(ID *id, unsigned int flags)
wmOperatorStatus WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
Object * CTX_data_active_object(const bContext *C)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
const fn::multi_function::MultiFunction * function
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & column(bool align)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) ui(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT