51 const ID &object_data = *
static_cast<const ID *
>(
object->data);
88 params.add_uninitialized_single_output({type, validated_buffer, 1});
92 type.copy_assign(validated_buffer, buffer);
108 *op->
ptr, active_type, buffer);
123 const CPPType &dst_type = attribute.span.type();
124 if (&type != &dst_type && !conversions.
is_convertible(type, dst_type)) {
132 const GPointer dst_value(type, dst_buffer);
136 if (selection.is_empty()) {
165 const CPPType &type = attribute.varray.type();
177 using T =
decltype(dummy);
178 const VArray<T> values_typed = attribute.varray.typed<T>();
180 selection.foreach_index([&](
const int i) { mixer.mix_in(0, values_typed[i]); });
196 Curves &curves_id = *
static_cast<Curves *
>(
object->data);
202 const char *name = active_attribute->
name;
210 ot->
name =
"Set Attribute";
211 ot->
description =
"Set values of the active attribute for selected elements";
212 ot->
idname =
"CURVES_OT_attribute_set";
struct CustomDataLayer * BKE_attributes_active_get(AttributeOwner &owner)
Object * CTX_data_active_object(const bContext *C)
#define BLI_assert_unreachable()
#define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name)
#define BLI_SCOPED_DEFER(function_to_defer)
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
static AttributeOwner from_id(ID *id)
void fill_assign_indices(const void *value, void *dst, const IndexMask &mask) const
static const CPPType & get()
void destruct(void *ptr) const
constexpr const char * c_str() 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
virtual void call(const IndexMask &mask, Params params, Context context) const =0
void convert_to_static_type(const CPPType &cpp_type, const Func &func)
typename DefaultMixerStruct< T >::type DefaultMixer
const DataTypeConversions & get_implicit_type_conversions()
eCustomDataType cpp_type_to_custom_data_type(const CPPType &type)
const CPPType * custom_data_type_to_cpp_type(eCustomDataType type)
static IndexMask retrieve_selected_elements(const Curves &curves_id, const bke::AttrDomain domain, IndexMaskMemory &memory)
static int set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event)
IndexMask retrieve_selected_curves(const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
VectorSet< Curves * > get_unique_editable_curves(const bContext &C)
static void validate_value(const bke::AttributeAccessor attributes, const StringRef name, const CPPType &type, void *buffer)
bool editable_curves_in_edit_mode_poll(bContext *C)
static int set_attribute_exec(bContext *C, wmOperator *op)
static bool active_attribute_poll(bContext *C)
static void set_attribute_ui(bContext *C, wmOperator *op)
void CURVES_OT_attribute_set(wmOperatorType *ot)
IndexMask retrieve_selected_points(const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
GPointer rna_property_for_attribute_type_retrieve_value(PointerRNA &ptr, const eCustomDataType type, void *buffer)
StringRefNull rna_property_name_for_type(const eCustomDataType 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)
PropertyRNA * rna_property_for_type(PointerRNA &ptr, const eCustomDataType type)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
const fn::multi_function::MultiFunction * function
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(* ui)(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)