diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-01 07:38:06 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-01 08:38:48 +0300 |
commit | 44bac4c8ccf19cb5941435115b8f89a9d14e9c23 (patch) | |
tree | 2bd7698ca3e1e382b078e274566dbad0ae82214c /source/blender/editors/sculpt_paint | |
parent | ca346d2176737b6aa296617452a8a6cacb7a970a (diff) |
Cleanup: use 'e' prefix for enum types
- CustomDataType -> eCustomDataType
- CustomDataMask -> eCustomDataMask
- AttributeDomain -> eAttrDomain
- NamedAttributeUsage -> eNamedAttrUsage
Diffstat (limited to 'source/blender/editors/sculpt_paint')
4 files changed, 32 insertions, 34 deletions
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)) { |