86namespace set_attribute {
93 const CPPType &type = *value.type();
114 const CPPType &type = *value.type();
160 *op->
ptr, active_type, buffer);
164 bool changed =
false;
165 for (
Object *
object : objects) {
166 Mesh *mesh =
static_cast<Mesh *
>(
object->data);
178 if (&type != &dst_type && !conversions.
is_convertible(type, dst_type)) {
184 const GPointer dst_value(dst_type, dst_buffer);
209 update.calc_normals =
false;
210 update.is_destructive =
false;
220 BMesh *
bm = mesh->runtime->edit_mesh->bm;
259 const char *name = active_attribute->
name;
271 ot->
name =
"Set Attribute";
272 ot->
description =
"Set values of the active attribute for selected elements";
273 ot->
idname =
"MESH_OT_attribute_set";
275 ot->
exec = mesh_set_attribute_exec;
276 ot->
invoke = mesh_set_attribute_invoke;
277 ot->
poll = mesh_active_attribute_poll;
278 ot->
ui = mesh_set_attribute_ui;
blender::bke::AttrDomain BKE_attribute_domain(const AttributeOwner &owner, const struct CustomDataLayer *layer)
struct CustomDataLayer * BKE_attributes_active_get(AttributeOwner &owner)
Scene * CTX_data_scene(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
#define BLI_assert_unreachable()
#define BUFFER_FOR_CPP_TYPE_VALUE(type, variable_name)
#define BLI_SCOPED_DEFER(function_to_defer)
#define POINTER_OFFSET(v, ofs)
Object is a sort of wrapper for general info.
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
Mesh * ED_mesh_context(bContext *C)
bool ED_operator_editmesh(bContext *C)
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)
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMIterType
BMesh Iterators.
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMElem * BM_mesh_active_elem_get(BMesh *bm)
static AttributeOwner from_id(ID *id)
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
void MESH_OT_attribute_set(wmOperatorType *ot)
const DataTypeConversions & get_implicit_type_conversions()
const CPPType * custom_data_type_to_cpp_type(eCustomDataType type)
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)
static int mesh_set_attribute_exec(bContext *C, wmOperator *op)
static void mesh_set_attribute_ui(bContext *C, wmOperator *op)
static int mesh_set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void bmesh_loop_layer_selected_values_set(BMEditMesh &em, const GPointer value, const int offset)
static void bmesh_vert_edge_face_layer_selected_values_set(BMesh &bm, const BMIterType iter_type, const GPointer value, const int offset)
static char domain_to_htype(const bke::AttrDomain domain)
static bool mesh_active_attribute_poll(bContext *C)
static void update(bNodeTree *ntree)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
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)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)