Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-01 07:38:06 +0300
committerCampbell Barton <campbell@blender.org>2022-06-01 08:38:48 +0300
commit44bac4c8ccf19cb5941435115b8f89a9d14e9c23 (patch)
tree2bd7698ca3e1e382b078e274566dbad0ae82214c /source/blender/editors
parentca346d2176737b6aa296617452a8a6cacb7a970a (diff)
Cleanup: use 'e' prefix for enum types
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/curves/intern/curves_ops.cc4
-rw-r--r--source/blender/editors/geometry/geometry_attributes.cc21
-rw-r--r--source/blender/editors/include/ED_geometry.h8
-rw-r--r--source/blender/editors/interface/interface_template_attribute_search.cc4
-rw-r--r--source/blender/editors/mesh/editmesh_undo.c4
-rw-r--r--source/blender/editors/object/object_data_transfer.c4
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_selection.cc14
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.cc40
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c4
-rw-r--r--source/blender/editors/space_node/node_draw.cc20
-rw-r--r--source/blender/editors/space_node/node_geometry_attribute_search.cc4
-rw-r--r--source/blender/editors/space_node/node_relationships.cc4
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc6
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh4
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc6
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_ops.cc2
17 files changed, 77 insertions, 80 deletions
diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc
index efa4f884e17..d35e58d5eba 100644
--- a/source/blender/editors/curves/intern/curves_ops.cc
+++ b/source/blender/editors/curves/intern/curves_ops.cc
@@ -705,14 +705,14 @@ namespace set_selection_domain {
static int curves_set_selection_domain_exec(bContext *C, wmOperator *op)
{
- const AttributeDomain domain = AttributeDomain(RNA_enum_get(op->ptr, "domain"));
+ const eAttrDomain domain = eAttrDomain(RNA_enum_get(op->ptr, "domain"));
for (Curves *curves_id : get_unique_editable_curves(*C)) {
if (curves_id->selection_domain == domain && (curves_id->flag & CV_SCULPT_SELECTION_ENABLED)) {
continue;
}
- const AttributeDomain old_domain = AttributeDomain(curves_id->selection_domain);
+ const eAttrDomain old_domain = eAttrDomain(curves_id->selection_domain);
curves_id->selection_domain = domain;
curves_id->flag |= CV_SCULPT_SELECTION_ENABLED;
diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc
index 814c2639169..c9677da1af5 100644
--- a/source/blender/editors/geometry/geometry_attributes.cc
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@ -90,8 +90,8 @@ static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
char name[MAX_NAME];
RNA_string_get(op->ptr, "name", name);
- CustomDataType type = (CustomDataType)RNA_enum_get(op->ptr, "data_type");
- AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
+ eCustomDataType type = (eCustomDataType)RNA_enum_get(op->ptr, "data_type");
+ eAttrDomain domain = (eAttrDomain)RNA_enum_get(op->ptr, "domain");
CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, op->reports);
if (layer == nullptr) {
@@ -219,8 +219,8 @@ static int geometry_color_attribute_add_exec(bContext *C, wmOperator *op)
char name[MAX_NAME];
RNA_string_get(op->ptr, "name", name);
- CustomDataType type = (CustomDataType)RNA_enum_get(op->ptr, "data_type");
- AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
+ eCustomDataType type = (eCustomDataType)RNA_enum_get(op->ptr, "data_type");
+ eAttrDomain domain = (eAttrDomain)RNA_enum_get(op->ptr, "domain");
CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, op->reports);
float color[4];
@@ -289,9 +289,8 @@ static int geometry_attribute_convert_exec(bContext *C, wmOperator *op)
* 4. Create a new attribute based on the previously copied data. */
switch (mode) {
case ConvertAttributeMode::Generic: {
- const AttributeDomain dst_domain = static_cast<AttributeDomain>(
- RNA_enum_get(op->ptr, "domain"));
- const CustomDataType dst_type = static_cast<CustomDataType>(
+ const eAttrDomain dst_domain = static_cast<eAttrDomain>(RNA_enum_get(op->ptr, "domain"));
+ const eCustomDataType dst_type = static_cast<eCustomDataType>(
RNA_enum_get(op->ptr, "data_type"));
if (ELEM(dst_type, CD_PROP_STRING)) {
@@ -579,10 +578,10 @@ using blender::GVArray;
bool ED_geometry_attribute_convert(Mesh *mesh,
const char *layer_name,
- CustomDataType old_type,
- AttributeDomain old_domain,
- CustomDataType new_type,
- AttributeDomain new_domain)
+ eCustomDataType old_type,
+ eAttrDomain old_domain,
+ eCustomDataType new_type,
+ eAttrDomain new_domain)
{
CustomDataLayer *layer = BKE_id_attribute_find(&mesh->id, layer_name, old_type, old_domain);
const std::string name = layer->name;
diff --git a/source/blender/editors/include/ED_geometry.h b/source/blender/editors/include/ED_geometry.h
index 46e6904523a..4620181894a 100644
--- a/source/blender/editors/include/ED_geometry.h
+++ b/source/blender/editors/include/ED_geometry.h
@@ -19,10 +19,10 @@ struct Mesh;
void ED_operatortypes_geometry(void);
bool ED_geometry_attribute_convert(struct Mesh *mesh,
const char *layer_name,
- CustomDataType old_type,
- AttributeDomain old_domain,
- CustomDataType new_type,
- AttributeDomain new_domain);
+ eCustomDataType old_type,
+ eAttrDomain old_domain,
+ eCustomDataType new_type,
+ eAttrDomain new_domain);
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/editors/interface/interface_template_attribute_search.cc b/source/blender/editors/interface/interface_template_attribute_search.cc
index 65764e31ec8..4e587bd5338 100644
--- a/source/blender/editors/interface/interface_template_attribute_search.cc
+++ b/source/blender/editors/interface/interface_template_attribute_search.cc
@@ -24,14 +24,14 @@ using blender::nodes::geometry_nodes_eval_log::GeometryAttributeInfo;
namespace blender::ui {
-static StringRef attribute_data_type_string(const CustomDataType type)
+static StringRef attribute_data_type_string(const eCustomDataType type)
{
const char *name = nullptr;
RNA_enum_name_from_value(rna_enum_attribute_type_items, type, &name);
return StringRef(IFACE_(name));
}
-static StringRef attribute_domain_string(const AttributeDomain domain)
+static StringRef attribute_domain_string(const eAttrDomain domain)
{
const char *name = nullptr;
RNA_enum_name_from_value(rna_enum_attribute_domain_items, domain, &name);
diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c
index ecc5f8f8ef5..d75c92f963f 100644
--- a/source/blender/editors/mesh/editmesh_undo.c
+++ b/source/blender/editors/mesh/editmesh_undo.c
@@ -72,7 +72,7 @@ static CLG_LogRef LOG = {"ed.undo.mesh"};
/* Single linked list of layers stored per type */
typedef struct BArrayCustomData {
struct BArrayCustomData *next;
- CustomDataType type;
+ eCustomDataType type;
int states_len; /* number of layers for each type */
BArrayState *states[0];
} BArrayCustomData;
@@ -149,7 +149,7 @@ static void um_arraystore_cd_compact(struct CustomData *cdata,
const BArrayCustomData *bcd_reference_current = bcd_reference;
BArrayCustomData *bcd = NULL, *bcd_first = NULL, *bcd_prev = NULL;
for (int layer_start = 0, layer_end; layer_start < cdata->totlayer; layer_start = layer_end) {
- const CustomDataType type = cdata->layers[layer_start].type;
+ const eCustomDataType type = cdata->layers[layer_start].type;
/* Perform a full copy on dynamic layers.
*
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c
index b9a4c79ac03..4837b538bf6 100644
--- a/source/blender/editors/object/object_data_transfer.c
+++ b/source/blender/editors/object/object_data_transfer.c
@@ -88,14 +88,14 @@ static const EnumPropertyItem DT_layer_items[] = {
};
static void dt_add_vcol_layers(CustomData *cdata,
- CustomDataMask mask,
+ eCustomDataMask mask,
EnumPropertyItem **r_item,
int *r_totitem)
{
int types[2] = {CD_PROP_COLOR, CD_PROP_BYTE_COLOR};
for (int i = 0; i < 2; i++) {
- CustomDataType type = types[i];
+ eCustomDataType type = types[i];
if (!(mask & CD_TYPE_AS_MASK(type))) {
continue;
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc b/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc
index 9a14f0cfef0..f620fed5761 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_selection.cc
@@ -8,8 +8,7 @@
namespace blender::ed::sculpt_paint {
-static VArray<float> get_curves_selection(const CurvesGeometry &curves,
- const AttributeDomain domain)
+static VArray<float> get_curves_selection(const CurvesGeometry &curves, const eAttrDomain domain)
{
switch (domain) {
case ATTR_DOMAIN_CURVE:
@@ -29,11 +28,10 @@ VArray<float> get_curves_selection(const Curves &curves_id)
return VArray<float>::ForSingle(1.0f, CurvesGeometry::wrap(curves_id.geometry).curves_num());
}
return get_curves_selection(CurvesGeometry::wrap(curves_id.geometry),
- AttributeDomain(curves_id.selection_domain));
+ eAttrDomain(curves_id.selection_domain));
}
-static VArray<float> get_point_selection(const CurvesGeometry &curves,
- const AttributeDomain domain)
+static VArray<float> get_point_selection(const CurvesGeometry &curves, const eAttrDomain domain)
{
switch (domain) {
case ATTR_DOMAIN_CURVE:
@@ -53,11 +51,11 @@ VArray<float> get_point_selection(const Curves &curves_id)
return VArray<float>::ForSingle(1.0f, CurvesGeometry::wrap(curves_id.geometry).points_num());
}
return get_point_selection(CurvesGeometry::wrap(curves_id.geometry),
- AttributeDomain(curves_id.selection_domain));
+ eAttrDomain(curves_id.selection_domain));
}
static IndexMask retrieve_selected_curves(const CurvesGeometry &curves,
- const AttributeDomain domain,
+ const eAttrDomain domain,
Vector<int64_t> &r_indices)
{
switch (domain) {
@@ -100,7 +98,7 @@ IndexMask retrieve_selected_curves(const Curves &curves_id, Vector<int64_t> &r_i
return CurvesGeometry::wrap(curves_id.geometry).curves_range();
}
return retrieve_selected_curves(CurvesGeometry::wrap(curves_id.geometry),
- AttributeDomain(curves_id.selection_domain),
+ eAttrDomain(curves_id.selection_domain),
r_indices);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index b7ec427349f..e6c90fd8d3f 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -6488,14 +6488,14 @@ static CustomDataLayer *proj_paint_color_attribute_create(wmOperator *op, Object
{
char name[MAX_NAME] = "";
float color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
- AttributeDomain domain = ATTR_DOMAIN_POINT;
- CustomDataType type = CD_PROP_COLOR;
+ eAttrDomain domain = ATTR_DOMAIN_POINT;
+ eCustomDataType type = CD_PROP_COLOR;
if (op) {
RNA_string_get(op->ptr, "name", name);
RNA_float_get_array(op->ptr, "color", color);
- domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
- type = (CustomDataType)RNA_enum_get(op->ptr, "data_type");
+ domain = (eAttrDomain)RNA_enum_get(op->ptr, "domain");
+ type = (eCustomDataType)RNA_enum_get(op->ptr, "data_type");
}
ID *id = (ID *)ob->data;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc
index fb1c8ceaa1a..fea501f20a9 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.cc
+++ b/source/blender/editors/sculpt_paint/paint_vertex.cc
@@ -140,7 +140,7 @@ struct NormalAnglePrecalc {
static int get_vcol_elements(Mesh *me, size_t *r_elem_size)
{
CustomDataLayer *layer = BKE_id_attributes_active_color_get(&me->id);
- AttributeDomain domain = BKE_id_attribute_domain(&me->id, layer);
+ eAttrDomain domain = BKE_id_attribute_domain(&me->id, layer);
if (r_elem_size) {
*r_elem_size = layer->type == CD_PROP_COLOR ? sizeof(float) * 4ULL : 4ULL;
@@ -324,7 +324,7 @@ bool weight_paint_poll_ignore_tool(bContext *C)
return weight_paint_poll_ex(C, false);
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static Color vpaint_get_current_col(Scene *scene, VPaint *vp, bool secondary)
{
Brush *brush = BKE_paint_brush(&vp->paint);
@@ -2823,11 +2823,11 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
struct VPaintDataBase {
ViewContext vc;
- AttributeDomain domain;
- CustomDataType type;
+ eAttrDomain domain;
+ eCustomDataType type;
};
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
struct VPaintData : public VPaintDataBase {
NormalAnglePrecalc normal_angle_precalc;
@@ -2855,7 +2855,7 @@ struct VPaintData : public VPaintDataBase {
} smear;
};
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void *vpaint_init_vpaint(bContext *C,
wmOperator *op,
Scene *scene,
@@ -2949,7 +2949,7 @@ static bool vpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
return false;
}
- AttributeDomain domain = BKE_id_attribute_domain(&me->id, layer);
+ eAttrDomain domain = BKE_id_attribute_domain(&me->id, layer);
void *vpd = nullptr;
if (domain == ATTR_DOMAIN_POINT) {
@@ -3272,7 +3272,7 @@ static void do_vpaint_brush_blur_verts(bContext *C,
});
}
-template<typename Color = ColorPaint4b, typename Traits, AttributeDomain domain>
+template<typename Color = ColorPaint4b, typename Traits, eAttrDomain domain>
static void do_vpaint_brush_smear(bContext *C,
Sculpt *UNUSED(sd),
VPaint *vp,
@@ -3451,7 +3451,7 @@ static void do_vpaint_brush_smear(bContext *C,
});
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void calculate_average_color(VPaintData<Color, Traits, domain> *vpd,
Object *ob,
Mesh *me,
@@ -3541,7 +3541,7 @@ static void calculate_average_color(VPaintData<Color, Traits, domain> *vpd,
}
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static float paint_and_tex_color_alpha(VPaint *vp,
VPaintData<Color, Traits, domain> *vpd,
const float v_co[3],
@@ -3559,7 +3559,7 @@ static float paint_and_tex_color_alpha(VPaint *vp,
return rgba[3];
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_do_draw(bContext *C,
Sculpt *UNUSED(sd),
VPaint *vp,
@@ -3699,7 +3699,7 @@ static void vpaint_do_draw(bContext *C,
});
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_do_blur(bContext *C,
Sculpt *sd,
VPaint *vp,
@@ -3718,7 +3718,7 @@ static void vpaint_do_blur(bContext *C,
}
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_paint_leaves(bContext *C,
Sculpt *sd,
VPaint *vp,
@@ -3754,7 +3754,7 @@ static void vpaint_paint_leaves(bContext *C,
}
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_do_paint(bContext *C,
Sculpt *sd,
VPaint *vp,
@@ -3785,7 +3785,7 @@ static void vpaint_do_paint(bContext *C,
}
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_do_radial_symmetry(bContext *C,
Sculpt *sd,
VPaint *vp,
@@ -3804,7 +3804,7 @@ static void vpaint_do_radial_symmetry(bContext *C,
/* near duplicate of: sculpt.c's,
* 'do_symmetrical_brush_actions' and 'wpaint_do_symmetrical_brush_actions'. */
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_do_symmetrical_brush_actions(
bContext *C, Sculpt *sd, VPaint *vp, VPaintData<Color, Traits, domain> *vpd, Object *ob)
{
@@ -3851,7 +3851,7 @@ static void vpaint_do_symmetrical_brush_actions(
cache->is_last_valid = true;
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_stroke_update_step_intern(bContext *C, PaintStroke *stroke, PointerRNA *itemptr)
{
Scene *scene = CTX_data_scene(C);
@@ -3939,7 +3939,7 @@ static void vpaint_stroke_update_step(bContext *C,
}
}
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static void vpaint_free_vpaintdata(Object *UNUSED(ob), void *_vpd)
{
VPaintData<Color, Traits, domain> *vpd = static_cast<VPaintData<Color, Traits, domain> *>(_vpd);
@@ -4096,7 +4096,7 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot)
/** \name Set Vertex Colors Operator
* \{ */
-template<typename Color, typename Traits, AttributeDomain domain>
+template<typename Color, typename Traits, eAttrDomain domain>
static bool vertex_color_set(Object *ob, ColorPaint4f paintcol_in, Color *color_layer)
{
Mesh *me;
@@ -4164,7 +4164,7 @@ static bool paint_object_attributes_active_color_fill_ex(Object *ob,
me->editflag &= ~ME_EDIT_PAINT_FACE_SEL;
me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
}
- AttributeDomain domain = BKE_id_attribute_domain(&me->id, layer);
+ eAttrDomain domain = BKE_id_attribute_domain(&me->id, layer);
bool ok = false;
if (domain == ATTR_DOMAIN_POINT) {
if (layer->type == CD_PROP_COLOR) {
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 4588930bdee..f6b24bede61 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -106,7 +106,7 @@ typedef struct UndoSculpt {
} UndoSculpt;
typedef struct SculptAttrRef {
- AttributeDomain domain;
+ eAttrDomain domain;
int type;
char name[MAX_CUSTOMDATA_LAYER_NAME];
bool was_set;
@@ -1576,7 +1576,7 @@ static void sculpt_undo_set_active_layer(struct bContext *C, SculptAttrRef *attr
*/
if (!layer) {
layer = BKE_id_attribute_search(&me->id, attr->name, CD_MASK_PROP_ALL, ATTR_DOMAIN_MASK_ALL);
- AttributeDomain domain = layer ? BKE_id_attribute_domain(&me->id, layer) : ATTR_DOMAIN_NUM;
+ eAttrDomain domain = layer ? BKE_id_attribute_domain(&me->id, layer) : ATTR_DOMAIN_NUM;
if (layer && ED_geometry_attribute_convert(
me, attr->name, layer->type, domain, attr->type, attr->domain)) {
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index e0ff4212a94..7b8413b656a 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -75,7 +75,7 @@
using blender::GPointer;
using blender::fn::GField;
namespace geo_log = blender::nodes::geometry_nodes_eval_log;
-using geo_log::NamedAttributeUsage;
+using geo_log::eNamedAttrUsage;
extern "C" {
/* XXX interface.h */
@@ -1695,7 +1695,7 @@ struct NodeExtraInfoRow {
};
struct NamedAttributeTooltipArg {
- Map<std::string, NamedAttributeUsage> usage_by_attribute;
+ Map<std::string, eNamedAttrUsage> usage_by_attribute;
};
static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char *UNUSED(tip))
@@ -1707,7 +1707,7 @@ static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char
struct NameWithUsage {
StringRefNull name;
- NamedAttributeUsage usage;
+ eNamedAttrUsage usage;
};
Vector<NameWithUsage> sorted_used_attribute;
@@ -1722,16 +1722,16 @@ static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char
for (const NameWithUsage &attribute : sorted_used_attribute) {
const StringRefNull name = attribute.name;
- const NamedAttributeUsage usage = attribute.usage;
+ const eNamedAttrUsage usage = attribute.usage;
ss << " \u2022 \"" << name << "\": ";
Vector<std::string> usages;
- if ((usage & NamedAttributeUsage::Read) != NamedAttributeUsage::None) {
+ if ((usage & eNamedAttrUsage::Read) != eNamedAttrUsage::None) {
usages.append(TIP_("read"));
}
- if ((usage & NamedAttributeUsage::Write) != NamedAttributeUsage::None) {
+ if ((usage & eNamedAttrUsage::Write) != eNamedAttrUsage::None) {
usages.append(TIP_("write"));
}
- if ((usage & NamedAttributeUsage::Remove) != NamedAttributeUsage::None) {
+ if ((usage & eNamedAttrUsage::Remove) != eNamedAttrUsage::None) {
usages.append(TIP_("remove"));
}
for (const int i : usages.index_range()) {
@@ -1749,7 +1749,7 @@ static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char
}
static NodeExtraInfoRow row_from_used_named_attribute(
- const Map<std::string, NamedAttributeUsage> &usage_by_attribute_name)
+ const Map<std::string, eNamedAttrUsage> &usage_by_attribute_name)
{
const int attributes_num = usage_by_attribute_name.size();
@@ -1777,7 +1777,7 @@ static std::optional<NodeExtraInfoRow> node_get_accessed_attributes_row(const Sp
return std::nullopt;
}
- Map<std::string, NamedAttributeUsage> usage_by_attribute;
+ Map<std::string, eNamedAttrUsage> usage_by_attribute;
tree_log->foreach_node_log([&](const geo_log::NodeLog &node_log) {
for (const geo_log::UsedNamedAttribute &used_attribute : node_log.used_named_attributes()) {
usage_by_attribute.lookup_or_add_as(used_attribute.name,
@@ -1807,7 +1807,7 @@ static std::optional<NodeExtraInfoRow> node_get_accessed_attributes_row(const Sp
if (node_log == nullptr) {
return std::nullopt;
}
- Map<std::string, NamedAttributeUsage> usage_by_attribute;
+ Map<std::string, eNamedAttrUsage> usage_by_attribute;
for (const geo_log::UsedNamedAttribute &used_attribute : node_log->used_named_attributes()) {
usage_by_attribute.lookup_or_add_as(used_attribute.name,
used_attribute.usage) |= used_attribute.usage;
diff --git a/source/blender/editors/space_node/node_geometry_attribute_search.cc b/source/blender/editors/space_node/node_geometry_attribute_search.cc
index ed981603293..f08e23c8371 100644
--- a/source/blender/editors/space_node/node_geometry_attribute_search.cc
+++ b/source/blender/editors/space_node/node_geometry_attribute_search.cc
@@ -128,7 +128,7 @@ static void attribute_search_update_fn(
* Some custom data types don't correspond to node types and therefore can't be
* used by the named attribute input node. Find the best option or fallback to float.
*/
-static CustomDataType data_type_in_attribute_input_node(const CustomDataType type)
+static eCustomDataType data_type_in_attribute_input_node(const eCustomDataType type)
{
switch (type) {
case CD_PROP_FLOAT:
@@ -187,7 +187,7 @@ static void attribute_search_exec_fn(bContext *C, void *data_v, void *item_v)
/* For the attribute input node, also adjust the type and links connected to the output. */
if (node->type == GEO_NODE_INPUT_NAMED_ATTRIBUTE && item->data_type.has_value()) {
NodeGeometryInputNamedAttribute &storage = *(NodeGeometryInputNamedAttribute *)node->storage;
- const CustomDataType new_type = data_type_in_attribute_input_node(*item->data_type);
+ const eCustomDataType new_type = data_type_in_attribute_input_node(*item->data_type);
if (new_type != storage.data_type) {
storage.data_type = new_type;
/* Make the output socket with the new type on the attribute input node active. */
diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc
index 5796a712205..e10bedb18f4 100644
--- a/source/blender/editors/space_node/node_relationships.cc
+++ b/source/blender/editors/space_node/node_relationships.cc
@@ -454,7 +454,7 @@ static bool socket_can_be_viewed(const OutputSocketRef &socket)
SOCK_RGBA);
}
-static CustomDataType socket_type_to_custom_data_type(const eNodeSocketDatatype socket_type)
+static eCustomDataType socket_type_to_custom_data_type(const eNodeSocketDatatype socket_type)
{
switch (socket_type) {
case SOCK_FLOAT:
@@ -491,7 +491,7 @@ static bNodeSocket *node_link_viewer_get_socket(bNodeTree &ntree,
return viewer_socket;
}
NodeGeometryViewer *storage = (NodeGeometryViewer *)viewer_node.storage;
- const CustomDataType data_type = socket_type_to_custom_data_type(
+ const eCustomDataType data_type = socket_type_to_custom_data_type(
(eNodeSocketDatatype)src_socket.type);
BLI_assert(data_type != CD_AUTO_FROM_NAME);
storage->data_type = data_type;
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index ac15b77fde0..f5315b616d0 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -512,7 +512,7 @@ class GeometryComponentCacheValue : public SpreadsheetCache::Value {
public:
/* Stores the result of fields evaluated on a geometry component. Without this, fields would have
* to be reevaluated on every redraw. */
- Map<std::pair<AttributeDomain, GField>, GArray<>> arrays;
+ Map<std::pair<eAttrDomain, GField>, GArray<>> arrays;
};
static void add_fields_as_extra_columns(SpaceSpreadsheet *sspreadsheet,
@@ -526,7 +526,7 @@ static void add_fields_as_extra_columns(SpaceSpreadsheet *sspreadsheet,
sspreadsheet->runtime->cache.lookup_or_add<GeometryComponentCacheValue>(
std::make_unique<GeometryComponentCacheKey>(component));
- const AttributeDomain domain = (AttributeDomain)sspreadsheet->attribute_domain;
+ const eAttrDomain domain = (eAttrDomain)sspreadsheet->attribute_domain;
const int domain_num = component.attribute_domain_num(domain);
for (const auto item : fields_to_show.items()) {
StringRef name = item.key;
@@ -550,7 +550,7 @@ static void add_fields_as_extra_columns(SpaceSpreadsheet *sspreadsheet,
std::unique_ptr<DataSource> data_source_from_geometry(const bContext *C, Object *object_eval)
{
SpaceSpreadsheet *sspreadsheet = CTX_wm_space_spreadsheet(C);
- const AttributeDomain domain = (AttributeDomain)sspreadsheet->attribute_domain;
+ const eAttrDomain domain = (eAttrDomain)sspreadsheet->attribute_domain;
const GeometryComponentType component_type = get_display_component_type(C, object_eval);
GeometrySet geometry_set = spreadsheet_get_display_geometry_set(sspreadsheet, object_eval);
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh
index 8b281e5a558..04b4f6d8d06 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.hh
@@ -40,7 +40,7 @@ class GeometryDataSource : public DataSource {
Object *object_eval_;
const GeometrySet geometry_set_;
const GeometryComponent *component_;
- AttributeDomain domain_;
+ eAttrDomain domain_;
ExtraColumns extra_columns_;
/* Some data is computed on the fly only when it is requested. Computing it does not change the
@@ -53,7 +53,7 @@ class GeometryDataSource : public DataSource {
GeometryDataSource(Object *object_eval,
GeometrySet geometry_set,
const GeometryComponentType component_type,
- const AttributeDomain domain,
+ const eAttrDomain domain,
ExtraColumns extra_columns)
: object_eval_(object_eval),
geometry_set_(std::move(geometry_set)),
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc b/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc
index 724d0783707..ee22f4173ab 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc
@@ -27,7 +27,7 @@ class GeometryDataSetTreeView;
class GeometryDataSetTreeViewItem : public ui::AbstractTreeViewItem {
GeometryComponentType component_type_;
- std::optional<AttributeDomain> domain_;
+ std::optional<eAttrDomain> domain_;
BIFIconID icon_;
public:
@@ -35,7 +35,7 @@ class GeometryDataSetTreeViewItem : public ui::AbstractTreeViewItem {
StringRef label,
BIFIconID icon);
GeometryDataSetTreeViewItem(GeometryComponentType component_type,
- AttributeDomain domain,
+ eAttrDomain domain,
StringRef label,
BIFIconID icon);
@@ -113,7 +113,7 @@ GeometryDataSetTreeViewItem::GeometryDataSetTreeViewItem(GeometryComponentType c
this->set_collapsed(false);
}
GeometryDataSetTreeViewItem::GeometryDataSetTreeViewItem(GeometryComponentType component_type,
- AttributeDomain domain,
+ eAttrDomain domain,
StringRef label,
BIFIconID icon)
: component_type_(component_type), domain_(domain), icon_(icon)
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
index d76bbbf3be6..166c5de9fc3 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc
@@ -84,7 +84,7 @@ static int select_component_domain_invoke(bContext *C,
{
GeometryComponentType component_type = static_cast<GeometryComponentType>(
RNA_int_get(op->ptr, "component_type"));
- AttributeDomain attribute_domain = static_cast<AttributeDomain>(
+ eAttrDomain attribute_domain = static_cast<eAttrDomain>(
RNA_int_get(op->ptr, "attribute_domain_type"));
SpaceSpreadsheet *sspreadsheet = CTX_wm_space_spreadsheet(C);