49 const ID *
data = (ob) ?
static_cast<ID *
>(ob->
data) :
nullptr;
89 ID *
id =
static_cast<ID *
>(ob->
data);
97 if (layer ==
nullptr) {
141 ot->
name =
"Add Attribute";
143 ot->
idname =
"GEOMETRY_OT_attribute_add";
164 "Type of element that attribute is stored on");
173 "Type of data stored in attribute");
180 ID *
id =
static_cast<ID *
>(ob->
data);
190 if (*active_index > 0) {
203 ot->
name =
"Remove Attribute";
205 ot->
idname =
"GEOMETRY_OT_attribute_remove";
218 ID *
id =
static_cast<ID *
>(ob->
data);
229 if (layer ==
nullptr) {
277 ID *ob_data =
static_cast<ID *
>(ob->
data);
279 const std::string name = layer->
name;
335 const float weight = src_weights[i];
345 if (*active_index > 0) {
361 uiItemR(layout, op->
ptr,
"name", 0,
nullptr, ICON_NONE);
364 uiItemR(layout, op->
ptr,
"color", 0,
nullptr, ICON_NONE);
370 ot->
name =
"Add Color Attribute";
372 ot->
idname =
"GEOMETRY_OT_color_attribute_add";
387 ot->
srna,
"name",
"Color",
MAX_NAME,
"Name",
"Name of new color attribute");
395 "Type of element that attribute is stored on");
402 "Type of data stored in attribute");
404 static float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
407 ot->
srna,
"color", 4,
nullptr, 0.0f, FLT_MAX,
"Color",
"Default fill color", 0.0f, 1.0f);
415 ID *
id =
static_cast<ID *
>(ob->
data);
440 ot->
name =
"Set Render Color";
441 ot->
description =
"Set default color attribute used for rendering";
442 ot->
idname =
"GEOMETRY_OT_color_attribute_render_set";
461 ID *
id =
static_cast<ID *
>(ob->
data);
464 if (layer ==
nullptr) {
504 ot->
name =
"Remove Color Attribute";
506 ot->
idname =
"GEOMETRY_OT_color_attribute_remove";
519 ID *
id =
static_cast<ID *
>(ob->
data);
522 if (layer ==
nullptr) {
527 if (new_layer ==
nullptr) {
562 ot->
name =
"Duplicate Color Attribute";
564 ot->
idname =
"GEOMETRY_OT_color_attribute_duplicate";
580 uiItemR(layout, op->
ptr,
"mode", 0,
nullptr, ICON_NONE);
586 uiItemR(layout, op->
ptr,
"domain", 0,
nullptr, ICON_NONE);
587 uiItemR(layout, op->
ptr,
"data_type", 0,
nullptr, ICON_NONE);
600 ot->
name =
"Convert Attribute";
602 ot->
idname =
"GEOMETRY_OT_attribute_convert";
615 {0,
nullptr, 0,
nullptr,
nullptr},
628 "Which geometry element to move the attribute to");
641 const char *layer_name,
648 const std::string name = layer->
name;
666 if (*active_index > 0) {
Generic geometry attributes built on CustomData.
void BKE_id_attributes_active_color_set(struct ID *id, struct CustomDataLayer *active_layer)
bool BKE_id_attribute_remove(struct ID *id, const char *name, struct ReportList *reports)
struct CustomDataLayer * BKE_id_attributes_active_get(struct ID *id)
bool BKE_id_attributes_supported(const struct ID *id)
struct CustomDataLayer * BKE_id_attribute_find(const struct ID *id, const char *name, int type, eAttrDomain domain)
int * BKE_id_attributes_active_index_p(struct ID *id)
void BKE_id_attributes_render_color_set(struct ID *id, struct CustomDataLayer *active_layer)
struct CustomDataLayer * BKE_id_attributes_active_color_get(const struct ID *id)
struct CustomDataLayer * BKE_id_attribute_new(struct ID *id, const char *name, int type, eAttrDomain domain, struct ReportList *reports)
void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer)
int BKE_id_attribute_to_index(const struct ID *id, const CustomDataLayer *layer, eAttrDomainMask domain_mask, eCustomDataMask layer_mask)
struct CustomDataLayer * BKE_id_attributes_render_color_get(const struct ID *id)
CustomDataLayer * BKE_id_attribute_from_index(struct ID *id, int lookup_index, eAttrDomainMask domain_mask, eCustomDataMask layer_mask)
struct CustomDataLayer * BKE_id_attribute_duplicate(struct ID *id, const char *name, struct ReportList *reports)
#define ATTR_DOMAIN_MASK_COLOR
struct Object * CTX_data_edit_object(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
void * CustomData_add_layer_named(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, bool do_ensure_tess_cd)
bool BKE_object_attributes_active_color_fill(struct Object *ob, const float fill_color[4], bool only_selected)
void BKE_report(ReportList *reports, eReportType type, const char *message)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void copy_v2_v2(float r[2], const float a[2])
void DEG_id_tag_update(struct ID *id, int flag)
#define CD_MASK_COLOR_ALL
struct Object * ED_object_context(const struct bContext *C)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
const EnumPropertyItem * rna_enum_attribute_domain_itemf(struct ID *id, bool include_instances, bool *r_free)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
const CPPType & type() const
void materialize_to_uninitialized(void *dst) const
void materialize(MutableSpan< T > r_span) const
GVArray lookup_or_default(const AttributeIDRef &attribute_id, const eAttrDomain domain, const eCustomDataType data_type, const void *default_value=nullptr) const
bool add(const AttributeIDRef &attribute_id, const eAttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer)
bool remove(const AttributeIDRef &attribute_id)
bool ED_geometry_attribute_convert(Mesh *mesh, const char *layer_name, eCustomDataType old_type, eAttrDomain old_domain, eCustomDataType new_type, eAttrDomain new_domain)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
MutableAttributeAccessor mesh_attributes_for_write(Mesh &mesh)
static bool geometry_attributes_poll(bContext *C)
void GEOMETRY_OT_attribute_add(wmOperatorType *ot)
static int geometry_attribute_convert_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
void GEOMETRY_OT_color_attribute_add(wmOperatorType *ot)
void GEOMETRY_OT_attribute_convert(wmOperatorType *ot)
void GEOMETRY_OT_color_attribute_duplicate(wmOperatorType *ot)
static void geometry_color_attribute_add_ui(bContext *UNUSED(C), wmOperator *op)
static const EnumPropertyItem * geometry_attribute_domain_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
static bool geometry_attributes_remove_poll(bContext *C)
static void geometry_attribute_convert_ui(bContext *UNUSED(C), wmOperator *op)
void GEOMETRY_OT_attribute_remove(wmOperatorType *ot)
void GEOMETRY_OT_color_attribute_render_set(wmOperatorType *ot)
static int geometry_color_attribute_add_exec(bContext *C, wmOperator *op)
static bool geometry_color_attributes_remove_poll(bContext *C)
static bool geometry_attribute_convert_poll(bContext *C)
static int geometry_color_attribute_duplicate_exec(bContext *C, wmOperator *op)
static int geometry_color_attribute_set_render_exec(bContext *C, wmOperator *op)
static int geometry_attribute_convert_exec(bContext *C, wmOperator *op)
static int geometry_color_attribute_remove_exec(bContext *C, wmOperator *op)
static bool geometry_color_attributes_duplicate_poll(bContext *C)
static void next_color_attributes(ID *id, CustomDataLayer *layer)
void GEOMETRY_OT_color_attribute_remove(wmOperatorType *ot)
static void next_color_attribute(ID *id, CustomDataLayer *layer, bool is_render)
static const EnumPropertyItem mode_items[]
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_color_attribute_domain_items[]
const EnumPropertyItem rna_enum_attribute_domain_items[]
const EnumPropertyItem rna_enum_attribute_type_items[]
const EnumPropertyItem rna_enum_color_attribute_type_items[]
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
const EnumPropertyItem DummyRNA_NULL_items[]
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* ui)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int type, void *reference)
int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)