From 44bac4c8ccf19cb5941435115b8f89a9d14e9c23 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Jun 2022 14:38:06 +1000 Subject: Cleanup: use 'e' prefix for enum types - CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage --- source/blender/blenkernel/BKE_attribute.h | 42 ++++----- source/blender/blenkernel/BKE_attribute_access.hh | 49 +++++----- source/blender/blenkernel/BKE_attribute_math.hh | 2 +- source/blender/blenkernel/BKE_camera.h | 2 +- source/blender/blenkernel/BKE_curves.hh | 4 +- source/blender/blenkernel/BKE_customdata.h | 32 +++---- source/blender/blenkernel/BKE_geometry_fields.hh | 22 ++--- source/blender/blenkernel/BKE_geometry_set.hh | 74 +++++++-------- source/blender/blenkernel/BKE_mesh_runtime.h | 2 +- source/blender/blenkernel/BKE_mesh_sample.hh | 2 +- source/blender/blenkernel/BKE_paint.h | 4 +- source/blender/blenkernel/BKE_pbvh.h | 2 +- source/blender/blenkernel/intern/attribute.cc | 50 +++++----- .../blender/blenkernel/intern/attribute_access.cc | 104 ++++++++++----------- .../blenkernel/intern/attribute_access_intern.hh | 58 ++++++------ .../blenkernel/intern/curve_to_mesh_convert.cc | 22 ++--- .../blender/blenkernel/intern/curves_geometry.cc | 33 ++++--- source/blender/blenkernel/intern/customdata.cc | 33 ++++--- .../blenkernel/intern/geometry_component_curve.cc | 23 +++-- .../blenkernel/intern/geometry_component_curves.cc | 12 +-- .../intern/geometry_component_instances.cc | 2 +- .../blenkernel/intern/geometry_component_mesh.cc | 13 ++- .../intern/geometry_component_pointcloud.cc | 2 +- source/blender/blenkernel/intern/geometry_set.cc | 4 +- .../blender/blenkernel/intern/mesh_remesh_voxel.cc | 2 +- source/blender/blenkernel/intern/mesh_sample.cc | 2 +- source/blender/blenkernel/intern/mesh_validate.cc | 4 +- source/blender/blenkernel/intern/paint.c | 2 +- source/blender/blenkernel/intern/pbvh.c | 6 +- source/blender/blenkernel/intern/pbvh.cc | 12 +-- source/blender/blenkernel/intern/pbvh_intern.h | 2 +- source/blender/bmesh/intern/bmesh_construct.c | 15 +-- .../blender/bmesh/operators/bmo_join_triangles.c | 2 +- source/blender/draw/intern/draw_attributes.cc | 4 +- source/blender/draw/intern/draw_attributes.h | 8 +- .../blender/draw/intern/draw_cache_impl_curves.cc | 4 +- source/blender/draw/intern/draw_cache_impl_mesh.c | 4 +- .../mesh_extractors/extract_mesh_vbo_attributes.cc | 8 +- .../mesh_extractors/extract_mesh_vbo_vcol.cc | 4 +- source/blender/editors/curves/intern/curves_ops.cc | 4 +- .../editors/geometry/geometry_attributes.cc | 21 ++--- source/blender/editors/include/ED_geometry.h | 8 +- .../interface_template_attribute_search.cc | 4 +- source/blender/editors/mesh/editmesh_undo.c | 4 +- .../blender/editors/object/object_data_transfer.c | 4 +- .../sculpt_paint/curves_sculpt_selection.cc | 14 ++- .../editors/sculpt_paint/paint_image_proj.c | 8 +- .../blender/editors/sculpt_paint/paint_vertex.cc | 40 ++++---- source/blender/editors/sculpt_paint/sculpt_undo.c | 4 +- source/blender/editors/space_node/node_draw.cc | 20 ++-- .../space_node/node_geometry_attribute_search.cc | 4 +- .../editors/space_node/node_relationships.cc | 4 +- .../spreadsheet_data_source_geometry.cc | 6 +- .../spreadsheet_data_source_geometry.hh | 4 +- .../space_spreadsheet/spreadsheet_dataset_draw.cc | 6 +- .../editors/space_spreadsheet/spreadsheet_ops.cc | 2 +- .../blender/geometry/intern/realize_instances.cc | 34 +++---- source/blender/geometry/intern/resample_curves.cc | 2 +- source/blender/gpu/GPU_buffers.h | 2 +- source/blender/gpu/GPU_material.h | 8 +- source/blender/gpu/intern/gpu_buffers.c | 2 +- source/blender/gpu/intern/gpu_node_graph.c | 8 +- source/blender/io/alembic/intern/abc_customdata.cc | 2 +- .../blender/io/alembic/intern/abc_reader_mesh.cc | 2 +- source/blender/io/usd/intern/usd_reader_mesh.cc | 2 +- source/blender/makesdna/DNA_curves_types.h | 2 +- source/blender/makesdna/DNA_customdata_types.h | 6 +- source/blender/makesdna/DNA_node_types.h | 34 +++---- source/blender/makesdna/DNA_space_types.h | 2 +- source/blender/makesrna/intern/rna_attribute.c | 4 +- source/blender/makesrna/intern/rna_modifier.c | 11 +-- source/blender/modifiers/intern/MOD_nodes.cc | 31 +++--- source/blender/nodes/NOD_geometry_exec.hh | 24 ++--- .../blender/nodes/NOD_geometry_nodes_eval_log.hh | 12 +-- .../nodes/function/nodes/node_fn_random_value.cc | 8 +- .../blender/nodes/geometry/node_geometry_util.cc | 4 +- .../blender/nodes/geometry/node_geometry_util.hh | 6 +- .../geometry/nodes/node_geo_accumulate_field.cc | 22 ++--- .../geometry/nodes/node_geo_attribute_capture.cc | 14 +-- .../geometry/nodes/node_geo_attribute_statistic.cc | 10 +- .../nodes/node_geo_curve_endpoint_selection.cc | 2 +- .../nodes/node_geo_curve_handle_type_selection.cc | 2 +- .../nodes/node_geo_curve_spline_parameter.cc | 12 +-- .../geometry/nodes/node_geo_curve_to_points.cc | 2 +- .../geometry/nodes/node_geo_delete_geometry.cc | 26 +++--- .../nodes/node_geo_distribute_points_on_faces.cc | 6 +- .../nodes/geometry/nodes/node_geo_dual_mesh.cc | 4 +- .../geometry/nodes/node_geo_duplicate_elements.cc | 24 ++--- .../nodes/geometry/nodes/node_geo_extrude_mesh.cc | 2 +- .../geometry/nodes/node_geo_field_at_index.cc | 14 +-- .../geometry/nodes/node_geo_input_curve_handles.cc | 2 +- .../nodes/node_geo_input_mesh_edge_angle.cc | 4 +- .../nodes/node_geo_input_mesh_edge_neighbors.cc | 2 +- .../nodes/node_geo_input_mesh_edge_vertices.cc | 8 +- .../nodes/node_geo_input_mesh_face_area.cc | 4 +- .../nodes/node_geo_input_mesh_face_is_planar.cc | 2 +- .../nodes/node_geo_input_mesh_face_neighbors.cc | 8 +- .../geometry/nodes/node_geo_input_mesh_island.cc | 4 +- .../nodes/node_geo_input_mesh_vertex_neighbors.cc | 8 +- .../nodes/node_geo_input_named_attribute.cc | 8 +- .../geometry/nodes/node_geo_input_spline_length.cc | 4 +- .../nodes/geometry/nodes/node_geo_input_tangent.cc | 4 +- .../geometry/nodes/node_geo_instance_on_points.cc | 2 +- .../nodes/geometry/nodes/node_geo_join_geometry.cc | 4 +- .../geometry/nodes/node_geo_material_selection.cc | 2 +- .../geometry/nodes/node_geo_mesh_to_points.cc | 4 +- .../geometry/nodes/node_geo_points_to_vertices.cc | 2 +- .../nodes/geometry/nodes/node_geo_raycast.cc | 10 +- .../geometry/nodes/node_geo_remove_attribute.cc | 2 +- .../geometry/nodes/node_geo_scale_elements.cc | 2 +- .../geometry/nodes/node_geo_separate_geometry.cc | 2 +- .../nodes/geometry/nodes/node_geo_set_id.cc | 6 +- .../nodes/geometry/nodes/node_geo_set_position.cc | 7 +- .../nodes/node_geo_store_named_attribute.cc | 14 +-- .../geometry/nodes/node_geo_transfer_attribute.cc | 24 ++--- .../nodes/geometry/nodes/node_geo_viewer.cc | 6 +- .../nodes/intern/geometry_nodes_eval_log.cc | 2 +- source/blender/nodes/intern/node_geometry_exec.cc | 16 ++-- .../nodes/shader/nodes/node_shader_map_range.cc | 10 +- .../nodes/shader/nodes/node_shader_uvmap.cc | 2 +- .../nodes/shader/nodes/node_shader_vertex_color.cc | 2 +- 121 files changed, 673 insertions(+), 679 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_attribute.h b/source/blender/blenkernel/BKE_attribute.h index 050cfe1ed85..2985e7cd0b2 100644 --- a/source/blender/blenkernel/BKE_attribute.h +++ b/source/blender/blenkernel/BKE_attribute.h @@ -22,7 +22,7 @@ struct ID; struct ReportList; /** #Attribute.domain */ -typedef enum AttributeDomain { +typedef enum eAttrDomain { ATTR_DOMAIN_AUTO = -1, /* Use for nodes to choose automatically based on other data. */ ATTR_DOMAIN_POINT = 0, /* Mesh, Curve or Point Cloud Point */ ATTR_DOMAIN_EDGE = 1, /* Mesh Edge */ @@ -30,23 +30,23 @@ typedef enum AttributeDomain { ATTR_DOMAIN_CORNER = 3, /* Mesh Corner */ ATTR_DOMAIN_CURVE = 4, /* A single curve in a larger curve data-block */ ATTR_DOMAIN_INSTANCE = 5, /* Instance */ -} AttributeDomain; +} eAttrDomain; #define ATTR_DOMAIN_NUM 6 -typedef enum AttributeDomainMask { +typedef enum eAttrDomainMask { ATTR_DOMAIN_MASK_POINT = (1 << 0), ATTR_DOMAIN_MASK_EDGE = (1 << 1), ATTR_DOMAIN_MASK_FACE = (1 << 2), ATTR_DOMAIN_MASK_CORNER = (1 << 3), ATTR_DOMAIN_MASK_CURVE = (1 << 4), ATTR_DOMAIN_MASK_ALL = (1 << 5) - 1 -} AttributeDomainMask; +} eAttrDomainMask; -#define ATTR_DOMAIN_AS_MASK(domain) ((AttributeDomainMask)((1 << (int)(domain)))) +#define ATTR_DOMAIN_AS_MASK(domain) ((eAttrDomainMask)((1 << (int)(domain)))) /* All domains that support color attributes. */ #define ATTR_DOMAIN_MASK_COLOR \ - ((AttributeDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER))) + ((eAttrDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER))) /* Attributes. */ @@ -57,7 +57,7 @@ bool BKE_attribute_allow_procedural_access(const char *attribute_name); * Create a new attribute layer. */ struct CustomDataLayer *BKE_id_attribute_new( - struct ID *id, const char *name, int type, AttributeDomain domain, struct ReportList *reports); + struct ID *id, const char *name, int type, eAttrDomain domain, struct ReportList *reports); bool BKE_id_attribute_remove(struct ID *id, struct CustomDataLayer *layer, struct ReportList *reports); @@ -65,14 +65,14 @@ bool BKE_id_attribute_remove(struct ID *id, struct CustomDataLayer *BKE_id_attribute_find(const struct ID *id, const char *name, const int type, - const AttributeDomain domain); + const eAttrDomain domain); struct CustomDataLayer *BKE_id_attribute_search(const struct ID *id, const char *name, - const CustomDataMask type, - const AttributeDomainMask domain_mask); + const eCustomDataMask type, + const eAttrDomainMask domain_mask); -AttributeDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer); +eAttrDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer); int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer); bool BKE_id_attribute_required(struct ID *id, struct CustomDataLayer *layer); bool BKE_id_attribute_rename(struct ID *id, @@ -81,8 +81,8 @@ bool BKE_id_attribute_rename(struct ID *id, struct ReportList *reports); int BKE_id_attributes_length(const struct ID *id, - AttributeDomainMask domain_mask, - CustomDataMask mask); + eAttrDomainMask domain_mask, + eCustomDataMask mask); struct CustomDataLayer *BKE_id_attributes_active_get(struct ID *id); void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer); @@ -91,24 +91,24 @@ int *BKE_id_attributes_active_index_p(struct ID *id); CustomData *BKE_id_attributes_iterator_next_domain(struct ID *id, struct CustomDataLayer *layers); CustomDataLayer *BKE_id_attribute_from_index(struct ID *id, int lookup_index, - AttributeDomainMask domain_mask, - CustomDataMask layer_mask); + eAttrDomainMask domain_mask, + eCustomDataMask layer_mask); /** Layer is allowed to be nullptr; if so -1 (layer not found) will be returned. */ int BKE_id_attribute_to_index(const struct ID *id, const CustomDataLayer *layer, - AttributeDomainMask domain_mask, - CustomDataMask layer_mask); + eAttrDomainMask domain_mask, + eCustomDataMask layer_mask); struct CustomDataLayer *BKE_id_attribute_subset_active_get(const struct ID *id, int active_flag, - AttributeDomainMask domain_mask, - CustomDataMask mask); + eAttrDomainMask domain_mask, + eCustomDataMask mask); void BKE_id_attribute_subset_active_set(struct ID *id, struct CustomDataLayer *layer, int active_flag, - AttributeDomainMask domain_mask, - CustomDataMask mask); + eAttrDomainMask domain_mask, + eCustomDataMask mask); /** * Sets up a temporary ID with arbitrary CustomData domains. `r_id` will diff --git a/source/blender/blenkernel/BKE_attribute_access.hh b/source/blender/blenkernel/BKE_attribute_access.hh index c8c7c4c6808..d7826a0e17a 100644 --- a/source/blender/blenkernel/BKE_attribute_access.hh +++ b/source/blender/blenkernel/BKE_attribute_access.hh @@ -32,7 +32,7 @@ * extremely important for writing coherent bug-free code. When an attribute is retrieved with * write access, via #WriteAttributeLookup or #OutputAttribute, the geometry component must be * tagged to clear caches that depend on the changed data. - * 2. Domain interpolation: When retrieving an attribute, a domain (#AttributeDomain) can be + * 2. Domain interpolation: When retrieving an attribute, a domain (#eAttrDomain) can be * provided. If the attribute is stored on a different domain and conversion is possible, a * version of the data interpolated to the requested domain will be provided. These conversions * are implemented in each #GeometryComponent by `attribute_try_adapt_domain_impl`. @@ -88,8 +88,8 @@ extern const char *no_procedural_access_message; * stored (uv map, vertex group, ...). */ struct AttributeMetaData { - AttributeDomain domain; - CustomDataType data_type; + eAttrDomain domain; + eCustomDataType data_type; constexpr friend bool operator==(AttributeMetaData a, AttributeMetaData b) { @@ -98,8 +98,8 @@ struct AttributeMetaData { }; struct AttributeKind { - AttributeDomain domain; - CustomDataType data_type; + eAttrDomain domain; + eCustomDataType data_type; }; /** @@ -167,12 +167,12 @@ using AttributeForeachCallback = blender::FunctionRef data_types); +eCustomDataType attribute_data_type_highest_complexity(Span data_types); /** * Domains with a higher "information density" have a higher priority, * in order to choose a domain that will not lose data through domain conversion. */ -AttributeDomain attribute_domain_highest_priority(Span domains); +eAttrDomain attribute_domain_highest_priority(Span domains); /** * Used when looking up a "plain attribute" based on a name for reading from it. @@ -181,7 +181,7 @@ struct ReadAttributeLookup { /* The virtual array that is used to read from this attribute. */ GVArray varray; /* Domain the attribute lives on in the geometry. */ - AttributeDomain domain; + eAttrDomain domain; /* Convenience function to check if the attribute has been found. */ operator bool() const @@ -197,7 +197,7 @@ struct WriteAttributeLookup { /** The virtual array that is used to read from and write to the attribute. */ GVMutableArray varray; /** Domain the attributes lives on in the geometry component. */ - AttributeDomain domain; + eAttrDomain domain; /** * Call this after changing the attribute to invalidate caches that depend on this attribute. * \note Do not call this after the component the attribute is from has been destructed. @@ -232,7 +232,7 @@ class OutputAttribute { private: GVMutableArray varray_; - AttributeDomain domain_ = ATTR_DOMAIN_AUTO; + eAttrDomain domain_ = ATTR_DOMAIN_AUTO; SaveFn save_; std::unique_ptr optional_span_varray_; bool ignore_old_values_ = false; @@ -241,10 +241,7 @@ class OutputAttribute { public: OutputAttribute(); OutputAttribute(OutputAttribute &&other); - OutputAttribute(GVMutableArray varray, - AttributeDomain domain, - SaveFn save, - bool ignore_old_values); + OutputAttribute(GVMutableArray varray, eAttrDomain domain, SaveFn save, bool ignore_old_values); ~OutputAttribute(); @@ -253,9 +250,9 @@ class OutputAttribute { GVMutableArray &operator*(); GVMutableArray *operator->(); GVMutableArray &varray(); - AttributeDomain domain() const; + eAttrDomain domain() const; const CPPType &cpp_type() const; - CustomDataType custom_data_type() const; + eCustomDataType custom_data_type() const; GMutableSpan as_span(); template MutableSpan as_span(); @@ -313,7 +310,7 @@ template class OutputAttribute_Typed { return varray_; } - AttributeDomain domain() const + eAttrDomain domain() const { return attribute_.domain(); } @@ -323,7 +320,7 @@ template class OutputAttribute_Typed { return CPPType::get(); } - CustomDataType custom_data_type() const + eCustomDataType custom_data_type() const { return cpp_type_to_custom_data_type(this->cpp_type()); } @@ -379,22 +376,22 @@ class CustomDataAttributes { * value for the type will be used. */ blender::GVArray get_for_read(const AttributeIDRef &attribute_id, - const CustomDataType data_type, + const eCustomDataType data_type, const void *default_value) const; template blender::VArray get_for_read(const AttributeIDRef &attribute_id, const T &default_value) const { const blender::CPPType &cpp_type = blender::CPPType::get(); - const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); + const eCustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); GVArray varray = this->get_for_read(attribute_id, type, &default_value); return varray.typed(); } std::optional get_for_write(const AttributeIDRef &attribute_id); - bool create(const AttributeIDRef &attribute_id, const CustomDataType data_type); + bool create(const AttributeIDRef &attribute_id, const eCustomDataType data_type); bool create_by_move(const AttributeIDRef &attribute_id, - const CustomDataType data_type, + const eCustomDataType data_type, void *buffer); bool remove(const AttributeIDRef &attribute_id); @@ -403,7 +400,7 @@ class CustomDataAttributes { */ void reorder(Span new_order); - bool foreach_attribute(const AttributeForeachCallback callback, AttributeDomain domain) const; + bool foreach_attribute(const AttributeForeachCallback callback, eAttrDomain domain) const; }; /* -------------------------------------------------------------------- */ @@ -491,7 +488,7 @@ inline OutputAttribute::OutputAttribute() = default; inline OutputAttribute::OutputAttribute(OutputAttribute &&other) = default; inline OutputAttribute::OutputAttribute(GVMutableArray varray, - AttributeDomain domain, + eAttrDomain domain, SaveFn save, const bool ignore_old_values) : varray_(std::move(varray)), @@ -521,7 +518,7 @@ inline GVMutableArray &OutputAttribute::varray() return varray_; } -inline AttributeDomain OutputAttribute::domain() const +inline eAttrDomain OutputAttribute::domain() const { return domain_; } @@ -531,7 +528,7 @@ inline const CPPType &OutputAttribute::cpp_type() const return varray_.type(); } -inline CustomDataType OutputAttribute::custom_data_type() const +inline eCustomDataType OutputAttribute::custom_data_type() const { return cpp_type_to_custom_data_type(this->cpp_type()); } diff --git a/source/blender/blenkernel/BKE_attribute_math.hh b/source/blender/blenkernel/BKE_attribute_math.hh index 3d194ba77dc..01c2ef988f2 100644 --- a/source/blender/blenkernel/BKE_attribute_math.hh +++ b/source/blender/blenkernel/BKE_attribute_math.hh @@ -39,7 +39,7 @@ inline void convert_to_static_type(const CPPType &cpp_type, const Func &func) } template -inline void convert_to_static_type(const CustomDataType data_type, const Func &func) +inline void convert_to_static_type(const eCustomDataType data_type, const Func &func) { const CPPType &cpp_type = *bke::custom_data_type_to_cpp_type(data_type); convert_to_static_type(cpp_type, func); diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h index b7aa1c09e04..40df7acd066 100644 --- a/source/blender/blenkernel/BKE_camera.h +++ b/source/blender/blenkernel/BKE_camera.h @@ -171,7 +171,7 @@ struct CameraBGImage *BKE_camera_background_image_new(struct Camera *cam); * `BKE_lib_id.h`. */ struct CameraBGImage *BKE_camera_background_image_copy(struct CameraBGImage *bgpic_src, - const int copy_flag); + const int copy_flag); void BKE_camera_background_image_remove(struct Camera *cam, struct CameraBGImage *bgpic); void BKE_camera_background_image_clear(struct Camera *cam); diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index 445f8d46f2d..168b17bad30 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -410,9 +410,9 @@ class CurvesGeometry : public ::CurvesGeometry { * Attributes. */ - GVArray adapt_domain(const GVArray &varray, AttributeDomain from, AttributeDomain to) const; + GVArray adapt_domain(const GVArray &varray, eAttrDomain from, eAttrDomain to) const; template - VArray adapt_domain(const VArray &varray, AttributeDomain from, AttributeDomain to) const + VArray adapt_domain(const VArray &varray, eAttrDomain from, eAttrDomain to) const { return this->adapt_domain(GVArray(varray), from, to).typed(); } diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 64c49830dc5..0e3e427d7ab 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -28,7 +28,7 @@ struct BlendWriter; struct CustomData; struct CustomData_MeshMasks; struct ID; -typedef uint64_t CustomDataMask; +typedef uint64_t eCustomDataMask; /* A data type large enough to hold 1 element from any custom-data layer type. */ typedef struct { @@ -63,7 +63,7 @@ typedef enum eCDAllocType { CD_DUPLICATE = 4, } eCDAllocType; -#define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) +#define CD_TYPE_AS_MASK(_type) (eCustomDataMask)((eCustomDataMask)1 << (eCustomDataMask)(_type)) void customData_mask_layers__print(const struct CustomData_MeshMasks *mask); @@ -137,7 +137,7 @@ void CustomData_data_add(int type, void *data1, const void *data2); */ void CustomData_copy(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, + eCustomDataMask mask, eCDAllocType alloctype, int totelem); @@ -150,7 +150,7 @@ void CustomData_update_typemap(struct CustomData *data); */ bool CustomData_merge(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, + eCustomDataMask mask, eCDAllocType alloctype, int totelem); @@ -170,7 +170,7 @@ void CustomData_realloc(struct CustomData *data, int totelem); */ bool CustomData_bmesh_merge(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, + eCustomDataMask mask, eCDAllocType alloctype, struct BMesh *bm, char htype); @@ -188,7 +188,7 @@ void CustomData_free(struct CustomData *data, int totelem); /** * Same as above, but only frees layers which matches the given mask. */ -void CustomData_free_typemask(struct CustomData *data, int totelem, CustomDataMask mask); +void CustomData_free_typemask(struct CustomData *data, int totelem, eCustomDataMask mask); /** * Frees all layers with #CD_FLAG_TEMPORARY. @@ -248,7 +248,7 @@ bool CustomData_has_layer(const struct CustomData *data, int type); * Returns the number of layers with this type. */ int CustomData_number_of_layers(const struct CustomData *data, int type); -int CustomData_number_of_layers_typemask(const struct CustomData *data, CustomDataMask mask); +int CustomData_number_of_layers_typemask(const struct CustomData *data, eCustomDataMask mask); /** * Duplicate data of a layer with flag NOFREE, and remove that flag. @@ -276,7 +276,7 @@ void CustomData_duplicate_referenced_layers(CustomData *data, int totelem); * Set the #CD_FLAG_NOCOPY flag in custom data layers where the mask is * zero for the layer type, so only layer types specified by the mask will be copied */ -void CustomData_set_only_copy(const struct CustomData *data, CustomDataMask mask); +void CustomData_set_only_copy(const struct CustomData *data, eCustomDataMask mask); /** * Copies data from one CustomData object to another @@ -309,7 +309,7 @@ void CustomData_bmesh_copy_data_exclude_by_type(const struct CustomData *source, struct CustomData *dest, void *src_block, void **dest_block, - CustomDataMask mask_exclude); + eCustomDataMask mask_exclude); /** * Copies data of a single layer of a given type. @@ -488,7 +488,7 @@ void CustomData_bmesh_free_block_data(struct CustomData *data, void *block); */ void CustomData_bmesh_free_block_data_exclude_by_type(struct CustomData *data, void *block, - CustomDataMask mask_exclude); + eCustomDataMask mask_exclude); /** * Copy custom data to/from layers as in mesh/derived-mesh, to edit-mesh @@ -593,14 +593,14 @@ void CustomData_external_remove(struct CustomData *data, struct ID *id, int type bool CustomData_external_test(struct CustomData *data, int type); void CustomData_external_write( - struct CustomData *data, struct ID *id, CustomDataMask mask, int totelem, int free); + struct CustomData *data, struct ID *id, eCustomDataMask mask, int totelem, int free); void CustomData_external_read(struct CustomData *data, struct ID *id, - CustomDataMask mask, + eCustomDataMask mask, int totelem); void CustomData_external_reload(struct CustomData *data, struct ID *id, - CustomDataMask mask, + eCustomDataMask mask, int totelem); /* Mesh-to-mesh transfer data. */ @@ -726,7 +726,7 @@ void CustomData_blend_write(BlendWriter *writer, CustomData *data, blender::Span layers_to_write, int count, - CustomDataMask cddata_mask, + eCustomDataMask cddata_mask, ID *id); #endif @@ -749,7 +749,7 @@ void CustomData_debug_info_from_layers(const struct CustomData *data, # include "BLI_cpp_type.hh" namespace blender::bke { -const CPPType *custom_data_type_to_cpp_type(const CustomDataType type); -CustomDataType cpp_type_to_custom_data_type(const CPPType &type); +const CPPType *custom_data_type_to_cpp_type(const eCustomDataType type); +eCustomDataType cpp_type_to_custom_data_type(const CPPType &type); } // namespace blender::bke #endif diff --git a/source/blender/blenkernel/BKE_geometry_fields.hh b/source/blender/blenkernel/BKE_geometry_fields.hh index 9c86ab262ef..8478a9d7464 100644 --- a/source/blender/blenkernel/BKE_geometry_fields.hh +++ b/source/blender/blenkernel/BKE_geometry_fields.hh @@ -17,10 +17,10 @@ namespace blender::bke { class GeometryComponentFieldContext : public fn::FieldContext { private: const GeometryComponent &component_; - const AttributeDomain domain_; + const eAttrDomain domain_; public: - GeometryComponentFieldContext(const GeometryComponent &component, const AttributeDomain domain) + GeometryComponentFieldContext(const GeometryComponent &component, const eAttrDomain domain) : component_(component), domain_(domain) { } @@ -30,7 +30,7 @@ class GeometryComponentFieldContext : public fn::FieldContext { return component_; } - AttributeDomain domain() const + eAttrDomain domain() const { return domain_; } @@ -45,7 +45,7 @@ class GeometryFieldInput : public fn::FieldInput { ResourceScope &scope) const override; virtual GVArray get_varray_for_context(const GeometryComponent &component, - AttributeDomain domain, + eAttrDomain domain, IndexMask mask) const = 0; }; @@ -73,7 +73,7 @@ class AttributeFieldInput : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - AttributeDomain domain, + eAttrDomain domain, IndexMask mask) const override; std::string socket_inspection_name() const override; @@ -90,7 +90,7 @@ class IDAttributeFieldInput : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - AttributeDomain domain, + eAttrDomain domain, IndexMask mask) const override; std::string socket_inspection_name() const override; @@ -99,12 +99,12 @@ class IDAttributeFieldInput : public GeometryFieldInput { bool is_equal_to(const fn::FieldNode &other) const override; }; -VArray curve_normals_varray(const CurveComponent &component, const AttributeDomain domain); +VArray curve_normals_varray(const CurveComponent &component, const eAttrDomain domain); VArray mesh_normals_varray(const MeshComponent &mesh_component, const Mesh &mesh, const IndexMask mask, - const AttributeDomain domain); + const eAttrDomain domain); class NormalFieldInput : public GeometryFieldInput { public: @@ -114,7 +114,7 @@ class NormalFieldInput : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const override; std::string socket_inspection_name() const override; @@ -153,7 +153,7 @@ class AnonymousAttributeFieldInput : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - AttributeDomain domain, + eAttrDomain domain, IndexMask mask) const override; std::string socket_inspection_name() const override; @@ -166,7 +166,7 @@ class CurveLengthFieldInput final : public GeometryFieldInput { public: CurveLengthFieldInput(); GVArray get_varray_for_context(const GeometryComponent &component, - AttributeDomain domain, + eAttrDomain domain, IndexMask mask) const final; uint64_t hash() const override; bool is_equal_to(const fn::FieldNode &other) const override; diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh index c58420efceb..04e467b2ff1 100644 --- a/source/blender/blenkernel/BKE_geometry_set.hh +++ b/source/blender/blenkernel/BKE_geometry_set.hh @@ -94,11 +94,11 @@ class GeometryComponent { * \note Conceptually this function is static, the result is always the same for different * instances of the same geometry component type. */ - bool attribute_domain_supported(AttributeDomain domain) const; + bool attribute_domain_supported(eAttrDomain domain) const; /** * Return the length of a specific domain, or 0 if the domain is not supported. */ - virtual int attribute_domain_num(AttributeDomain domain) const; + virtual int attribute_domain_num(eAttrDomain domain) const; /** * Return true if the attribute name corresponds to a built-in attribute with a hardcoded domain @@ -130,16 +130,16 @@ class GeometryComponent { * \return null if the interpolation is not implemented. */ blender::GVArray attribute_try_adapt_domain(const blender::GVArray &varray, - const AttributeDomain from_domain, - const AttributeDomain to_domain) const + const eAttrDomain from_domain, + const eAttrDomain to_domain) const { return this->attribute_try_adapt_domain_impl(varray, from_domain, to_domain); } /* Use instead of the method above when the type is known at compile time for type safety. */ template blender::VArray attribute_try_adapt_domain(const blender::VArray &varray, - const AttributeDomain from_domain, - const AttributeDomain to_domain) const + const eAttrDomain from_domain, + const eAttrDomain to_domain) const { return this->attribute_try_adapt_domain_impl(varray, from_domain, to_domain) .template typed(); @@ -156,8 +156,8 @@ class GeometryComponent { /** Returns true when the attribute has been created. */ bool attribute_try_create(const blender::bke::AttributeIDRef &attribute_id, - AttributeDomain domain, - const CustomDataType data_type, + eAttrDomain domain, + const eCustomDataType data_type, const AttributeInit &initializer); /** @@ -182,8 +182,8 @@ class GeometryComponent { * interpolated or converted. */ blender::GVArray attribute_try_get_for_read(const blender::bke::AttributeIDRef &attribute_id, - AttributeDomain domain, - const CustomDataType data_type) const; + eAttrDomain domain, + const eCustomDataType data_type) const; /** * Get a virtual array that refers to the data of an attribute, interpolated to the given domain. @@ -191,7 +191,7 @@ class GeometryComponent { * interpolated. */ blender::GVArray attribute_try_get_for_read(const blender::bke::AttributeIDRef &attribute_id, - AttributeDomain domain) const; + eAttrDomain domain) const; /** * Get a virtual array that refers to the data of an attribute converted to the given data type. @@ -199,7 +199,7 @@ class GeometryComponent { * cannot be converted. */ blender::bke::ReadAttributeLookup attribute_try_get_for_read( - const blender::bke::AttributeIDRef &attribute_id, const CustomDataType data_type) const; + const blender::bke::AttributeIDRef &attribute_id, const eCustomDataType data_type) const; /** * Get a virtual array that refers to the data of an attribute, interpolated to the given domain @@ -207,17 +207,17 @@ class GeometryComponent { * contain a default value. This never returns null. */ blender::GVArray attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id, - AttributeDomain domain, - const CustomDataType data_type, + eAttrDomain domain, + const eCustomDataType data_type, const void *default_value = nullptr) const; /* Use instead of the method above when the type is known at compile time for type safety. */ template blender::VArray attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id, - const AttributeDomain domain, + const eAttrDomain domain, const T &default_value) const { const blender::CPPType &cpp_type = blender::CPPType::get(); - const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); + const eCustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); return this->attribute_get_for_read(attribute_id, domain, type, &default_value) .template typed(); } @@ -234,18 +234,18 @@ class GeometryComponent { */ blender::bke::OutputAttribute attribute_try_get_for_output( const blender::bke::AttributeIDRef &attribute_id, - AttributeDomain domain, - const CustomDataType data_type, + eAttrDomain domain, + const eCustomDataType data_type, const void *default_value = nullptr); /* Use instead of the method above when the type is known at compile time for type safety. */ template blender::bke::OutputAttribute_Typed attribute_try_get_for_output( const blender::bke::AttributeIDRef &attribute_id, - const AttributeDomain domain, + const eAttrDomain domain, const T default_value) { const blender::CPPType &cpp_type = blender::CPPType::get(); - const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); + const eCustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); return this->attribute_try_get_for_output(attribute_id, domain, data_type, &default_value); } @@ -257,15 +257,15 @@ class GeometryComponent { */ blender::bke::OutputAttribute attribute_try_get_for_output_only( const blender::bke::AttributeIDRef &attribute_id, - AttributeDomain domain, - const CustomDataType data_type); + eAttrDomain domain, + const eCustomDataType data_type); /* Use instead of the method above when the type is known at compile time for type safety. */ template blender::bke::OutputAttribute_Typed attribute_try_get_for_output_only( - const blender::bke::AttributeIDRef &attribute_id, const AttributeDomain domain) + const blender::bke::AttributeIDRef &attribute_id, const eAttrDomain domain) { const blender::CPPType &cpp_type = blender::CPPType::get(); - const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); + const eCustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); return this->attribute_try_get_for_output_only(attribute_id, domain, data_type); } @@ -273,8 +273,8 @@ class GeometryComponent { virtual const blender::bke::ComponentAttributeProviders *get_attribute_providers() const; virtual blender::GVArray attribute_try_adapt_domain_impl(const blender::GVArray &varray, - AttributeDomain from_domain, - AttributeDomain to_domain) const; + eAttrDomain from_domain, + eAttrDomain to_domain) const; }; template @@ -560,7 +560,7 @@ class MeshComponent : public GeometryComponent { */ Mesh *get_for_write(); - int attribute_domain_num(AttributeDomain domain) const final; + int attribute_domain_num(eAttrDomain domain) const final; bool is_empty() const final; @@ -573,8 +573,8 @@ class MeshComponent : public GeometryComponent { const blender::bke::ComponentAttributeProviders *get_attribute_providers() const final; blender::GVArray attribute_try_adapt_domain_impl(const blender::GVArray &varray, - AttributeDomain from_domain, - AttributeDomain to_domain) const final; + eAttrDomain from_domain, + eAttrDomain to_domain) const final; }; /** @@ -623,7 +623,7 @@ class PointCloudComponent : public GeometryComponent { */ PointCloud *get_for_write(); - int attribute_domain_num(AttributeDomain domain) const final; + int attribute_domain_num(eAttrDomain domain) const final; bool is_empty() const final; @@ -664,7 +664,7 @@ class CurveComponentLegacy : public GeometryComponent { const CurveEval *get_for_read() const; CurveEval *get_for_write(); - int attribute_domain_num(AttributeDomain domain) const final; + int attribute_domain_num(eAttrDomain domain) const final; bool is_empty() const final; @@ -677,8 +677,8 @@ class CurveComponentLegacy : public GeometryComponent { const blender::bke::ComponentAttributeProviders *get_attribute_providers() const final; blender::GVArray attribute_try_adapt_domain_impl(const blender::GVArray &varray, - AttributeDomain from_domain, - AttributeDomain to_domain) const final; + eAttrDomain from_domain, + eAttrDomain to_domain) const final; }; /** @@ -716,7 +716,7 @@ class CurveComponent : public GeometryComponent { const Curves *get_for_read() const; Curves *get_for_write(); - int attribute_domain_num(AttributeDomain domain) const final; + int attribute_domain_num(eAttrDomain domain) const final; bool is_empty() const final; @@ -735,8 +735,8 @@ class CurveComponent : public GeometryComponent { const blender::bke::ComponentAttributeProviders *get_attribute_providers() const final; blender::GVArray attribute_try_adapt_domain_impl(const blender::GVArray &varray, - AttributeDomain from_domain, - AttributeDomain to_domain) const final; + eAttrDomain from_domain, + eAttrDomain to_domain) const final; }; /** @@ -964,7 +964,7 @@ class InstancesComponent : public GeometryComponent { blender::bke::CustomDataAttributes &attributes(); const blender::bke::CustomDataAttributes &attributes() const; - int attribute_domain_num(AttributeDomain domain) const final; + int attribute_domain_num(eAttrDomain domain) const final; void foreach_referenced_geometry( blender::FunctionRef callback) const; diff --git a/source/blender/blenkernel/BKE_mesh_runtime.h b/source/blender/blenkernel/BKE_mesh_runtime.h index 0e78f9d7e15..dfefe125a51 100644 --- a/source/blender/blenkernel/BKE_mesh_runtime.h +++ b/source/blender/blenkernel/BKE_mesh_runtime.h @@ -8,7 +8,7 @@ * This file contains access functions for the Mesh.runtime struct. */ -//#include "BKE_customdata.h" /* for CustomDataMask */ +//#include "BKE_customdata.h" /* for eCustomDataMask */ #ifdef __cplusplus extern "C" { diff --git a/source/blender/blenkernel/BKE_mesh_sample.hh b/source/blender/blenkernel/BKE_mesh_sample.hh index a942f3bb7ed..37c2ad7d3cb 100644 --- a/source/blender/blenkernel/BKE_mesh_sample.hh +++ b/source/blender/blenkernel/BKE_mesh_sample.hh @@ -69,7 +69,7 @@ class MeshAttributeInterpolator { const Span looptri_indices); void sample_data(const GVArray &src, - AttributeDomain domain, + eAttrDomain domain, eAttributeMapMode mode, const GMutableSpan dst); diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index c39ab22ce3a..9e0ea5e13d5 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -501,8 +501,8 @@ typedef struct SculptSession { struct MPropCol *vcol; struct MLoopCol *mcol; - AttributeDomain vcol_domain; - CustomDataType vcol_type; + eAttrDomain vcol_domain; + eCustomDataType vcol_type; float *vmask; diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 291b9b6b778..7a89dee4148 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -549,7 +549,7 @@ PBVHColorBufferNode *BKE_pbvh_node_color_buffer_get(PBVHNode *node); void BKE_pbvh_node_color_buffer_free(PBVH *pbvh); bool BKE_pbvh_get_color_layer(const struct Mesh *me, CustomDataLayer **r_layer, - AttributeDomain *r_attr); + eAttrDomain *r_attr); /* Swaps colors at each element in indices (of domain pbvh->vcol_domain) * with values in colors. */ diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index 584035ddb85..fedcfc5c721 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -183,7 +183,7 @@ bool BKE_id_attribute_calc_unique_name(ID *id, const char *name, char *outname) } CustomDataLayer *BKE_id_attribute_new( - ID *id, const char *name, const int type, const AttributeDomain domain, ReportList *reports) + ID *id, const char *name, const int type, const eAttrDomain domain, ReportList *reports) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); @@ -264,7 +264,7 @@ bool BKE_id_attribute_remove(ID *id, CustomDataLayer *layer, ReportList *reports CustomDataLayer *BKE_id_attribute_find(const ID *id, const char *name, const int type, - const AttributeDomain domain) + const eAttrDomain domain) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); @@ -286,14 +286,14 @@ CustomDataLayer *BKE_id_attribute_find(const ID *id, CustomDataLayer *BKE_id_attribute_search(const ID *id, const char *name, - const CustomDataMask type_mask, - const AttributeDomainMask domain_mask) + const eCustomDataMask type_mask, + const eAttrDomainMask domain_mask) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); - for (AttributeDomain domain = ATTR_DOMAIN_POINT; domain < ATTR_DOMAIN_NUM; - domain = static_cast((static_cast(domain)) + 1)) { + for (eAttrDomain domain = ATTR_DOMAIN_POINT; domain < ATTR_DOMAIN_NUM; + domain = static_cast((static_cast(domain)) + 1)) { if (!(domain_mask & ATTR_DOMAIN_AS_MASK(domain))) { continue; } @@ -314,7 +314,7 @@ CustomDataLayer *BKE_id_attribute_search(const ID *id, return NULL; } -int BKE_id_attributes_length(const ID *id, AttributeDomainMask domain_mask, CustomDataMask mask) +int BKE_id_attributes_length(const ID *id, eAttrDomainMask domain_mask, eCustomDataMask mask) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); @@ -332,7 +332,7 @@ int BKE_id_attributes_length(const ID *id, AttributeDomainMask domain_mask, Cust return length; } -AttributeDomain BKE_id_attribute_domain(const ID *id, const CustomDataLayer *layer) +eAttrDomain BKE_id_attribute_domain(const ID *id, const CustomDataLayer *layer) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); @@ -341,12 +341,12 @@ AttributeDomain BKE_id_attribute_domain(const ID *id, const CustomDataLayer *lay CustomData *customdata = info[domain].customdata; if (customdata && ARRAY_HAS_ITEM((CustomDataLayer *)layer, customdata->layers, customdata->totlayer)) { - return static_cast(domain); + return static_cast(domain); } } BLI_assert_msg(0, "Custom data layer not found in geometry"); - return static_cast(ATTR_DOMAIN_POINT); + return static_cast(ATTR_DOMAIN_POINT); } int BKE_id_attribute_data_length(ID *id, CustomDataLayer *layer) @@ -489,8 +489,8 @@ CustomData *BKE_id_attributes_iterator_next_domain(ID *id, CustomDataLayer *laye CustomDataLayer *BKE_id_attribute_from_index(ID *id, int lookup_index, - AttributeDomainMask domain_mask, - CustomDataMask layer_mask) + eAttrDomainMask domain_mask, + eCustomDataMask layer_mask) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); @@ -523,27 +523,27 @@ CustomDataLayer *BKE_id_attribute_from_index(ID *id, /** Get list of domain types but with ATTR_DOMAIN_FACE and * ATTR_DOMAIN_CORNER swapped. */ -static void get_domains_types(AttributeDomain domains[ATTR_DOMAIN_NUM]) +static void get_domains_types(eAttrDomain domains[ATTR_DOMAIN_NUM]) { for (const int i : IndexRange(ATTR_DOMAIN_NUM)) { - domains[i] = static_cast(i); + domains[i] = static_cast(i); } /* Swap corner and face. */ - SWAP(AttributeDomain, domains[ATTR_DOMAIN_FACE], domains[ATTR_DOMAIN_CORNER]); + SWAP(eAttrDomain, domains[ATTR_DOMAIN_FACE], domains[ATTR_DOMAIN_CORNER]); } int BKE_id_attribute_to_index(const ID *id, const CustomDataLayer *layer, - AttributeDomainMask domain_mask, - CustomDataMask layer_mask) + eAttrDomainMask domain_mask, + eCustomDataMask layer_mask) { if (!layer) { return -1; } DomainInfo info[ATTR_DOMAIN_NUM]; - AttributeDomain domains[ATTR_DOMAIN_NUM]; + eAttrDomain domains[ATTR_DOMAIN_NUM]; get_domains_types(domains); get_domains(id, info); @@ -575,11 +575,11 @@ int BKE_id_attribute_to_index(const ID *id, CustomDataLayer *BKE_id_attribute_subset_active_get(const ID *id, int active_flag, - AttributeDomainMask domain_mask, - CustomDataMask mask) + eAttrDomainMask domain_mask, + eCustomDataMask mask) { DomainInfo info[ATTR_DOMAIN_NUM]; - AttributeDomain domains[ATTR_DOMAIN_NUM]; + eAttrDomain domains[ATTR_DOMAIN_NUM]; get_domains_types(domains); get_domains(id, info); @@ -613,17 +613,17 @@ CustomDataLayer *BKE_id_attribute_subset_active_get(const ID *id, void BKE_id_attribute_subset_active_set(ID *id, CustomDataLayer *layer, int active_flag, - AttributeDomainMask domain_mask, - CustomDataMask mask) + eAttrDomainMask domain_mask, + eCustomDataMask mask) { DomainInfo info[ATTR_DOMAIN_NUM]; - AttributeDomain domains[ATTR_DOMAIN_NUM]; + eAttrDomain domains[ATTR_DOMAIN_NUM]; get_domains_types(domains); get_domains(id, info); for (int i = 0; i < ATTR_DOMAIN_NUM; i++) { - AttributeDomainMask domain_mask2 = (AttributeDomainMask)(1 << domains[i]); + eAttrDomainMask domain_mask2 = (eAttrDomainMask)(1 << domains[i]); if (!(domain_mask2 & domain_mask) || !info[domains[i]].customdata) { continue; diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index e487bf4acf6..bc146d87e4c 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -63,7 +63,7 @@ bool allow_procedural_attribute_access(StringRef attribute_name) return !attribute_name.startswith(".selection"); } -static int attribute_data_type_complexity(const CustomDataType data_type) +static int attribute_data_type_complexity(const eCustomDataType data_type) { switch (data_type) { case CD_PROP_BOOL: @@ -93,12 +93,12 @@ static int attribute_data_type_complexity(const CustomDataType data_type) } } -CustomDataType attribute_data_type_highest_complexity(Span data_types) +eCustomDataType attribute_data_type_highest_complexity(Span data_types) { int highest_complexity = INT_MIN; - CustomDataType most_complex_type = CD_PROP_COLOR; + eCustomDataType most_complex_type = CD_PROP_COLOR; - for (const CustomDataType data_type : data_types) { + for (const eCustomDataType data_type : data_types) { const int complexity = attribute_data_type_complexity(data_type); if (complexity > highest_complexity) { highest_complexity = complexity; @@ -113,7 +113,7 @@ CustomDataType attribute_data_type_highest_complexity(Span data_ * \note Generally the order should mirror the order of the domains * established in each component's ComponentAttributeProviders. */ -static int attribute_domain_priority(const AttributeDomain domain) +static int attribute_domain_priority(const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_INSTANCE: @@ -135,12 +135,12 @@ static int attribute_domain_priority(const AttributeDomain domain) } } -AttributeDomain attribute_domain_highest_priority(Span domains) +eAttrDomain attribute_domain_highest_priority(Span domains) { int highest_priority = INT_MIN; - AttributeDomain highest_priority_domain = ATTR_DOMAIN_CORNER; + eAttrDomain highest_priority_domain = ATTR_DOMAIN_CORNER; - for (const AttributeDomain domain : domains) { + for (const eAttrDomain domain : domains) { const int priority = attribute_domain_priority(domain); if (priority > highest_priority) { highest_priority = priority; @@ -191,7 +191,7 @@ static AttributeIDRef attribute_id_from_custom_data_layer(const CustomDataLayer } static bool add_builtin_type_custom_data_layer_from_init(CustomData &custom_data, - const CustomDataType data_type, + const eCustomDataType data_type, const int domain_num, const AttributeInit &initializer) { @@ -226,7 +226,7 @@ static bool add_builtin_type_custom_data_layer_from_init(CustomData &custom_data } static void *add_generic_custom_data_layer(CustomData &custom_data, - const CustomDataType data_type, + const eCustomDataType data_type, const eCDAllocType alloctype, void *layer_data, const int domain_num, @@ -245,7 +245,7 @@ static void *add_generic_custom_data_layer(CustomData &custom_data, static bool add_custom_data_layer_from_attribute_init(const AttributeIDRef &attribute_id, CustomData &custom_data, - const CustomDataType data_type, + const eCustomDataType data_type, const int domain_num, const AttributeInit &initializer) { @@ -459,7 +459,7 @@ ReadAttributeLookup CustomDataAttributeProvider::try_get_for_read( if (!custom_data_layer_matches_attribute_id(layer, attribute_id)) { continue; } - const CPPType *type = custom_data_type_to_cpp_type((CustomDataType)layer.type); + const CPPType *type = custom_data_type_to_cpp_type((eCustomDataType)layer.type); if (type == nullptr) { continue; } @@ -488,7 +488,7 @@ WriteAttributeLookup CustomDataAttributeProvider::try_get_for_write( CustomData_duplicate_referenced_layer_anonymous( custom_data, layer.type, &attribute_id.anonymous_id(), domain_num); } - const CPPType *type = custom_data_type_to_cpp_type((CustomDataType)layer.type); + const CPPType *type = custom_data_type_to_cpp_type((eCustomDataType)layer.type); if (type == nullptr) { continue; } @@ -508,7 +508,7 @@ bool CustomDataAttributeProvider::try_delete(GeometryComponent &component, const int domain_num = component.attribute_domain_num(domain_); for (const int i : IndexRange(custom_data->totlayer)) { const CustomDataLayer &layer = custom_data->layers[i]; - if (this->type_is_supported((CustomDataType)layer.type) && + if (this->type_is_supported((eCustomDataType)layer.type) && custom_data_layer_matches_attribute_id(layer, attribute_id)) { CustomData_free_layer(custom_data, layer.type, domain_num, i); return true; @@ -519,8 +519,8 @@ bool CustomDataAttributeProvider::try_delete(GeometryComponent &component, bool CustomDataAttributeProvider::try_create(GeometryComponent &component, const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const AttributeInit &initializer) const { if (domain_ != domain) { @@ -552,7 +552,7 @@ bool CustomDataAttributeProvider::foreach_attribute(const GeometryComponent &com return true; } for (const CustomDataLayer &layer : Span(custom_data->layers, custom_data->totlayer)) { - const CustomDataType data_type = (CustomDataType)layer.type; + const eCustomDataType data_type = (eCustomDataType)layer.type; if (this->type_is_supported(data_type)) { AttributeMetaData meta_data{domain_, data_type}; const AttributeIDRef attribute_id = attribute_id_from_custom_data_layer(layer); @@ -650,7 +650,7 @@ bool NamedLegacyCustomDataProvider::foreach_attribute( } void NamedLegacyCustomDataProvider::foreach_domain( - const FunctionRef callback) const + const FunctionRef callback) const { callback(domain_); } @@ -693,7 +693,7 @@ std::optional CustomDataAttributes::get_for_read(const AttributeIDRef &at { for (const CustomDataLayer &layer : Span(data.layers, data.totlayer)) { if (custom_data_layer_matches_attribute_id(layer, attribute_id)) { - const CPPType *cpp_type = custom_data_type_to_cpp_type((CustomDataType)layer.type); + const CPPType *cpp_type = custom_data_type_to_cpp_type((eCustomDataType)layer.type); BLI_assert(cpp_type != nullptr); return GSpan(*cpp_type, layer.data, size_); } @@ -702,7 +702,7 @@ std::optional CustomDataAttributes::get_for_read(const AttributeIDRef &at } GVArray CustomDataAttributes::get_for_read(const AttributeIDRef &attribute_id, - const CustomDataType data_type, + const eCustomDataType data_type, const void *default_value) const { const CPPType *type = blender::bke::custom_data_type_to_cpp_type(data_type); @@ -726,7 +726,7 @@ std::optional CustomDataAttributes::get_for_write(const AttributeI { for (CustomDataLayer &layer : MutableSpan(data.layers, data.totlayer)) { if (custom_data_layer_matches_attribute_id(layer, attribute_id)) { - const CPPType *cpp_type = custom_data_type_to_cpp_type((CustomDataType)layer.type); + const CPPType *cpp_type = custom_data_type_to_cpp_type((eCustomDataType)layer.type); BLI_assert(cpp_type != nullptr); return GMutableSpan(*cpp_type, layer.data, size_); } @@ -735,7 +735,7 @@ std::optional CustomDataAttributes::get_for_write(const AttributeI } bool CustomDataAttributes::create(const AttributeIDRef &attribute_id, - const CustomDataType data_type) + const eCustomDataType data_type) { void *result = add_generic_custom_data_layer( data, data_type, CD_DEFAULT, nullptr, size_, attribute_id); @@ -743,7 +743,7 @@ bool CustomDataAttributes::create(const AttributeIDRef &attribute_id, } bool CustomDataAttributes::create_by_move(const AttributeIDRef &attribute_id, - const CustomDataType data_type, + const eCustomDataType data_type, void *buffer) { void *result = add_generic_custom_data_layer( @@ -776,10 +776,10 @@ void CustomDataAttributes::clear() } bool CustomDataAttributes::foreach_attribute(const AttributeForeachCallback callback, - const AttributeDomain domain) const + const eAttrDomain domain) const { for (const CustomDataLayer &layer : Span(data.layers, data.totlayer)) { - AttributeMetaData meta_data{domain, (CustomDataType)layer.type}; + AttributeMetaData meta_data{domain, (eCustomDataType)layer.type}; const AttributeIDRef attribute_id = attribute_id_from_custom_data_layer(layer); if (!callback(attribute_id, meta_data)) { return false; @@ -819,7 +819,7 @@ const blender::bke::ComponentAttributeProviders *GeometryComponent::get_attribut return nullptr; } -bool GeometryComponent::attribute_domain_supported(const AttributeDomain domain) const +bool GeometryComponent::attribute_domain_supported(const eAttrDomain domain) const { using namespace blender::bke; const ComponentAttributeProviders *providers = this->get_attribute_providers(); @@ -829,7 +829,7 @@ bool GeometryComponent::attribute_domain_supported(const AttributeDomain domain) return providers->supported_domains().contains(domain); } -int GeometryComponent::attribute_domain_num(const AttributeDomain UNUSED(domain)) const +int GeometryComponent::attribute_domain_num(const eAttrDomain UNUSED(domain)) const { return 0; } @@ -877,8 +877,8 @@ blender::bke::ReadAttributeLookup GeometryComponent::attribute_try_get_for_read( blender::GVArray GeometryComponent::attribute_try_adapt_domain_impl( const blender::GVArray &varray, - const AttributeDomain from_domain, - const AttributeDomain to_domain) const + const eAttrDomain from_domain, + const eAttrDomain to_domain) const { if (from_domain == to_domain) { return varray; @@ -949,8 +949,8 @@ void GeometryComponent::attributes_remove_anonymous() } bool GeometryComponent::attribute_try_create(const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const AttributeInit &initializer) { using namespace blender::bke; @@ -1087,8 +1087,8 @@ static blender::GVArray try_adapt_data_type(blender::GVArray varray, blender::GVArray GeometryComponent::attribute_try_get_for_read( const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type) const + const eAttrDomain domain, + const eCustomDataType data_type) const { blender::bke::ReadAttributeLookup attribute = this->attribute_try_get_for_read(attribute_id); if (!attribute) { @@ -1116,7 +1116,7 @@ blender::GVArray GeometryComponent::attribute_try_get_for_read( } blender::GVArray GeometryComponent::attribute_try_get_for_read(const AttributeIDRef &attribute_id, - const AttributeDomain domain) const + const eAttrDomain domain) const { if (!this->attribute_domain_supported(domain)) { return {}; @@ -1135,7 +1135,7 @@ blender::GVArray GeometryComponent::attribute_try_get_for_read(const AttributeID } blender::bke::ReadAttributeLookup GeometryComponent::attribute_try_get_for_read( - const AttributeIDRef &attribute_id, const CustomDataType data_type) const + const AttributeIDRef &attribute_id, const eCustomDataType data_type) const { blender::bke::ReadAttributeLookup attribute = this->attribute_try_get_for_read(attribute_id); if (!attribute) { @@ -1152,8 +1152,8 @@ blender::bke::ReadAttributeLookup GeometryComponent::attribute_try_get_for_read( } blender::GVArray GeometryComponent::attribute_get_for_read(const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const void *default_value) const { blender::GVArray varray = this->attribute_try_get_for_read(attribute_id, domain, data_type); @@ -1214,8 +1214,8 @@ static void save_output_attribute(OutputAttribute &output_attribute) else { attribute_id = varray.anonymous_attribute_id.extract(); } - const AttributeDomain domain = output_attribute.domain(); - const CustomDataType data_type = output_attribute.custom_data_type(); + const eAttrDomain domain = output_attribute.domain(); + const eCustomDataType data_type = output_attribute.custom_data_type(); const CPPType &cpp_type = output_attribute.cpp_type(); component.attribute_try_delete(attribute_id); @@ -1252,8 +1252,8 @@ static std::function get_simple_output_attribute_save_m static OutputAttribute create_output_attribute(GeometryComponent &component, const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const bool ignore_old_values, const void *default_value) { @@ -1358,17 +1358,15 @@ static OutputAttribute create_output_attribute(GeometryComponent &component, } OutputAttribute GeometryComponent::attribute_try_get_for_output(const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const void *default_value) { return create_output_attribute(*this, attribute_id, domain, data_type, false, default_value); } OutputAttribute GeometryComponent::attribute_try_get_for_output_only( - const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type) + const AttributeIDRef &attribute_id, const eAttrDomain domain, const eCustomDataType data_type) { return create_output_attribute(*this, attribute_id, domain, data_type, true, nullptr); } @@ -1382,17 +1380,17 @@ GVArray GeometryFieldInput::get_varray_for_context(const fn::FieldContext &conte if (const GeometryComponentFieldContext *geometry_context = dynamic_cast(&context)) { const GeometryComponent &component = geometry_context->geometry_component(); - const AttributeDomain domain = geometry_context->domain(); + const eAttrDomain domain = geometry_context->domain(); return this->get_varray_for_context(component, domain, mask); } return {}; } GVArray AttributeFieldInput::get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const { - const CustomDataType data_type = cpp_type_to_custom_data_type(*type_); + const eCustomDataType data_type = cpp_type_to_custom_data_type(*type_); return component.attribute_try_get_for_read(name_, domain, data_type); } @@ -1416,7 +1414,7 @@ bool AttributeFieldInput::is_equal_to(const fn::FieldNode &other) const return false; } -static StringRef get_random_id_attribute_name(const AttributeDomain domain) +static StringRef get_random_id_attribute_name(const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_POINT: @@ -1428,7 +1426,7 @@ static StringRef get_random_id_attribute_name(const AttributeDomain domain) } GVArray IDAttributeFieldInput::get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const { @@ -1461,10 +1459,10 @@ bool IDAttributeFieldInput::is_equal_to(const fn::FieldNode &other) const } GVArray AnonymousAttributeFieldInput::get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const { - const CustomDataType data_type = cpp_type_to_custom_data_type(*type_); + const eCustomDataType data_type = cpp_type_to_custom_data_type(*type_); return component.attribute_try_get_for_read(anonymous_id_.get(), domain, data_type); } diff --git a/source/blender/blenkernel/intern/attribute_access_intern.hh b/source/blender/blenkernel/intern/attribute_access_intern.hh index f0f47cb7a11..ac43754dd1a 100644 --- a/source/blender/blenkernel/intern/attribute_access_intern.hh +++ b/source/blender/blenkernel/intern/attribute_access_intern.hh @@ -47,16 +47,16 @@ class BuiltinAttributeProvider { protected: const std::string name_; - const AttributeDomain domain_; - const CustomDataType data_type_; + const eAttrDomain domain_; + const eCustomDataType data_type_; const CreatableEnum createable_; const WritableEnum writable_; const DeletableEnum deletable_; public: BuiltinAttributeProvider(std::string name, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const CreatableEnum createable, const WritableEnum writable, const DeletableEnum deletable) @@ -81,12 +81,12 @@ class BuiltinAttributeProvider { return name_; } - AttributeDomain domain() const + eAttrDomain domain() const { return domain_; } - CustomDataType data_type() const + eCustomDataType data_type() const { return data_type_; } @@ -106,8 +106,8 @@ class DynamicAttributesProvider { const AttributeIDRef &attribute_id) const = 0; virtual bool try_create(GeometryComponent &UNUSED(component), const AttributeIDRef &UNUSED(attribute_id), - const AttributeDomain UNUSED(domain), - const CustomDataType UNUSED(data_type), + const eAttrDomain UNUSED(domain), + const eCustomDataType UNUSED(data_type), const AttributeInit &UNUSED(initializer)) const { /* Some providers should not create new attributes. */ @@ -116,7 +116,7 @@ class DynamicAttributesProvider { virtual bool foreach_attribute(const GeometryComponent &component, const AttributeForeachCallback callback) const = 0; - virtual void foreach_domain(const FunctionRef callback) const = 0; + virtual void foreach_domain(const FunctionRef callback) const = 0; }; /** @@ -128,11 +128,11 @@ class CustomDataAttributeProvider final : public DynamicAttributesProvider { CD_MASK_PROP_FLOAT3 | CD_MASK_PROP_INT32 | CD_MASK_PROP_COLOR | CD_MASK_PROP_BOOL | CD_MASK_PROP_INT8 | CD_MASK_PROP_BYTE_COLOR; - const AttributeDomain domain_; + const eAttrDomain domain_; const CustomDataAccessInfo custom_data_access_; public: - CustomDataAttributeProvider(const AttributeDomain domain, + CustomDataAttributeProvider(const eAttrDomain domain, const CustomDataAccessInfo custom_data_access) : domain_(domain), custom_data_access_(custom_data_access) { @@ -148,20 +148,20 @@ class CustomDataAttributeProvider final : public DynamicAttributesProvider { bool try_create(GeometryComponent &component, const AttributeIDRef &attribute_id, - AttributeDomain domain, - const CustomDataType data_type, + eAttrDomain domain, + const eCustomDataType data_type, const AttributeInit &initializer) const final; bool foreach_attribute(const GeometryComponent &component, const AttributeForeachCallback callback) const final; - void foreach_domain(const FunctionRef callback) const final + void foreach_domain(const FunctionRef callback) const final { callback(domain_); } private: - bool type_is_supported(CustomDataType data_type) const + bool type_is_supported(eCustomDataType data_type) const { return ((1ULL << data_type) & supported_types_mask) != 0; } @@ -174,17 +174,17 @@ class NamedLegacyCustomDataProvider final : public DynamicAttributesProvider { private: using AsReadAttribute = GVArray (*)(const void *data, int domain_num); using AsWriteAttribute = GVMutableArray (*)(void *data, int domain_num); - const AttributeDomain domain_; - const CustomDataType attribute_type_; - const CustomDataType stored_type_; + const eAttrDomain domain_; + const eCustomDataType attribute_type_; + const eCustomDataType stored_type_; const CustomDataAccessInfo custom_data_access_; const AsReadAttribute as_read_attribute_; const AsWriteAttribute as_write_attribute_; public: - NamedLegacyCustomDataProvider(const AttributeDomain domain, - const CustomDataType attribute_type, - const CustomDataType stored_type, + NamedLegacyCustomDataProvider(const eAttrDomain domain, + const eCustomDataType attribute_type, + const eCustomDataType stored_type, const CustomDataAccessInfo custom_data_access, const AsReadAttribute as_read_attribute, const AsWriteAttribute as_write_attribute) @@ -204,7 +204,7 @@ class NamedLegacyCustomDataProvider final : public DynamicAttributesProvider { bool try_delete(GeometryComponent &component, const AttributeIDRef &attribute_id) const final; bool foreach_attribute(const GeometryComponent &component, const AttributeForeachCallback callback) const final; - void foreach_domain(const FunctionRef callback) const final; + void foreach_domain(const FunctionRef callback) const final; }; template GVArray make_array_read_attribute(const void *data, const int domain_num) @@ -230,7 +230,7 @@ class BuiltinCustomDataLayerProvider final : public BuiltinAttributeProvider { using AsWriteAttribute = GVMutableArray (*)(void *data, int domain_num); using UpdateOnRead = void (*)(const GeometryComponent &component); using UpdateOnWrite = void (*)(GeometryComponent &component); - const CustomDataType stored_type_; + const eCustomDataType stored_type_; const CustomDataAccessInfo custom_data_access_; const AsReadAttribute as_read_attribute_; const AsWriteAttribute as_write_attribute_; @@ -239,9 +239,9 @@ class BuiltinCustomDataLayerProvider final : public BuiltinAttributeProvider { public: BuiltinCustomDataLayerProvider(std::string attribute_name, - const AttributeDomain domain, - const CustomDataType attribute_type, - const CustomDataType stored_type, + const eAttrDomain domain, + const eCustomDataType attribute_type, + const eCustomDataType stored_type, const CreatableEnum creatable, const WritableEnum writable, const DeletableEnum deletable, @@ -288,7 +288,7 @@ class ComponentAttributeProviders { /** * All the domains that are supported by at least one of the providers above. */ - VectorSet supported_domains_; + VectorSet supported_domains_; public: ComponentAttributeProviders(Span builtin_attribute_providers, @@ -301,7 +301,7 @@ class ComponentAttributeProviders { supported_domains_.add(provider->domain()); } for (const DynamicAttributesProvider *provider : dynamic_attribute_providers) { - provider->foreach_domain([&](AttributeDomain domain) { supported_domains_.add(domain); }); + provider->foreach_domain([&](eAttrDomain domain) { supported_domains_.add(domain); }); } } @@ -315,7 +315,7 @@ class ComponentAttributeProviders { return dynamic_attribute_providers_; } - Span supported_domains() const + Span supported_domains() const { return supported_domains_; } diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc index 0cd324cfe2c..58380a1a35f 100644 --- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc +++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc @@ -315,8 +315,8 @@ static ResultOffsets calculate_result_offsets(const CurvesInfo &info, const bool return result; } -static AttributeDomain get_attribute_domain_for_mesh(const MeshComponent &mesh, - const AttributeIDRef &attribute_id) +static eAttrDomain get_attribute_domain_for_mesh(const MeshComponent &mesh, + const AttributeIDRef &attribute_id) { /* Only use a different domain if it is builtin and must only exist on one domain. */ if (!mesh.attribute_is_builtin(attribute_id)) { @@ -456,7 +456,7 @@ static void copy_main_point_data_to_mesh_faces(const Span src, static void copy_main_point_domain_attribute_to_mesh(const CurvesInfo &curves_info, const ResultOffsets &offsets, - const AttributeDomain dst_domain, + const eAttrDomain dst_domain, const GSpan src_all, GMutableSpan dst_all) { @@ -538,7 +538,7 @@ static void copy_profile_point_data_to_mesh_faces(const Span src, static void copy_profile_point_domain_attribute_to_mesh(const CurvesInfo &curves_info, const ResultOffsets &offsets, - const AttributeDomain dst_domain, + const eAttrDomain dst_domain, const GSpan src_all, GMutableSpan dst_all) { @@ -597,7 +597,7 @@ static void copy_indices_to_offset_ranges(const VArray &src, static void copy_curve_domain_attribute_to_mesh(const ResultOffsets &mesh_offsets, const Span curve_indices, - const AttributeDomain dst_domain, + const eAttrDomain dst_domain, const GVArray &src, GMutableSpan dst) { @@ -728,11 +728,11 @@ Mesh *curve_to_mesh_sweep(const CurvesGeometry &main, } main_attributes.add_new(id); - const AttributeDomain src_domain = meta_data.domain; - const CustomDataType type = meta_data.data_type; + const eAttrDomain src_domain = meta_data.domain; + const eCustomDataType type = meta_data.data_type; GVArray src = main_component.attribute_try_get_for_read(id, src_domain, type); - const AttributeDomain dst_domain = get_attribute_domain_for_mesh(mesh_component, id); + const eAttrDomain dst_domain = get_attribute_domain_for_mesh(mesh_component, id); OutputAttribute dst = mesh_component.attribute_try_get_for_output_only(id, dst_domain, type); if (!dst) { return true; @@ -763,11 +763,11 @@ Mesh *curve_to_mesh_sweep(const CurvesGeometry &main, if (!should_add_attribute_to_mesh(profile_component, mesh_component, id)) { return true; } - const AttributeDomain src_domain = meta_data.domain; - const CustomDataType type = meta_data.data_type; + const eAttrDomain src_domain = meta_data.domain; + const eCustomDataType type = meta_data.data_type; GVArray src = profile_component.attribute_try_get_for_read(id, src_domain, type); - const AttributeDomain dst_domain = get_attribute_domain_for_mesh(mesh_component, id); + const eAttrDomain dst_domain = get_attribute_domain_for_mesh(mesh_component, id); OutputAttribute dst = mesh_component.attribute_try_get_for_output_only(id, dst_domain, type); if (!dst) { return true; diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index 07e50eea88c..c2e67d853c9 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -160,30 +160,29 @@ CurvesGeometry::~CurvesGeometry() /** \name Accessors * \{ */ -static int domain_num(const CurvesGeometry &curves, const AttributeDomain domain) +static int domain_num(const CurvesGeometry &curves, const eAttrDomain domain) { return domain == ATTR_DOMAIN_POINT ? curves.points_num() : curves.curves_num(); } -static CustomData &domain_custom_data(CurvesGeometry &curves, const AttributeDomain domain) +static CustomData &domain_custom_data(CurvesGeometry &curves, const eAttrDomain domain) { return domain == ATTR_DOMAIN_POINT ? curves.point_data : curves.curve_data; } -static const CustomData &domain_custom_data(const CurvesGeometry &curves, - const AttributeDomain domain) +static const CustomData &domain_custom_data(const CurvesGeometry &curves, const eAttrDomain domain) { return domain == ATTR_DOMAIN_POINT ? curves.point_data : curves.curve_data; } template static VArray get_varray_attribute(const CurvesGeometry &curves, - const AttributeDomain domain, + const eAttrDomain domain, const StringRefNull name, const T default_value) { const int num = domain_num(curves, domain); - const CustomDataType type = cpp_type_to_custom_data_type(CPPType::get()); + const eCustomDataType type = cpp_type_to_custom_data_type(CPPType::get()); const CustomData &custom_data = domain_custom_data(curves, domain); const T *data = (const T *)CustomData_get_layer_named(&custom_data, type, name.c_str()); @@ -195,12 +194,12 @@ static VArray get_varray_attribute(const CurvesGeometry &curves, template static Span get_span_attribute(const CurvesGeometry &curves, - const AttributeDomain domain, + const eAttrDomain domain, const StringRefNull name) { const int num = domain_num(curves, domain); const CustomData &custom_data = domain_custom_data(curves, domain); - const CustomDataType type = cpp_type_to_custom_data_type(CPPType::get()); + const eCustomDataType type = cpp_type_to_custom_data_type(CPPType::get()); T *data = (T *)CustomData_get_layer_named(&custom_data, type, name.c_str()); if (data == nullptr) { @@ -211,12 +210,12 @@ static Span get_span_attribute(const CurvesGeometry &curves, template static MutableSpan get_mutable_attribute(CurvesGeometry &curves, - const AttributeDomain domain, + const eAttrDomain domain, const StringRefNull name, const T default_value = T()) { const int num = domain_num(curves, domain); - const CustomDataType type = cpp_type_to_custom_data_type(CPPType::get()); + const eCustomDataType type = cpp_type_to_custom_data_type(CPPType::get()); CustomData &custom_data = domain_custom_data(curves, domain); T *data = (T *)CustomData_duplicate_referenced_layer_named( @@ -1106,7 +1105,7 @@ void CurvesGeometry::update_customdata_pointers() static void *ensure_customdata_layer(CustomData &custom_data, const StringRefNull name, - const CustomDataType data_type, + const eCustomDataType data_type, const int tot_elements) { for (const int other_layer_i : IndexRange(custom_data.totlayer)) { @@ -1175,7 +1174,7 @@ static CurvesGeometry copy_with_removed_curves(const CurvesGeometry &curves, CustomData &new_point_data = new_curves.point_data; for (const int layer_i : IndexRange(old_point_data.totlayer)) { const CustomDataLayer &old_layer = old_point_data.layers[layer_i]; - const CustomDataType data_type = static_cast(old_layer.type); + const eCustomDataType data_type = static_cast(old_layer.type); const CPPType &type = *bke::custom_data_type_to_cpp_type(data_type); const void *src_buffer = old_layer.data; @@ -1202,7 +1201,7 @@ static CurvesGeometry copy_with_removed_curves(const CurvesGeometry &curves, CustomData &new_curve_data = new_curves.curve_data; for (const int layer_i : IndexRange(old_curve_data.totlayer)) { const CustomDataLayer &old_layer = old_curve_data.layers[layer_i]; - const CustomDataType data_type = static_cast(old_layer.type); + const eCustomDataType data_type = static_cast(old_layer.type); const CPPType &type = *bke::custom_data_type_to_cpp_type(data_type); const void *src_buffer = old_layer.data; @@ -1268,7 +1267,7 @@ static void reverse_swap_curve_point_data(const CurvesGeometry &curves, static bool layer_matches_name_and_type(const CustomDataLayer &layer, const StringRef name, - const CustomDataType type) + const eCustomDataType type) { if (layer.type != type) { return false; @@ -1311,7 +1310,7 @@ void CurvesGeometry::reverse_curves(const IndexMask curves_to_reverse) continue; } - const CustomDataType data_type = static_cast(layer.type); + const eCustomDataType data_type = static_cast(layer.type); attribute_math::convert_to_static_type(data_type, [&](auto dummy) { using T = decltype(dummy); reverse_curve_point_data( @@ -1430,8 +1429,8 @@ static GVArray adapt_curve_domain_curve_to_point(const CurvesGeometry &curves, } GVArray CurvesGeometry::adapt_domain(const GVArray &varray, - const AttributeDomain from, - const AttributeDomain to) const + const eAttrDomain from, + const eAttrDomain to) const { if (!varray) { return {}; diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index 058230745e7..a63528835ee 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -2239,7 +2239,7 @@ static bool customdata_typemap_is_valid(const CustomData *data) bool CustomData_merge(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, + eCustomDataMask mask, eCDAllocType alloctype, int totelem) { @@ -2341,7 +2341,7 @@ void CustomData_realloc(CustomData *data, int totelem) void CustomData_copy(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, + eCustomDataMask mask, eCDAllocType alloctype, int totelem) { @@ -2403,7 +2403,7 @@ void CustomData_free(CustomData *data, int totelem) CustomData_reset(data); } -void CustomData_free_typemask(struct CustomData *data, int totelem, CustomDataMask mask) +void CustomData_free_typemask(struct CustomData *data, int totelem, eCustomDataMask mask) { for (int i = 0; i < data->totlayer; i++) { CustomDataLayer *layer = &data->layers[i]; @@ -2934,7 +2934,7 @@ int CustomData_number_of_layers(const CustomData *data, int type) return number; } -int CustomData_number_of_layers_typemask(const CustomData *data, CustomDataMask mask) +int CustomData_number_of_layers_typemask(const CustomData *data, eCustomDataMask mask) { int number = 0; @@ -3077,7 +3077,7 @@ void CustomData_free_temporary(CustomData *data, int totelem) } } -void CustomData_set_only_copy(const struct CustomData *data, CustomDataMask mask) +void CustomData_set_only_copy(const struct CustomData *data, eCustomDataMask mask) { for (int i = 0; i < data->totlayer; i++) { if (!(mask & CD_TYPE_AS_MASK(data->layers[i].type))) { @@ -3692,7 +3692,7 @@ void CustomData_bmesh_init_pool(CustomData *data, int totelem, const char htype) bool CustomData_bmesh_merge(const CustomData *source, CustomData *dest, - CustomDataMask mask, + eCustomDataMask mask, eCDAllocType alloctype, BMesh *bm, const char htype) @@ -3841,7 +3841,7 @@ static void CustomData_bmesh_alloc_block(CustomData *data, void **block) void CustomData_bmesh_free_block_data_exclude_by_type(CustomData *data, void *block, - const CustomDataMask mask_exclude) + const eCustomDataMask mask_exclude) { if (block == nullptr) { return; @@ -3888,7 +3888,7 @@ void CustomData_bmesh_copy_data_exclude_by_type(const CustomData *source, CustomData *dest, void *src_block, void **dest_block, - const CustomDataMask mask_exclude) + const eCustomDataMask mask_exclude) { /* Note that having a version of this function without a 'mask_exclude' * would cause too much duplicate code, so add a check instead. */ @@ -4600,7 +4600,10 @@ static void customdata_external_filename(char filepath[FILE_MAX], BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(id)); } -void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask mask, int totelem) +void CustomData_external_reload(CustomData *data, + ID *UNUSED(id), + eCustomDataMask mask, + int totelem) { for (int i = 0; i < data->totlayer; i++) { CustomDataLayer *layer = &data->layers[i]; @@ -4618,7 +4621,7 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask } } -void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int totelem) +void CustomData_external_read(CustomData *data, ID *id, eCustomDataMask mask, int totelem) { CustomDataExternal *external = data->external; CustomDataLayer *layer; @@ -4692,7 +4695,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int } void CustomData_external_write( - CustomData *data, ID *id, CustomDataMask mask, int totelem, int free) + CustomData *data, ID *id, eCustomDataMask mask, int totelem, int free) { CustomDataExternal *external = data->external; int update = 0; @@ -5183,7 +5186,7 @@ void CustomData_blend_write(BlendWriter *writer, CustomData *data, Span layers_to_write, int count, - CustomDataMask cddata_mask, + eCustomDataMask cddata_mask, ID *id) { /* write external customdata (not for undo) */ @@ -5384,7 +5387,7 @@ namespace blender::bke { /** \name Custom Data C++ API * \{ */ -const blender::CPPType *custom_data_type_to_cpp_type(const CustomDataType type) +const blender::CPPType *custom_data_type_to_cpp_type(const eCustomDataType type) { switch (type) { case CD_PROP_FLOAT: @@ -5409,7 +5412,7 @@ const blender::CPPType *custom_data_type_to_cpp_type(const CustomDataType type) return nullptr; } -CustomDataType cpp_type_to_custom_data_type(const blender::CPPType &type) +eCustomDataType cpp_type_to_custom_data_type(const blender::CPPType &type) { if (type.is()) { return CD_PROP_FLOAT; @@ -5435,7 +5438,7 @@ CustomDataType cpp_type_to_custom_data_type(const blender::CPPType &type) if (type.is()) { return CD_PROP_BYTE_COLOR; } - return static_cast(-1); + return static_cast(-1); } /** \} */ diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index a28afc8ddca..898869c3c44 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -114,7 +114,7 @@ void CurveComponentLegacy::ensure_owns_direct_data() /** \name Attribute Access Helper Functions * \{ */ -int CurveComponentLegacy::attribute_domain_num(const AttributeDomain domain) const +int CurveComponentLegacy::attribute_domain_num(const eAttrDomain domain) const { if (curve_ == nullptr) { return 0; @@ -308,10 +308,9 @@ static GVArray adapt_curve_domain_spline_to_point(const CurveEval &curve, GVArra } // namespace blender::bke -GVArray CurveComponentLegacy::attribute_try_adapt_domain_impl( - const GVArray &varray, - const AttributeDomain from_domain, - const AttributeDomain to_domain) const +GVArray CurveComponentLegacy::attribute_try_adapt_domain_impl(const GVArray &varray, + const eAttrDomain from_domain, + const eAttrDomain to_domain) const { if (!varray) { return {}; @@ -366,7 +365,7 @@ class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { public: BuiltinSplineAttributeProvider(std::string attribute_name, - const CustomDataType attribute_type, + const eCustomDataType attribute_type, const WritableEnum writable, const AsReadAttribute as_read_attribute, const AsWriteAttribute as_write_attribute) @@ -577,7 +576,7 @@ static void point_attribute_materialize_to_uninitialized(Span> data, } static GVArray varray_from_initializer(const AttributeInit &initializer, - const CustomDataType data_type, + const eCustomDataType data_type, const Span splines) { switch (initializer.type) { @@ -604,7 +603,7 @@ static GVArray varray_from_initializer(const AttributeInit &initializer, static bool create_point_attribute(GeometryComponent &component, const AttributeIDRef &attribute_id, const AttributeInit &initializer, - const CustomDataType data_type) + const eCustomDataType data_type) { CurveEval *curve = get_curve_from_component_for_write(component); if (curve == nullptr || curve->splines().size() == 0) { @@ -1306,8 +1305,8 @@ class DynamicPointAttributeProvider final : public DynamicAttributesProvider { bool try_create(GeometryComponent &component, const AttributeIDRef &attribute_id, - const AttributeDomain domain, - const CustomDataType data_type, + const eAttrDomain domain, + const eCustomDataType data_type, const AttributeInit &initializer) const final { BLI_assert(this->type_is_supported(data_type)); @@ -1336,12 +1335,12 @@ class DynamicPointAttributeProvider final : public DynamicAttributesProvider { return true; } - void foreach_domain(const FunctionRef callback) const final + void foreach_domain(const FunctionRef callback) const final { callback(ATTR_DOMAIN_POINT); } - bool type_is_supported(CustomDataType data_type) const + bool type_is_supported(eCustomDataType data_type) const { return ((1ULL << data_type) & supported_types_mask) != 0; } diff --git a/source/blender/blenkernel/intern/geometry_component_curves.cc b/source/blender/blenkernel/intern/geometry_component_curves.cc index 9b023d12a7d..0003961c033 100644 --- a/source/blender/blenkernel/intern/geometry_component_curves.cc +++ b/source/blender/blenkernel/intern/geometry_component_curves.cc @@ -208,7 +208,7 @@ static Array curve_normal_point_domain(const bke::CurvesGeometry &curves return results; } -VArray curve_normals_varray(const CurveComponent &component, const AttributeDomain domain) +VArray curve_normals_varray(const CurveComponent &component, const eAttrDomain domain) { if (!component.has_curves()) { return {}; @@ -244,7 +244,7 @@ VArray curve_normals_varray(const CurveComponent &component, const Attri * \{ */ static VArray construct_curve_length_gvarray(const CurveComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { if (!component.has_curves()) { return {}; @@ -279,7 +279,7 @@ CurveLengthFieldInput::CurveLengthFieldInput() } GVArray CurveLengthFieldInput::get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const { if (component.type() == GEO_COMPONENT_TYPE_CURVE) { @@ -308,7 +308,7 @@ bool CurveLengthFieldInput::is_equal_to(const fn::FieldNode &other) const /** \name Attribute Access Helper Functions * \{ */ -int CurveComponent::attribute_domain_num(const AttributeDomain domain) const +int CurveComponent::attribute_domain_num(const eAttrDomain domain) const { if (curves_ == nullptr) { return 0; @@ -325,8 +325,8 @@ int CurveComponent::attribute_domain_num(const AttributeDomain domain) const } GVArray CurveComponent::attribute_try_adapt_domain_impl(const GVArray &varray, - const AttributeDomain from_domain, - const AttributeDomain to_domain) const + const eAttrDomain from_domain, + const eAttrDomain to_domain) const { return blender::bke::CurvesGeometry::wrap(curves_->geometry) .adapt_domain(varray, from_domain, to_domain); diff --git a/source/blender/blenkernel/intern/geometry_component_instances.cc b/source/blender/blenkernel/intern/geometry_component_instances.cc index e56a7ca4dd8..653be03b991 100644 --- a/source/blender/blenkernel/intern/geometry_component_instances.cc +++ b/source/blender/blenkernel/intern/geometry_component_instances.cc @@ -366,7 +366,7 @@ blender::Span InstancesComponent::almost_unique_ids() const return almost_unique_ids_; } -int InstancesComponent::attribute_domain_num(const AttributeDomain domain) const +int InstancesComponent::attribute_domain_num(const eAttrDomain domain) const { if (domain != ATTR_DOMAIN_INSTANCE) { return 0; diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index 5ac9a03f43c..8a021e596bd 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -119,7 +119,7 @@ namespace blender::bke { VArray mesh_normals_varray(const MeshComponent &mesh_component, const Mesh &mesh, const IndexMask mask, - const AttributeDomain domain) + const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_FACE: { @@ -169,7 +169,7 @@ VArray mesh_normals_varray(const MeshComponent &mesh_component, /** \name Attribute Access * \{ */ -int MeshComponent::attribute_domain_num(const AttributeDomain domain) const +int MeshComponent::attribute_domain_num(const eAttrDomain domain) const { if (mesh_ == nullptr) { return 0; @@ -747,10 +747,9 @@ static GVArray adapt_mesh_domain_edge_to_face(const Mesh &mesh, const GVArray &v } // namespace blender::bke -blender::GVArray MeshComponent::attribute_try_adapt_domain_impl( - const blender::GVArray &varray, - const AttributeDomain from_domain, - const AttributeDomain to_domain) const +blender::GVArray MeshComponent::attribute_try_adapt_domain_impl(const blender::GVArray &varray, + const eAttrDomain from_domain, + const eAttrDomain to_domain) const { if (!varray) { return {}; @@ -1115,7 +1114,7 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider { return true; } - void foreach_domain(const FunctionRef callback) const final + void foreach_domain(const FunctionRef callback) const final { callback(ATTR_DOMAIN_POINT); } diff --git a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc index 6de123c7cb9..facdbed265d 100644 --- a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc +++ b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc @@ -104,7 +104,7 @@ void PointCloudComponent::ensure_owns_direct_data() /** \name Attribute Access * \{ */ -int PointCloudComponent::attribute_domain_num(const AttributeDomain domain) const +int PointCloudComponent::attribute_domain_num(const eAttrDomain domain) const { if (pointcloud_ == nullptr) { return 0; diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc index 40e36ced199..10226bc6990 100644 --- a/source/blender/blenkernel/intern/geometry_set.cc +++ b/source/blender/blenkernel/intern/geometry_set.cc @@ -470,7 +470,7 @@ void GeometrySet::gather_attributes_for_propagation( return; } - AttributeDomain domain = meta_data.domain; + eAttrDomain domain = meta_data.domain; if (dst_component_type != GEO_COMPONENT_TYPE_INSTANCES && domain == ATTR_DOMAIN_INSTANCE) { domain = ATTR_DOMAIN_POINT; } @@ -567,7 +567,7 @@ void GeometrySet::modify_geometry_sets(ForeachSubGeometryCallback callback) namespace blender::bke { GVArray NormalFieldInput::get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const { if (component.type() == GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc index c960a7f35f1..85aed01ce52 100644 --- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc +++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc @@ -375,7 +375,7 @@ void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source) while ((layer = BKE_id_attribute_from_index( const_cast(&source->id), i++, ATTR_DOMAIN_MASK_COLOR, CD_MASK_COLOR_ALL))) { - AttributeDomain domain = BKE_id_attribute_domain(&source->id, layer); + eAttrDomain domain = BKE_id_attribute_domain(&source->id, layer); CustomData *target_cdata = domain == ATTR_DOMAIN_POINT ? &target->vdata : &target->ldata; const CustomData *source_cdata = domain == ATTR_DOMAIN_POINT ? &source->vdata : &source->ldata; diff --git a/source/blender/blenkernel/intern/mesh_sample.cc b/source/blender/blenkernel/intern/mesh_sample.cc index 33b051c792c..7595c08a208 100644 --- a/source/blender/blenkernel/intern/mesh_sample.cc +++ b/source/blender/blenkernel/intern/mesh_sample.cc @@ -204,7 +204,7 @@ Span MeshAttributeInterpolator::ensure_nearest_weights() } void MeshAttributeInterpolator::sample_data(const GVArray &src, - const AttributeDomain domain, + const eAttrDomain domain, const eAttributeMapMode mode, const GMutableSpan dst) { diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc index d16f7eaf588..9b2697ecc84 100644 --- a/source/blender/blenkernel/intern/mesh_validate.cc +++ b/source/blender/blenkernel/intern/mesh_validate.cc @@ -926,7 +926,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh, } static bool mesh_validate_customdata(CustomData *data, - CustomDataMask mask, + eCustomDataMask mask, const uint totitems, const bool do_verbose, const bool do_fixes, @@ -953,7 +953,7 @@ static bool mesh_validate_customdata(CustomData *data, } if (mask != 0) { - CustomDataMask layer_typemask = CD_TYPE_AS_MASK(layer->type); + eCustomDataMask layer_typemask = CD_TYPE_AS_MASK(layer->type); if ((layer_typemask & mask) == 0) { PRINT_ERR("\tCustomDataLayer type %d which isn't in the mask\n", layer->type); ok = false; diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index cff7eb20b05..bb499f24c07 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1674,7 +1674,7 @@ static void sculpt_update_object(Depsgraph *depsgraph, ss->vmask = CustomData_get_layer(&me->vdata, CD_PAINT_MASK); CustomDataLayer *layer; - AttributeDomain domain; + eAttrDomain domain; if (BKE_pbvh_get_color_layer(me, &layer, &domain)) { if (layer->type == CD_PROP_COLOR) { diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 1d4fbb92fa0..2b049222073 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1264,7 +1264,7 @@ static int pbvh_get_buffers_update_flags(PBVH *UNUSED(pbvh)) return update_flags; } -bool BKE_pbvh_get_color_layer(const Mesh *me, CustomDataLayer **r_layer, AttributeDomain *r_attr) +bool BKE_pbvh_get_color_layer(const Mesh *me, CustomDataLayer **r_layer, eAttrDomain *r_attr) { CustomDataLayer *layer = BKE_id_attributes_active_color_get((ID *)me); @@ -1274,7 +1274,7 @@ bool BKE_pbvh_get_color_layer(const Mesh *me, CustomDataLayer **r_layer, Attribu return false; } - AttributeDomain domain = BKE_id_attribute_domain((ID *)me, layer); + eAttrDomain domain = BKE_id_attribute_domain((ID *)me, layer); if (!ELEM(domain, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CORNER)) { *r_layer = NULL; @@ -1340,7 +1340,7 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata, break; case PBVH_FACES: { CustomDataLayer *layer = NULL; - AttributeDomain domain; + eAttrDomain domain; BKE_pbvh_get_color_layer(pbvh->mesh, &layer, &domain); diff --git a/source/blender/blenkernel/intern/pbvh.cc b/source/blender/blenkernel/intern/pbvh.cc index be6e95426c2..dec93826b9b 100644 --- a/source/blender/blenkernel/intern/pbvh.cc +++ b/source/blender/blenkernel/intern/pbvh.cc @@ -44,7 +44,7 @@ using blender::IndexRange; namespace blender::bke { template -inline void to_static_color_type(const CustomDataType type, const Func &func) +inline void to_static_color_type(const eCustomDataType type, const Func &func) { switch (type) { case CD_PROP_COLOR: @@ -146,7 +146,7 @@ static void pbvh_vertex_color_set(PBVH &pbvh, int vertex, const float color[4]) extern "C" { void BKE_pbvh_vertex_color_get(const PBVH *pbvh, int vertex, float r_color[4]) { - blender::bke::to_static_color_type(CustomDataType(pbvh->color_layer->type), [&](auto dummy) { + blender::bke::to_static_color_type(eCustomDataType(pbvh->color_layer->type), [&](auto dummy) { using T = decltype(dummy); blender::bke::pbvh_vertex_color_get(*pbvh, vertex, r_color); }); @@ -154,7 +154,7 @@ void BKE_pbvh_vertex_color_get(const PBVH *pbvh, int vertex, float r_color[4]) void BKE_pbvh_vertex_color_set(PBVH *pbvh, int vertex, const float color[4]) { - blender::bke::to_static_color_type(CustomDataType(pbvh->color_layer->type), [&](auto dummy) { + blender::bke::to_static_color_type(eCustomDataType(pbvh->color_layer->type), [&](auto dummy) { using T = decltype(dummy); blender::bke::pbvh_vertex_color_set(*pbvh, vertex, color); }); @@ -165,7 +165,7 @@ void BKE_pbvh_swap_colors(PBVH *pbvh, const int indices_num, float (*r_colors)[4]) { - blender::bke::to_static_color_type(CustomDataType(pbvh->color_layer->type), [&](auto dummy) { + blender::bke::to_static_color_type(eCustomDataType(pbvh->color_layer->type), [&](auto dummy) { using T = decltype(dummy); T *pbvh_colors = static_cast(pbvh->color_layer->data); for (const int i : IndexRange(indices_num)) { @@ -181,7 +181,7 @@ void BKE_pbvh_store_colors(PBVH *pbvh, const int indices_num, float (*r_colors)[4]) { - blender::bke::to_static_color_type(CustomDataType(pbvh->color_layer->type), [&](auto dummy) { + blender::bke::to_static_color_type(eCustomDataType(pbvh->color_layer->type), [&](auto dummy) { using T = decltype(dummy); T *pbvh_colors = static_cast(pbvh->color_layer->data); for (const int i : IndexRange(indices_num)) { @@ -199,7 +199,7 @@ void BKE_pbvh_store_colors_vertex(PBVH *pbvh, BKE_pbvh_store_colors(pbvh, indices, indices_num, r_colors); } else { - blender::bke::to_static_color_type(CustomDataType(pbvh->color_layer->type), [&](auto dummy) { + blender::bke::to_static_color_type(eCustomDataType(pbvh->color_layer->type), [&](auto dummy) { using T = decltype(dummy); for (const int i : IndexRange(indices_num)) { blender::bke::pbvh_vertex_color_get(*pbvh, indices[i], r_colors[i]); diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h index a86663a9c74..98b490b28dd 100644 --- a/source/blender/blenkernel/intern/pbvh_intern.h +++ b/source/blender/blenkernel/intern/pbvh_intern.h @@ -198,7 +198,7 @@ struct PBVH { const struct MeshElemMap *pmap; CustomDataLayer *color_layer; - AttributeDomain color_domain; + eAttrDomain color_domain; bool is_drawing; diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index ff8506f1868..a7637d2712c 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -60,8 +60,11 @@ void BM_edges_from_verts_ensure(BMesh *bm, BMEdge **edge_arr, BMVert **vert_arr, } /* prototypes */ -static void bm_loop_attrs_copy( - BMesh *bm_src, BMesh *bm_dst, const BMLoop *l_src, BMLoop *l_dst, CustomDataMask mask_exclude); +static void bm_loop_attrs_copy(BMesh *bm_src, + BMesh *bm_dst, + const BMLoop *l_src, + BMLoop *l_dst, + eCustomDataMask mask_exclude); BMFace *BM_face_create_quad_tri(BMesh *bm, BMVert *v1, @@ -321,7 +324,7 @@ void BM_verts_sort_radial_plane(BMVert **vert_arr, int len) /*************************************************************/ static void bm_vert_attrs_copy( - BMesh *bm_src, BMesh *bm_dst, const BMVert *v_src, BMVert *v_dst, CustomDataMask mask_exclude) + BMesh *bm_src, BMesh *bm_dst, const BMVert *v_src, BMVert *v_dst, eCustomDataMask mask_exclude) { if ((bm_src == bm_dst) && (v_src == v_dst)) { BLI_assert_msg(0, "BMVert: source and target match"); @@ -336,7 +339,7 @@ static void bm_vert_attrs_copy( } static void bm_edge_attrs_copy( - BMesh *bm_src, BMesh *bm_dst, const BMEdge *e_src, BMEdge *e_dst, CustomDataMask mask_exclude) + BMesh *bm_src, BMesh *bm_dst, const BMEdge *e_src, BMEdge *e_dst, eCustomDataMask mask_exclude) { if ((bm_src == bm_dst) && (e_src == e_dst)) { BLI_assert_msg(0, "BMEdge: source and target match"); @@ -348,7 +351,7 @@ static void bm_edge_attrs_copy( } static void bm_loop_attrs_copy( - BMesh *bm_src, BMesh *bm_dst, const BMLoop *l_src, BMLoop *l_dst, CustomDataMask mask_exclude) + BMesh *bm_src, BMesh *bm_dst, const BMLoop *l_src, BMLoop *l_dst, eCustomDataMask mask_exclude) { if ((bm_src == bm_dst) && (l_src == l_dst)) { BLI_assert_msg(0, "BMLoop: source and target match"); @@ -360,7 +363,7 @@ static void bm_loop_attrs_copy( } static void bm_face_attrs_copy( - BMesh *bm_src, BMesh *bm_dst, const BMFace *f_src, BMFace *f_dst, CustomDataMask mask_exclude) + BMesh *bm_src, BMesh *bm_dst, const BMFace *f_src, BMFace *f_dst, eCustomDataMask mask_exclude) { if ((bm_src == bm_dst) && (f_src == f_dst)) { BLI_assert_msg(0, "BMFace: source and target match"); diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c index aa7f0f511ec..1339efb3057 100644 --- a/source/blender/bmesh/operators/bmo_join_triangles.c +++ b/source/blender/bmesh/operators/bmo_join_triangles.c @@ -145,7 +145,7 @@ static bool bm_edge_is_contiguous_loop_cd_all(const BMEdge *e, } static bool bm_edge_delimit_cdata(CustomData *ldata, - CustomDataType type, + eCustomDataType type, struct DelimitData_CD *r_delim_cd) { const int layer_len = CustomData_number_of_layers(ldata, type); diff --git a/source/blender/draw/intern/draw_attributes.cc b/source/blender/draw/intern/draw_attributes.cc index 714f1dbb3d1..f84a6c86fac 100644 --- a/source/blender/draw/intern/draw_attributes.cc +++ b/source/blender/draw/intern/draw_attributes.cc @@ -65,9 +65,9 @@ bool drw_attributes_overlap(const DRW_Attributes *a, const DRW_Attributes *b) } DRW_AttributeRequest *drw_attributes_add_request(DRW_Attributes *attrs, - CustomDataType type, + eCustomDataType type, int layer, - AttributeDomain domain) + eAttrDomain domain) { if (attrs->num_requests >= GPU_MAX_ATTR) { return nullptr; diff --git a/source/blender/draw/intern/draw_attributes.h b/source/blender/draw/intern/draw_attributes.h index 192ffa43337..c375670cd70 100644 --- a/source/blender/draw/intern/draw_attributes.h +++ b/source/blender/draw/intern/draw_attributes.h @@ -25,9 +25,9 @@ extern "C" { #endif typedef struct DRW_AttributeRequest { - CustomDataType cd_type; + eCustomDataType cd_type; int layer_index; - AttributeDomain domain; + eAttrDomain domain; char attribute_name[64]; } DRW_AttributeRequest; @@ -46,9 +46,9 @@ void drw_attributes_merge(DRW_Attributes *dst, bool drw_attributes_overlap(const DRW_Attributes *a, const DRW_Attributes *b); DRW_AttributeRequest *drw_attributes_add_request(DRW_Attributes *attrs, - CustomDataType type, + eCustomDataType type, int layer, - AttributeDomain domain); + eAttrDomain domain); bool drw_custom_data_match_attribute(const CustomData *custom_data, const char *name, diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc index f9cf0021fcd..68f210105b0 100644 --- a/source/blender/draw/intern/draw_cache_impl_curves.cc +++ b/source/blender/draw/intern/draw_cache_impl_curves.cc @@ -514,7 +514,7 @@ static bool curves_ensure_attributes(const Curves &curves, const char *name = gpu_attr->name; int type = gpu_attr->type; int layer = -1; - AttributeDomain domain; + eAttrDomain domain; if (drw_custom_data_match_attribute(cd_curve, name, &layer, &type)) { domain = ATTR_DOMAIN_CURVE; @@ -538,7 +538,7 @@ static bool curves_ensure_attributes(const Curves &curves, case CD_PROP_COLOR: { if (layer != -1) { DRW_AttributeRequest *req = drw_attributes_add_request( - &attrs_needed, (CustomDataType)type, layer, domain); + &attrs_needed, (eCustomDataType)type, layer, domain); if (req) { BLI_strncpy(req->attribute_name, name, sizeof(req->attribute_name)); } diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index a6ab2176d16..a7fd484c72f 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -396,7 +396,7 @@ static uint mesh_cd_calc_gpu_layers_vcol_used(const Mesh *me_query, const char name[]) { CustomDataLayer *layer = NULL; - AttributeDomain domain; + eAttrDomain domain; if (name[0]) { int layer_i = 0; @@ -469,7 +469,7 @@ static DRW_MeshCDMask mesh_cd_calc_used_gpu_layers(const Object *object, int type = gpu_attr->type; int layer = -1; /* ATTR_DOMAIN_NUM is standard for "invalid value". */ - AttributeDomain domain = ATTR_DOMAIN_NUM; + eAttrDomain domain = ATTR_DOMAIN_NUM; if (type == CD_AUTO_FROM_NAME) { /* We need to deduce what exact layer is used. diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc index d595abc6dd3..fa41facb751 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc @@ -24,7 +24,7 @@ namespace blender::draw { /** \name Extract Attributes * \{ */ -static CustomData *get_custom_data_for_domain(const MeshRenderData *mr, AttributeDomain domain) +static CustomData *get_custom_data_for_domain(const MeshRenderData *mr, eAttrDomain domain) { switch (domain) { default: { @@ -80,7 +80,7 @@ template<> struct attribute_type_converter { }; /* Return the number of component for the attribute's value type, or 0 if is it unsupported. */ -static uint gpu_component_size_for_attribute_type(CustomDataType type) +static uint gpu_component_size_for_attribute_type(eCustomDataType type) { switch (type) { case CD_PROP_BOOL: @@ -106,7 +106,7 @@ static uint gpu_component_size_for_attribute_type(CustomDataType type) } } -static GPUVertFetchMode get_fetch_mode_for_type(CustomDataType type) +static GPUVertFetchMode get_fetch_mode_for_type(eCustomDataType type) { switch (type) { case CD_PROP_INT32: { @@ -121,7 +121,7 @@ static GPUVertFetchMode get_fetch_mode_for_type(CustomDataType type) } } -static GPUVertCompType get_comp_type_for_type(CustomDataType type) +static GPUVertCompType get_comp_type_for_type(eCustomDataType type) { switch (type) { case CD_PROP_INT32: { diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc index 717d81d6b52..91ac3f22617 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_vcol.cc @@ -16,7 +16,7 @@ struct VColRef { const CustomDataLayer *layer; - AttributeDomain domain; + eAttrDomain domain; }; /** Get all vcol layers as AttributeRefs. @@ -32,7 +32,7 @@ static blender::Vector get_vcol_refs(const CustomData *cd_vdata, blender::Vector refs; uint layeri = 0; - auto buildList = [&](const CustomData *cdata, AttributeDomain domain) { + auto buildList = [&](const CustomData *cdata, eAttrDomain domain) { for (int i = 0; i < cdata->totlayer; i++) { const CustomDataLayer *layer = cdata->layers + i; 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( - RNA_enum_get(op->ptr, "domain")); - const CustomDataType dst_type = static_cast( + const eAttrDomain dst_domain = static_cast(RNA_enum_get(op->ptr, "domain")); + const eCustomDataType dst_type = static_cast( 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 get_curves_selection(const CurvesGeometry &curves, - const AttributeDomain domain) +static VArray get_curves_selection(const CurvesGeometry &curves, const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_CURVE: @@ -29,11 +28,10 @@ VArray get_curves_selection(const Curves &curves_id) return VArray::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 get_point_selection(const CurvesGeometry &curves, - const AttributeDomain domain) +static VArray get_point_selection(const CurvesGeometry &curves, const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_CURVE: @@ -53,11 +51,11 @@ VArray get_point_selection(const Curves &curves_id) return VArray::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 &r_indices) { switch (domain) { @@ -100,7 +98,7 @@ IndexMask retrieve_selected_curves(const Curves &curves_id, Vector &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 +template 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 +template struct VPaintData : public VPaintDataBase { NormalAnglePrecalc normal_angle_precalc; @@ -2855,7 +2855,7 @@ struct VPaintData : public VPaintDataBase { } smear; }; -template +template 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 +template 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 +template static void calculate_average_color(VPaintData *vpd, Object *ob, Mesh *me, @@ -3541,7 +3541,7 @@ static void calculate_average_color(VPaintData *vpd, } } -template +template static float paint_and_tex_color_alpha(VPaint *vp, VPaintData *vpd, const float v_co[3], @@ -3559,7 +3559,7 @@ static float paint_and_tex_color_alpha(VPaint *vp, return rgba[3]; } -template +template static void vpaint_do_draw(bContext *C, Sculpt *UNUSED(sd), VPaint *vp, @@ -3699,7 +3699,7 @@ static void vpaint_do_draw(bContext *C, }); } -template +template static void vpaint_do_blur(bContext *C, Sculpt *sd, VPaint *vp, @@ -3718,7 +3718,7 @@ static void vpaint_do_blur(bContext *C, } } -template +template static void vpaint_paint_leaves(bContext *C, Sculpt *sd, VPaint *vp, @@ -3754,7 +3754,7 @@ static void vpaint_paint_leaves(bContext *C, } } -template +template static void vpaint_do_paint(bContext *C, Sculpt *sd, VPaint *vp, @@ -3785,7 +3785,7 @@ static void vpaint_do_paint(bContext *C, } } -template +template 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 +template static void vpaint_do_symmetrical_brush_actions( bContext *C, Sculpt *sd, VPaint *vp, VPaintData *vpd, Object *ob) { @@ -3851,7 +3851,7 @@ static void vpaint_do_symmetrical_brush_actions( cache->is_last_valid = true; } -template +template 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 +template static void vpaint_free_vpaintdata(Object *UNUSED(ob), void *_vpd) { VPaintData *vpd = static_cast *>(_vpd); @@ -4096,7 +4096,7 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot) /** \name Set Vertex Colors Operator * \{ */ -template +template 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 usage_by_attribute; + Map 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 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 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 &usage_by_attribute_name) + const Map &usage_by_attribute_name) { const int attributes_num = usage_by_attribute_name.size(); @@ -1777,7 +1777,7 @@ static std::optional node_get_accessed_attributes_row(const Sp return std::nullopt; } - Map usage_by_attribute; + Map 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 node_get_accessed_attributes_row(const Sp if (node_log == nullptr) { return std::nullopt; } - Map usage_by_attribute; + Map 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, GArray<>> arrays; + Map, 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( std::make_unique(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 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 domain_; + std::optional 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( RNA_int_get(op->ptr, "component_type")); - AttributeDomain attribute_domain = static_cast( + eAttrDomain attribute_domain = static_cast( RNA_int_get(op->ptr, "attribute_domain_type")); SpaceSpreadsheet *sspreadsheet = CTX_wm_space_spreadsheet(C); diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc index ae07e817c67..4db4256ec8f 100644 --- a/source/blender/geometry/intern/realize_instances.cc +++ b/source/blender/geometry/intern/realize_instances.cc @@ -279,12 +279,12 @@ static void copy_generic_attributes_to_result( const Span> src_attributes, const AttributeFallbacksArray &attribute_fallbacks, const OrderedAttributes &ordered_attributes, - const FunctionRef &range_fn, + const FunctionRef &range_fn, MutableSpan dst_attributes) { threading::parallel_for(dst_attributes.index_range(), 10, [&](const IndexRange attribute_range) { for (const int attribute_index : attribute_range) { - const AttributeDomain domain = ordered_attributes.kinds[attribute_index].domain; + const eAttrDomain domain = ordered_attributes.kinds[attribute_index].domain; const IndexRange element_slice = range_fn(domain); GMutableSpan dst_span = dst_attributes[attribute_index].slice(element_slice); @@ -363,7 +363,7 @@ static Vector> prepare_attribute_fallbacks( return true; } GSpan span = *attributes.get_for_read(attribute_id); - const CustomDataType expected_type = ordered_attributes.kinds[attribute_index].data_type; + const eCustomDataType expected_type = ordered_attributes.kinds[attribute_index].data_type; if (meta_data.data_type != expected_type) { const CPPType &from_type = span.type(); const CPPType &to_type = *custom_data_type_to_cpp_type(expected_type); @@ -644,8 +644,8 @@ static AllPointCloudsInfo preprocess_pointclouds(const GeometrySet &geometry_set pointcloud_info.attributes.reinitialize(info.attributes.size()); for (const int attribute_index : info.attributes.index_range()) { const AttributeIDRef &attribute_id = info.attributes.ids[attribute_index]; - const CustomDataType data_type = info.attributes.kinds[attribute_index].data_type; - const AttributeDomain domain = info.attributes.kinds[attribute_index].domain; + const eCustomDataType data_type = info.attributes.kinds[attribute_index].data_type; + const eAttrDomain domain = info.attributes.kinds[attribute_index].domain; if (component.attribute_exists(attribute_id)) { GVArray attribute = component.attribute_get_for_read(attribute_id, domain, data_type); pointcloud_info.attributes[attribute_index].emplace(std::move(attribute)); @@ -687,7 +687,7 @@ static void execute_realize_pointcloud_task(const RealizeInstancesOptions &optio pointcloud_info.attributes, task.attribute_fallbacks, ordered_attributes, - [&](const AttributeDomain domain) { + [&](const eAttrDomain domain) { BLI_assert(domain == ATTR_DOMAIN_POINT); UNUSED_VARS_NDEBUG(domain); return point_slice; @@ -728,7 +728,7 @@ static void execute_realize_pointcloud_tasks(const RealizeInstancesOptions &opti Vector dst_attribute_spans; for (const int attribute_index : ordered_attributes.index_range()) { const AttributeIDRef &attribute_id = ordered_attributes.ids[attribute_index]; - const CustomDataType data_type = ordered_attributes.kinds[attribute_index].data_type; + const eCustomDataType data_type = ordered_attributes.kinds[attribute_index].data_type; OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, ATTR_DOMAIN_POINT, data_type); dst_attribute_spans.append(dst_attribute.as_span()); @@ -835,8 +835,8 @@ static AllMeshesInfo preprocess_meshes(const GeometrySet &geometry_set, mesh_info.attributes.reinitialize(info.attributes.size()); for (const int attribute_index : info.attributes.index_range()) { const AttributeIDRef &attribute_id = info.attributes.ids[attribute_index]; - const CustomDataType data_type = info.attributes.kinds[attribute_index].data_type; - const AttributeDomain domain = info.attributes.kinds[attribute_index].domain; + const eCustomDataType data_type = info.attributes.kinds[attribute_index].data_type; + const eAttrDomain domain = info.attributes.kinds[attribute_index].domain; if (component.attribute_exists(attribute_id)) { GVArray attribute = component.attribute_get_for_read(attribute_id, domain, data_type); mesh_info.attributes[attribute_index].emplace(std::move(attribute)); @@ -927,7 +927,7 @@ static void execute_realize_mesh_task(const RealizeInstancesOptions &options, mesh_info.attributes, task.attribute_fallbacks, ordered_attributes, - [&](const AttributeDomain domain) { + [&](const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_POINT: return IndexRange(task.start_indices.vertex, mesh.totvert); @@ -991,8 +991,8 @@ static void execute_realize_mesh_tasks(const RealizeInstancesOptions &options, Vector dst_attribute_spans; for (const int attribute_index : ordered_attributes.index_range()) { const AttributeIDRef &attribute_id = ordered_attributes.ids[attribute_index]; - const AttributeDomain domain = ordered_attributes.kinds[attribute_index].domain; - const CustomDataType data_type = ordered_attributes.kinds[attribute_index].data_type; + const eAttrDomain domain = ordered_attributes.kinds[attribute_index].domain; + const eCustomDataType data_type = ordered_attributes.kinds[attribute_index].data_type; OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, domain, data_type); dst_attribute_spans.append(dst_attribute.as_span()); @@ -1083,9 +1083,9 @@ static AllCurvesInfo preprocess_curves(const GeometrySet &geometry_set, component.replace(const_cast(curves), GeometryOwnershipType::ReadOnly); curve_info.attributes.reinitialize(info.attributes.size()); for (const int attribute_index : info.attributes.index_range()) { - const AttributeDomain domain = info.attributes.kinds[attribute_index].domain; + const eAttrDomain domain = info.attributes.kinds[attribute_index].domain; const AttributeIDRef &attribute_id = info.attributes.ids[attribute_index]; - const CustomDataType data_type = info.attributes.kinds[attribute_index].data_type; + const eCustomDataType data_type = info.attributes.kinds[attribute_index].data_type; if (component.attribute_exists(attribute_id)) { GVArray attribute = component.attribute_get_for_read(attribute_id, domain, data_type); curve_info.attributes[attribute_index].emplace(std::move(attribute)); @@ -1189,7 +1189,7 @@ static void execute_realize_curve_task(const RealizeInstancesOptions &options, curves_info.attributes, task.attribute_fallbacks, ordered_attributes, - [&](const AttributeDomain domain) { + [&](const eAttrDomain domain) { switch (domain) { case ATTR_DOMAIN_POINT: return IndexRange(task.start_indices.point, curves.points_num()); @@ -1238,8 +1238,8 @@ static void execute_realize_curve_tasks(const RealizeInstancesOptions &options, Vector dst_attribute_spans; for (const int attribute_index : ordered_attributes.index_range()) { const AttributeIDRef &attribute_id = ordered_attributes.ids[attribute_index]; - const AttributeDomain domain = ordered_attributes.kinds[attribute_index].domain; - const CustomDataType data_type = ordered_attributes.kinds[attribute_index].data_type; + const eAttrDomain domain = ordered_attributes.kinds[attribute_index].domain; + const eCustomDataType data_type = ordered_attributes.kinds[attribute_index].data_type; OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, domain, data_type); dst_attribute_spans.append(dst_attribute.as_span()); diff --git a/source/blender/geometry/intern/resample_curves.cc b/source/blender/geometry/intern/resample_curves.cc index 7895225a189..9eaab327e01 100644 --- a/source/blender/geometry/intern/resample_curves.cc +++ b/source/blender/geometry/intern/resample_curves.cc @@ -99,7 +99,7 @@ static void retrieve_attribute_spans(const Span ids, BLI_assert(src_attribute); src.append(src_attribute.get_internal_span()); - const CustomDataType data_type = bke::cpp_type_to_custom_data_type(src_attribute.type()); + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type(src_attribute.type()); bke::OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( ids[i], ATTR_DOMAIN_POINT, data_type); dst.append(dst_attribute.as_span()); diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h index 1af0080baef..e4a01670558 100644 --- a/source/blender/gpu/GPU_buffers.h +++ b/source/blender/gpu/GPU_buffers.h @@ -86,7 +86,7 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, const float *vmask, const void *vcol_data, int vcol_type, - AttributeDomain vcol_domain, + eAttrDomain vcol_domain, const int *sculpt_face_sets, int face_sets_color_seed, int face_sets_color_default, diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index fff90e6f8ff..c0633f0323d 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -7,7 +7,7 @@ #pragma once -#include "DNA_customdata_types.h" /* for CustomDataType */ +#include "DNA_customdata_types.h" /* for eCustomDataType */ #include "DNA_image_types.h" #include "DNA_listBase.h" @@ -130,9 +130,9 @@ typedef void (*GPUCodegenCallbackFn)(void *thunk, GPUMaterial *mat, GPUCodegenOu GPUNodeLink *GPU_constant(const float *num); GPUNodeLink *GPU_uniform(const float *num); -GPUNodeLink *GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name); +GPUNodeLink *GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name); GPUNodeLink *GPU_attribute_with_default(GPUMaterial *mat, - CustomDataType type, + eCustomDataType type, const char *name, eGPUDefaultValue default_value); GPUNodeLink *GPU_uniform_attribute(GPUMaterial *mat, const char *name, bool use_dupli); @@ -259,7 +259,7 @@ void GPU_pass_cache_free(void); typedef struct GPUMaterialAttribute { struct GPUMaterialAttribute *next, *prev; - int type; /* CustomDataType */ + int type; /* eCustomDataType */ char name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ char input_name[12 + 1]; /* GPU_MAX_SAFE_ATTR_NAME + 1 */ eGPUType gputype; diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index fed998bb33e..82a9dea114e 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -200,7 +200,7 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, const float *vmask, const void *vcol_data, int vcol_type, - AttributeDomain vcol_domain, + eAttrDomain vcol_domain, const int *sculpt_face_sets, int face_sets_color_seed, int face_sets_color_default, diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index 91fb0544cf6..cac6f7cb38b 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -328,7 +328,7 @@ void gpu_node_graph_finalize_uniform_attrs(GPUNodeGraph *graph) /* Attributes and Textures */ -static char attr_prefix_get(CustomDataType type) +static char attr_prefix_get(eCustomDataType type) { switch (type) { case CD_TANGENT: @@ -364,7 +364,7 @@ static void attr_input_name(GPUMaterialAttribute *attr) /** Add a new varying attribute of given type and name. Returns NULL if out of slots. */ static GPUMaterialAttribute *gpu_node_graph_add_attribute(GPUNodeGraph *graph, - CustomDataType type, + eCustomDataType type, const char *name) { /* Find existing attribute. */ @@ -468,7 +468,7 @@ static GPUMaterialTexture *gpu_node_graph_add_texture(GPUNodeGraph *graph, /* Creating Inputs */ -GPUNodeLink *GPU_attribute(GPUMaterial *mat, const CustomDataType type, const char *name) +GPUNodeLink *GPU_attribute(GPUMaterial *mat, const eCustomDataType type, const char *name) { GPUNodeGraph *graph = gpu_material_node_graph(mat); GPUMaterialAttribute *attr = gpu_node_graph_add_attribute(graph, type, name); @@ -491,7 +491,7 @@ GPUNodeLink *GPU_attribute(GPUMaterial *mat, const CustomDataType type, const ch } GPUNodeLink *GPU_attribute_with_default(GPUMaterial *mat, - const CustomDataType type, + const eCustomDataType type, const char *name, eGPUDefaultValue default_value) { diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index 633611cf1a6..6e4ec6d23fa 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -273,7 +273,7 @@ void write_custom_data(const OCompoundProperty &prop, CustomData *data, int data_type) { - CustomDataType cd_data_type = static_cast(data_type); + eCustomDataType cd_data_type = static_cast(data_type); if (!CustomData_has_layer(data, cd_data_type)) { return; diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index 219bba285a7..d8c48357fc0 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -376,7 +376,7 @@ BLI_INLINE void read_uvs_params(CDStreamConfig &config, static void *add_customdata_cb(Mesh *mesh, const char *name, int data_type) { - CustomDataType cd_data_type = static_cast(data_type); + eCustomDataType cd_data_type = static_cast(data_type); /* unsupported custom data type -- don't do anything. */ if (!ELEM(cd_data_type, CD_MLOOPUV, CD_PROP_BYTE_COLOR)) { diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index e2562eca69b..2c86bfff4da 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -143,7 +143,7 @@ static void assign_materials(Main *bmain, static void *add_customdata_cb(Mesh *mesh, const char *name, const int data_type) { - CustomDataType cd_data_type = static_cast(data_type); + eCustomDataType cd_data_type = static_cast(data_type); void *cd_ptr; CustomData *loopdata; int numloops; diff --git a/source/blender/makesdna/DNA_curves_types.h b/source/blender/makesdna/DNA_curves_types.h index 45b2309c5bf..9690c342fdd 100644 --- a/source/blender/makesdna/DNA_curves_types.h +++ b/source/blender/makesdna/DNA_curves_types.h @@ -142,7 +142,7 @@ typedef struct Curves { */ char symmetry; /** - * #AttributeDomain. The active selection mode domain. At most one selection mode can be active + * #eAttrDomain. The active selection mode domain. At most one selection mode can be active * at a time. */ char selection_domain; diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index fe06e97946c..bc29de66cf9 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -81,7 +81,7 @@ typedef struct CustomData { } CustomData; /** #CustomData.type */ -typedef enum CustomDataType { +typedef enum eCustomDataType { /* Used by GLSL attributes in the cases when we need a delayed CD type * assignment (in the cases when we don't know in advance which layer * we are addressing). @@ -161,9 +161,9 @@ typedef enum CustomDataType { CD_HAIRLENGTH = 51, CD_NUMTYPES = 52, -} CustomDataType; +} eCustomDataType; -/* Bits for CustomDataMask */ +/* Bits for eCustomDataMask */ #define CD_MASK_MVERT (1 << CD_MVERT) // #define CD_MASK_MSTICKY (1 << CD_MSTICKY) /* DEPRECATED */ #define CD_MASK_MDEFORMVERT (1 << CD_MDEFORMVERT) diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index a0738883bf3..9dc2971b322 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -140,7 +140,7 @@ typedef struct bNodeSocket { short stack_type DNA_DEPRECATED; char display_shape; - /* #AttributeDomain used when the geometry nodes modifier creates an attribute for a group + /* #eAttrDomain used when the geometry nodes modifier creates an attribute for a group * output. */ char attribute_domain; /* Runtime-only cache of the number of input links, for multi-input sockets. */ @@ -1175,7 +1175,7 @@ typedef struct NodeDenoise { } NodeDenoise; typedef struct NodeMapRange { - /* CustomDataType */ + /* eCustomDataType */ uint8_t data_type; /* NodeMapRangeType. */ @@ -1185,14 +1185,14 @@ typedef struct NodeMapRange { } NodeMapRange; typedef struct NodeRandomValue { - /* CustomDataType. */ + /* eCustomDataType. */ uint8_t data_type; } NodeRandomValue; typedef struct NodeAccumulateField { - /* CustomDataType. */ + /* eCustomDataType. */ uint8_t data_type; - /* AttributeDomain. */ + /* eAttrDomain. */ uint8_t domain; } NodeAccumulateField; @@ -1362,9 +1362,9 @@ typedef struct NodeGeometryCurveSample { } NodeGeometryCurveSample; typedef struct NodeGeometryTransferAttribute { - /* CustomDataType. */ + /* eCustomDataType. */ int8_t data_type; - /* AttributeDomain. */ + /* eAttrDomain. */ int8_t domain; /* GeometryNodeAttributeTransferMode. */ uint8_t mode; @@ -1375,7 +1375,7 @@ typedef struct NodeGeometryRaycast { /* GeometryNodeRaycastMapMode. */ uint8_t mapping; - /* CustomDataType. */ + /* eCustomDataType. */ int8_t data_type; /* Deprecated input types in new Ray-cast node. Can be removed when legacy nodes are no longer @@ -1394,21 +1394,21 @@ typedef struct NodeGeometryMeshToPoints { } NodeGeometryMeshToPoints; typedef struct NodeGeometryAttributeCapture { - /* CustomDataType. */ + /* eCustomDataType. */ int8_t data_type; - /* AttributeDomain. */ + /* eAttrDomain. */ int8_t domain; } NodeGeometryAttributeCapture; typedef struct NodeGeometryStoreNamedAttribute { - /* CustomDataType. */ + /* eCustomDataType. */ int8_t data_type; - /* AttributeDomain. */ + /* eAttrDomain. */ int8_t domain; } NodeGeometryStoreNamedAttribute; typedef struct NodeGeometryInputNamedAttribute { - /* CustomDataType. */ + /* eCustomDataType. */ int8_t data_type; } NodeGeometryInputNamedAttribute; @@ -1424,19 +1424,19 @@ typedef struct NodeGeometryStringToCurves { } NodeGeometryStringToCurves; typedef struct NodeGeometryDeleteGeometry { - /* AttributeDomain. */ + /* eAttrDomain. */ int8_t domain; /* GeometryNodeDeleteGeometryMode. */ int8_t mode; } NodeGeometryDeleteGeometry; typedef struct NodeGeometryDuplicateElements { - /* AttributeDomain. */ + /* eAttrDomain. */ int8_t domain; } NodeGeometryDuplicateElements; typedef struct NodeGeometrySeparateGeometry { - /* AttributeDomain. */ + /* eAttrDomain. */ int8_t domain; } NodeGeometrySeparateGeometry; @@ -1446,7 +1446,7 @@ typedef struct NodeGeometryImageTexture { } NodeGeometryImageTexture; typedef struct NodeGeometryViewer { - /* CustomDataType. */ + /* eCustomDataType. */ int8_t data_type; } NodeGeometryViewer; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 85649a31ea4..59bd385c207 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -1936,7 +1936,7 @@ typedef struct SpaceSpreadsheet { /* #GeometryComponentType. */ uint8_t geometry_component_type; - /* #AttributeDomain. */ + /* #eAttrDomain. */ uint8_t attribute_domain; /* eSpaceSpreadsheet_ObjectContext. */ uint8_t object_eval_state; diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c index 76e1e712cad..5af714660ed 100644 --- a/source/blender/makesrna/intern/rna_attribute.c +++ b/source/blender/makesrna/intern/rna_attribute.c @@ -129,7 +129,7 @@ static char *rna_Attribute_path(const PointerRNA *ptr) return BLI_sprintfN("attributes['%s']", layer->name); } -static StructRNA *srna_by_custom_data_layer_type(const CustomDataType type) +static StructRNA *srna_by_custom_data_layer_type(const eCustomDataType type) { switch (type) { case CD_PROP_FLOAT: @@ -378,7 +378,7 @@ static int rna_Attributes_noncolor_layer_skip(CollectionPropertyIterator *iter, /* Check valid domain here, too, keep in line with rna_AttributeGroup_color_length(). */ ID *id = iter->parent.owner_id; - AttributeDomain domain = BKE_id_attribute_domain(id, layer); + eAttrDomain domain = BKE_id_attribute_domain(id, layer); if (!ELEM(domain, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CORNER)) { return 1; } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 4c410782326..8591d4abd63 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1369,10 +1369,9 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf( Object *ob_src = dtmd->ob_source; if (ob_src) { - AttributeDomain domain = STREQ(RNA_property_identifier(prop), - "layers_vcol_vert_select_src") ? - ATTR_DOMAIN_POINT : - ATTR_DOMAIN_CORNER; + eAttrDomain domain = STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_src") ? + ATTR_DOMAIN_POINT : + ATTR_DOMAIN_CORNER; Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); @@ -1392,7 +1391,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf( cdata = &me_eval->ldata; } - CustomDataType types[2] = {CD_PROP_COLOR, CD_PROP_BYTE_COLOR}; + eCustomDataType types[2] = {CD_PROP_COLOR, CD_PROP_BYTE_COLOR}; int idx = 0; for (int i = 0; i < 2; i++) { @@ -1492,7 +1491,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_dst_itemf( Object *ob_dst = CTX_data_active_object(C); /* XXX Is this OK? */ if (ob_dst && ob_dst->data) { - CustomDataType types[2] = {CD_PROP_COLOR, CD_PROP_BYTE_COLOR}; + eCustomDataType types[2] = {CD_PROP_COLOR, CD_PROP_BYTE_COLOR}; Mesh *me_dst = ob_dst->data; CustomData *cdata = STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_dst") ? diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index c1e16e1b8e5..73db56186de 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -119,8 +119,8 @@ using blender::nodes::InputSocketFieldType; using blender::threading::EnumerableThreadSpecific; using namespace blender::fn::multi_function_types; using namespace blender::nodes::derived_node_tree_types; +using geo_log::eNamedAttrUsage; using geo_log::GeometryAttributeInfo; -using geo_log::NamedAttributeUsage; static void initData(ModifierData *md) { @@ -921,7 +921,7 @@ struct OutputAttributeInfo { struct OutputAttributeToStore { GeometryComponentType component_type; - AttributeDomain domain; + eAttrDomain domain; StringRefNull name; GMutableSpan data; }; @@ -930,10 +930,10 @@ struct OutputAttributeToStore { * The output attributes are organized based on their domain, because attributes on the same domain * can be evaluated together. */ -static MultiValueMap find_output_attributes_to_store( +static MultiValueMap find_output_attributes_to_store( const NodesModifierData &nmd, const NodeRef &output_node, Span output_values) { - MultiValueMap outputs_by_domain; + MultiValueMap outputs_by_domain; for (const InputSocketRef *socket : output_node.inputs().drop_front(1).drop_back(1)) { if (!socket_type_has_attribute_toggle(*socket->bsocket())) { continue; @@ -960,7 +960,7 @@ static MultiValueMap find_output_attribute const bNodeSocket *interface_socket = (const bNodeSocket *)BLI_findlink( &nmd.node_group->outputs, socket->index()); - const AttributeDomain domain = (AttributeDomain)interface_socket->attribute_domain; + const eAttrDomain domain = (eAttrDomain)interface_socket->attribute_domain; OutputAttributeInfo output_info; output_info.field = std::move(field); output_info.name = attribute_name; @@ -975,7 +975,7 @@ static MultiValueMap find_output_attribute */ static Vector compute_attributes_to_store( const GeometrySet &geometry, - const MultiValueMap &outputs_by_domain) + const MultiValueMap &outputs_by_domain) { Vector attributes_to_store; for (const GeometryComponentType component_type : {GEO_COMPONENT_TYPE_MESH, @@ -987,7 +987,7 @@ static Vector compute_attributes_to_store( } const GeometryComponent &component = *geometry.get_component_for_read(component_type); for (const auto item : outputs_by_domain.items()) { - const AttributeDomain domain = item.key; + const eAttrDomain domain = item.key; const Span outputs_info = item.value; if (!component.attribute_domain_supported(domain)) { continue; @@ -1016,7 +1016,8 @@ static void store_computed_output_attributes( { for (const OutputAttributeToStore &store : attributes_to_store) { GeometryComponent &component = geometry.get_component_for_write(store.component_type); - const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(store.data.type()); + const eCustomDataType data_type = blender::bke::cpp_type_to_custom_data_type( + store.data.type()); const std::optional meta_data = component.attribute_get_meta_data( store.name); @@ -1057,7 +1058,7 @@ static void store_output_attributes(GeometrySet &geometry, { /* All new attribute values have to be computed before the geometry is actually changed. This is * necessary because some fields might depend on attributes that are overwritten. */ - MultiValueMap outputs_by_domain = + MultiValueMap outputs_by_domain = find_output_attributes_to_store(nmd, output_node, output_values); Vector attributes_to_store = compute_attributes_to_store( geometry, outputs_by_domain); @@ -1664,7 +1665,7 @@ static void internal_dependencies_panel_draw(const bContext *UNUSED(C), Panel *p return; } const geo_log::ModifierLog &log = *static_cast(nmd->runtime_eval_log); - Map usage_by_attribute; + Map usage_by_attribute; 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, @@ -1679,7 +1680,7 @@ static void internal_dependencies_panel_draw(const bContext *UNUSED(C), Panel *p struct NameWithUsage { StringRefNull name; - NamedAttributeUsage usage; + eNamedAttrUsage usage; }; Vector sorted_used_attribute; @@ -1694,20 +1695,20 @@ static void internal_dependencies_panel_draw(const bContext *UNUSED(C), Panel *p for (const NameWithUsage &attribute : sorted_used_attribute) { const StringRefNull attribute_name = attribute.name; - const NamedAttributeUsage usage = attribute.usage; + const eNamedAttrUsage usage = attribute.usage; /* #uiLayoutRowWithHeading doesn't seem to work in this case. */ uiLayout *split = uiLayoutSplit(layout, 0.4f, false); std::stringstream ss; Vector 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()) { diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh index bac4d0165e9..176a240791e 100644 --- a/source/blender/nodes/NOD_geometry_exec.hh +++ b/source/blender/nodes/NOD_geometry_exec.hh @@ -40,7 +40,7 @@ using fn::FieldInput; using fn::FieldOperation; using fn::GField; using fn::ValueOrField; -using geometry_nodes_eval_log::NamedAttributeUsage; +using geometry_nodes_eval_log::eNamedAttrUsage; using geometry_nodes_eval_log::NodeWarningType; /** @@ -307,17 +307,17 @@ class GeoNodeExecParams { */ GVArray get_input_attribute(const StringRef name, const GeometryComponent &component, - AttributeDomain domain, - const CustomDataType type, + eAttrDomain domain, + const eCustomDataType type, const void *default_value) const; template VArray get_input_attribute(const StringRef name, const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, const T &default_value) const { - const CustomDataType type = bke::cpp_type_to_custom_data_type(CPPType::get()); + const eCustomDataType type = bke::cpp_type_to_custom_data_type(CPPType::get()); GVArray varray = this->get_input_attribute(name, component, domain, type, &default_value); return varray.typed(); } @@ -326,24 +326,24 @@ class GeoNodeExecParams { * Get the type of an input property or the associated constant socket types with the * same names. Fall back to the default value if no attribute exists with the name. */ - CustomDataType get_input_attribute_data_type(const StringRef name, - const GeometryComponent &component, - const CustomDataType default_type) const; + eCustomDataType get_input_attribute_data_type(const StringRef name, + const GeometryComponent &component, + const eCustomDataType default_type) const; /** * If any of the corresponding input sockets are attributes instead of single values, * use the highest priority attribute domain from among them. * Otherwise return the default domain. */ - AttributeDomain get_highest_priority_input_domain(Span names, - const GeometryComponent &component, - AttributeDomain default_domain) const; + eAttrDomain get_highest_priority_input_domain(Span names, + const GeometryComponent &component, + eAttrDomain default_domain) const; std::string attribute_producer_name() const; void set_default_remaining_outputs(); - void used_named_attribute(std::string attribute_name, NamedAttributeUsage usage); + void used_named_attribute(std::string attribute_name, eNamedAttrUsage usage); private: /* Utilities for detecting common errors at when using this class. */ diff --git a/source/blender/nodes/NOD_geometry_nodes_eval_log.hh b/source/blender/nodes/NOD_geometry_nodes_eval_log.hh index 2917861f084..05c97c3903d 100644 --- a/source/blender/nodes/NOD_geometry_nodes_eval_log.hh +++ b/source/blender/nodes/NOD_geometry_nodes_eval_log.hh @@ -90,8 +90,8 @@ class GFieldValueLog : public ValueLog { struct GeometryAttributeInfo { std::string name; /** Can be empty when #name does not actually exist on a geometry yet. */ - std::optional domain; - std::optional data_type; + std::optional domain; + std::optional data_type; }; /** Contains information about a geometry set. In most cases this does not store the entire @@ -171,17 +171,17 @@ struct ValueOfSockets { destruct_ptr value; }; -enum class NamedAttributeUsage { +enum class eNamedAttrUsage { None = 0, Read = 1 << 0, Write = 1 << 1, Remove = 1 << 2, }; -ENUM_OPERATORS(NamedAttributeUsage, NamedAttributeUsage::Remove); +ENUM_OPERATORS(eNamedAttrUsage, eNamedAttrUsage::Remove); struct UsedNamedAttribute { std::string name; - NamedAttributeUsage usage; + eNamedAttrUsage usage; }; struct NodeWithUsedNamedAttribute { @@ -219,7 +219,7 @@ class LocalGeoLogger { void log_multi_value_socket(DSocket socket, Span values); void log_node_warning(DNode node, NodeWarningType type, std::string message); void log_execution_time(DNode node, std::chrono::microseconds exec_time); - void log_used_named_attribute(DNode node, std::string attribute_name, NamedAttributeUsage usage); + void log_used_named_attribute(DNode node, std::string attribute_name, eNamedAttrUsage usage); /** * Log a message that will be displayed in the node editor next to the node. * This should only be used for debugging purposes and not to display information to users. diff --git a/source/blender/nodes/function/nodes/node_fn_random_value.cc b/source/blender/nodes/function/nodes/node_fn_random_value.cc index a0942ced1be..360695299cb 100644 --- a/source/blender/nodes/function/nodes/node_fn_random_value.cc +++ b/source/blender/nodes/function/nodes/node_fn_random_value.cc @@ -57,7 +57,7 @@ static void fn_node_random_value_init(bNodeTree *UNUSED(tree), bNode *node) static void fn_node_random_value_update(bNodeTree *ntree, bNode *node) { const NodeRandomValue &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); bNodeSocket *sock_min_vector = (bNodeSocket *)node->inputs.first; bNodeSocket *sock_max_vector = sock_min_vector->next; @@ -86,7 +86,7 @@ static void fn_node_random_value_update(bNodeTree *ntree, bNode *node) nodeSetSocketAvailability(ntree, sock_out_bool, data_type == CD_PROP_BOOL); } -static std::optional node_type_from_other_socket(const bNodeSocket &socket) +static std::optional node_type_from_other_socket(const bNodeSocket &socket) { switch (socket.type) { case SOCK_FLOAT: @@ -106,7 +106,7 @@ static std::optional node_type_from_other_socket(const bNodeSock static void fn_node_random_value_gather_link_search(GatherLinkSearchOpParams ¶ms) { const NodeDeclaration &declaration = *params.node_type().fixed_declaration; - const std::optional type = node_type_from_other_socket(params.other_socket()); + const std::optional type = node_type_from_other_socket(params.other_socket()); if (!type) { return; } @@ -137,7 +137,7 @@ static void fn_node_random_value_gather_link_search(GatherLinkSearchOpParams &pa static void fn_node_random_value_build_multi_function(NodeMultiFunctionBuilder &builder) { const NodeRandomValue &storage = node_storage(builder.node()); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); switch (data_type) { case CD_PROP_FLOAT3: { diff --git a/source/blender/nodes/geometry/node_geometry_util.cc b/source/blender/nodes/geometry/node_geometry_util.cc index 7f9ec329efd..8f673d2264e 100644 --- a/source/blender/nodes/geometry/node_geometry_util.cc +++ b/source/blender/nodes/geometry/node_geometry_util.cc @@ -14,7 +14,7 @@ namespace blender::nodes { -std::optional node_data_type_to_custom_data_type(const eNodeSocketDatatype type) +std::optional node_data_type_to_custom_data_type(const eNodeSocketDatatype type) { switch (type) { case SOCK_FLOAT: @@ -34,7 +34,7 @@ std::optional node_data_type_to_custom_data_type(const eNodeSock } } -std::optional node_socket_to_custom_data_type(const bNodeSocket &socket) +std::optional node_socket_to_custom_data_type(const bNodeSocket &socket) { return node_data_type_to_custom_data_type(static_cast(socket.type)); } diff --git a/source/blender/nodes/geometry/node_geometry_util.hh b/source/blender/nodes/geometry/node_geometry_util.hh index 8f20da66c3b..d261928d1b8 100644 --- a/source/blender/nodes/geometry/node_geometry_util.hh +++ b/source/blender/nodes/geometry/node_geometry_util.hh @@ -70,13 +70,13 @@ void copy_point_attributes_based_on_mask(const GeometryComponent &in_component, * component. If no component can work with the domain, then `error_message` is set to true. */ void separate_geometry(GeometrySet &geometry_set, - AttributeDomain domain, + eAttrDomain domain, GeometryNodeDeleteGeometryMode mode, const Field &selection_field, bool invert, bool &r_is_error); -std::optional node_data_type_to_custom_data_type(eNodeSocketDatatype type); -std::optional node_socket_to_custom_data_type(const bNodeSocket &socket); +std::optional node_data_type_to_custom_data_type(eNodeSocketDatatype type); +std::optional node_socket_to_custom_data_type(const bNodeSocket &socket); } // namespace blender::nodes diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index b29831ceeb6..a7404af8564 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -87,7 +87,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { const NodeAccumulateField &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); bNodeSocket *sock_in_vector = (bNodeSocket *)node->inputs.first; bNodeSocket *sock_in_float = sock_in_vector->next; @@ -123,7 +123,7 @@ static void node_update(bNodeTree *ntree, bNode *node) enum class AccumulationMode { Leading = 0, Trailing = 1 }; -static std::optional node_type_from_other_socket(const bNodeSocket &socket) +static std::optional node_type_from_other_socket(const bNodeSocket &socket) { switch (socket.type) { case SOCK_FLOAT: @@ -141,7 +141,7 @@ static std::optional node_type_from_other_socket(const bNodeSock static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { - const std::optional type = node_type_from_other_socket(params.other_socket()); + const std::optional type = node_type_from_other_socket(params.other_socket()); if (!type) { return; } @@ -196,11 +196,11 @@ template class AccumulateFieldInput final : public GeometryFieldInpu private: Field input_; Field group_index_; - AttributeDomain source_domain_; + eAttrDomain source_domain_; AccumulationMode accumulation_mode_; public: - AccumulateFieldInput(const AttributeDomain source_domain, + AccumulateFieldInput(const eAttrDomain source_domain, Field input, Field group_index, AccumulationMode accumulation_mode) @@ -213,7 +213,7 @@ template class AccumulateFieldInput final : public GeometryFieldInpu } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { const GeometryComponentFieldContext field_context{component, source_domain_}; @@ -287,10 +287,10 @@ template class TotalFieldInput final : public GeometryFieldInput { private: Field input_; Field group_index_; - AttributeDomain source_domain_; + eAttrDomain source_domain_; public: - TotalFieldInput(const AttributeDomain source_domain, Field input, Field group_index) + TotalFieldInput(const eAttrDomain source_domain, Field input, Field group_index) : GeometryFieldInput(CPPType::get(), "Total Value"), input_(input), group_index_(group_index), @@ -299,7 +299,7 @@ template class TotalFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { const GeometryComponentFieldContext field_context{component, source_domain_}; @@ -365,8 +365,8 @@ template std::string identifier_suffix() static void node_geo_exec(GeoNodeExecParams params) { const NodeAccumulateField &storage = node_storage(params.node()); - const CustomDataType data_type = static_cast(storage.data_type); - const AttributeDomain source_domain = static_cast(storage.domain); + const eCustomDataType data_type = static_cast(storage.data_type); + const eAttrDomain source_domain = static_cast(storage.domain); Field group_index_field = params.extract_input>("Group Index"); attribute_math::convert_to_static_type(data_type, [&](auto dummy) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc index 16967d32673..496fb081d6b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc @@ -50,7 +50,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { const NodeGeometryAttributeCapture &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); bNodeSocket *socket_value_geometry = (bNodeSocket *)node->inputs.first; bNodeSocket *socket_value_vector = socket_value_geometry->next; @@ -86,7 +86,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.outputs().take_front(1)); const bNodeType &node_type = params.node_type(); - const std::optional type = node_data_type_to_custom_data_type( + const std::optional type = node_data_type_to_custom_data_type( (eNodeSocketDatatype)params.other_socket().type); if (type && *type != CD_PROP_STRING) { if (params.in_out() == SOCK_OUT) { @@ -108,14 +108,14 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) static void try_capture_field_on_geometry(GeometryComponent &component, const AttributeIDRef &attribute_id, - const AttributeDomain domain, + const eAttrDomain domain, const GField &field) { GeometryComponentFieldContext field_context{component, domain}; const int domain_num = component.attribute_domain_num(domain); const IndexMask mask{IndexMask(domain_num)}; - const CustomDataType data_type = bke::cpp_type_to_custom_data_type(field.cpp_type()); + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type(field.cpp_type()); OutputAttribute output_attribute = component.attribute_try_get_for_output_only( attribute_id, domain, data_type); @@ -126,7 +126,7 @@ static void try_capture_field_on_geometry(GeometryComponent &component, output_attribute.save(); } -static StringRefNull identifier_suffix(CustomDataType data_type) +static StringRefNull identifier_suffix(eCustomDataType data_type) { switch (data_type) { case CD_PROP_FLOAT: @@ -158,8 +158,8 @@ static void node_geo_exec(GeoNodeExecParams params) } const NodeGeometryAttributeCapture &storage = node_storage(params.node()); - const CustomDataType data_type = static_cast(storage.data_type); - const AttributeDomain domain = static_cast(storage.domain); + const eCustomDataType data_type = static_cast(storage.data_type); + const eAttrDomain domain = static_cast(storage.domain); const std::string output_identifier = "Attribute" + identifier_suffix(data_type); diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index c7f65a68d60..35404725998 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -77,7 +77,7 @@ static void node_update(bNodeTree *ntree, bNode *node) bNodeSocket *socket_vector_std = socket_vector_range->next; bNodeSocket *socket_vector_variance = socket_vector_std->next; - const CustomDataType data_type = static_cast(node->custom1); + const eCustomDataType data_type = static_cast(node->custom1); nodeSetSocketAvailability(ntree, socket_float_attr, data_type == CD_PROP_FLOAT); nodeSetSocketAvailability(ntree, socket_float_mean, data_type == CD_PROP_FLOAT); @@ -100,7 +100,7 @@ static void node_update(bNodeTree *ntree, bNode *node) nodeSetSocketAvailability(ntree, socket_vector_variance, data_type == CD_PROP_FLOAT3); } -static std::optional node_type_from_other_socket(const bNodeSocket &socket) +static std::optional node_type_from_other_socket(const bNodeSocket &socket) { switch (socket.type) { case SOCK_FLOAT: @@ -121,7 +121,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) const NodeDeclaration &declaration = *params.node_type().fixed_declaration; search_link_ops_for_declarations(params, declaration.inputs().take_front(2)); - const std::optional type = node_type_from_other_socket(params.other_socket()); + const std::optional type = node_type_from_other_socket(params.other_socket()); if (!type) { return; } @@ -184,8 +184,8 @@ static void node_geo_exec(GeoNodeExecParams params) { GeometrySet geometry_set = params.get_input("Geometry"); const bNode &node = params.node(); - const CustomDataType data_type = static_cast(node.custom1); - const AttributeDomain domain = static_cast(node.custom2); + const eCustomDataType data_type = static_cast(node.custom1); + const eAttrDomain domain = static_cast(node.custom2); Vector components = geometry_set.get_components_for_read(); const Field selection_field = params.get_input>("Selection"); diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc index bbc8758952d..b52bf2571b5 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_endpoint_selection.cc @@ -41,7 +41,7 @@ class EndpointFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() != GEO_COMPONENT_TYPE_CURVE || domain != ATTR_DOMAIN_POINT) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc index dc2b9d40894..5ef20f03f28 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc @@ -84,7 +84,7 @@ class HandleTypeFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { if (component.type() != GEO_COMPONENT_TYPE_CURVE || domain != ATTR_DOMAIN_POINT) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc index ae36248b573..8401c94be4b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc @@ -107,7 +107,7 @@ static Array curve_length_point_domain(const bke::CurvesGeometry &curves) static VArray construct_curve_parameter_varray(const bke::CurvesGeometry &curves, const IndexMask UNUSED(mask), - const AttributeDomain domain) + const eAttrDomain domain) { VArray cyclic = curves.cyclic(); @@ -146,7 +146,7 @@ static VArray construct_curve_parameter_varray(const bke::CurvesGeometry static VArray construct_curve_length_parameter_varray(const bke::CurvesGeometry &curves, const IndexMask UNUSED(mask), - const AttributeDomain domain) + const eAttrDomain domain) { curves.ensure_evaluated_lengths(); @@ -165,7 +165,7 @@ static VArray construct_curve_length_parameter_varray(const bke::CurvesGe static VArray construct_index_on_spline_varray(const bke::CurvesGeometry &curves, const IndexMask UNUSED(mask), - const AttributeDomain domain) + const eAttrDomain domain) { if (domain == ATTR_DOMAIN_POINT) { Array result(curves.points_num()); @@ -191,7 +191,7 @@ class CurveParameterFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { if (component.type() == GEO_COMPONENT_TYPE_CURVE) { @@ -225,7 +225,7 @@ class CurveLengthParameterFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { if (component.type() == GEO_COMPONENT_TYPE_CURVE) { @@ -259,7 +259,7 @@ class IndexOnSplineFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { if (component.type() == GEO_COMPONENT_TYPE_CURVE) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc index 73b2c400e90..7d83b4b3ecb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc @@ -124,7 +124,7 @@ static Array calculate_spline_point_offsets(GeoNodeExecParams ¶ms, */ static GMutableSpan ensure_point_attribute(PointCloudComponent &points, const AttributeIDRef &attribute_id, - const CustomDataType data_type) + const eCustomDataType data_type) { points.attribute_try_create(attribute_id, ATTR_DOMAIN_POINT, data_type, AttributeInitDefault()); WriteAttributeLookup attribute = points.attribute_try_get_for_write(attribute_id); diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc index 99edc4d298c..5350896e93d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc @@ -57,7 +57,7 @@ static IndexMask index_mask_indices(Span mask, const bool invert, Vector &attributes, const GeometryComponent &in_component, GeometryComponent &result_component, - const Span domains) + const Span domains) { for (Map::Item entry : attributes.items()) { const AttributeIDRef attribute_id = entry.key; @@ -70,7 +70,7 @@ static void copy_attributes(const Map &attributes if (!domains.contains(attribute.domain)) { continue; } - const CustomDataType data_type = bke::cpp_type_to_custom_data_type(attribute.varray.type()); + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type(attribute.varray.type()); OutputAttribute result_attribute = result_component.attribute_try_get_for_output_only( attribute_id, attribute.domain, data_type); @@ -96,7 +96,7 @@ static void copy_attributes(const Map &attributes static void copy_attributes_based_on_mask(const Map &attributes, const GeometryComponent &in_component, GeometryComponent &result_component, - const AttributeDomain domain, + const eAttrDomain domain, const IndexMask mask) { for (Map::Item entry : attributes.items()) { @@ -110,7 +110,7 @@ static void copy_attributes_based_on_mask(const Map &attributes, const GeometryComponent &in_component, GeometryComponent &result_component, - const AttributeDomain domain, + const eAttrDomain domain, const Span index_map) { for (Map::Item entry : attributes.items()) { @@ -146,7 +146,7 @@ static void copy_attributes_based_on_map(const Map curve_separate(const CurveEval &input_curve, const Span selection, - const AttributeDomain selection_domain, + const eAttrDomain selection_domain, const bool invert) { Span input_splines = input_curve.splines(); @@ -463,7 +463,7 @@ static std::unique_ptr curve_separate(const CurveEval &input_curve, static void separate_curve_selection(GeometrySet &geometry_set, const Field &selection_field, - const AttributeDomain selection_domain, + const eAttrDomain selection_domain, const bool invert) { const CurveComponent &src_component = *geometry_set.get_component_for_read(); @@ -987,7 +987,7 @@ static void do_mesh_separation(GeometrySet &geometry_set, const MeshComponent &in_component, const VArray_Span &selection, const bool invert, - const AttributeDomain domain, + const eAttrDomain domain, const GeometryNodeDeleteGeometryMode mode) { /* Needed in all cases. */ @@ -1230,7 +1230,7 @@ static void do_mesh_separation(GeometrySet &geometry_set, static void separate_mesh_selection(GeometrySet &geometry_set, const Field &selection_field, - const AttributeDomain selection_domain, + const eAttrDomain selection_domain, const GeometryNodeDeleteGeometryMode mode, const bool invert) { @@ -1263,7 +1263,7 @@ static void separate_mesh_selection(GeometrySet &geometry_set, namespace blender::nodes { void separate_geometry(GeometrySet &geometry_set, - const AttributeDomain domain, + const eAttrDomain domain, const GeometryNodeDeleteGeometryMode mode, const Field &selection_field, const bool invert, @@ -1320,7 +1320,7 @@ static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { const bNode *node = static_cast(ptr->data); const NodeGeometryDeleteGeometry &storage = node_storage(*node); - const AttributeDomain domain = static_cast(storage.domain); + const eAttrDomain domain = static_cast(storage.domain); uiItemR(layout, ptr, "domain", 0, "", ICON_NONE); /* Only show the mode when it is relevant. */ @@ -1345,7 +1345,7 @@ static void node_geo_exec(GeoNodeExecParams params) const Field selection_field = params.extract_input>("Selection"); const NodeGeometryDeleteGeometry &storage = node_storage(params.node()); - const AttributeDomain domain = static_cast(storage.domain); + const eAttrDomain domain = static_cast(storage.domain); const GeometryNodeDeleteGeometryMode mode = (GeometryNodeDeleteGeometryMode)storage.mode; if (domain == ATTR_DOMAIN_INSTANCE) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc b/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc index c242cfd5cf3..f95601813a3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc @@ -247,7 +247,7 @@ BLI_NOINLINE static void eliminate_points_based_on_mask(const Span elimina BLI_NOINLINE static void interpolate_attribute(const Mesh &mesh, const Span bary_coords, const Span looptri_indices, - const AttributeDomain source_domain, + const eAttrDomain source_domain, const GVArray &source_data, GMutableSpan output_data) { @@ -293,7 +293,7 @@ BLI_NOINLINE static void propagate_existing_attributes( for (Map::Item entry : attributes.items()) { const AttributeIDRef attribute_id = entry.key; - const CustomDataType output_data_type = entry.value.data_type; + const eCustomDataType output_data_type = entry.value.data_type; ReadAttributeLookup source_attribute = mesh_component.attribute_try_get_for_read(attribute_id); if (!source_attribute) { @@ -396,7 +396,7 @@ static Array calc_full_density_factors_with_selection(const MeshComponent const Field &density_field, const Field &selection_field) { - const AttributeDomain attribute_domain = ATTR_DOMAIN_CORNER; + const eAttrDomain attribute_domain = ATTR_DOMAIN_CORNER; GeometryComponentFieldContext field_context{component, attribute_domain}; const int domain_num = component.attribute_domain_num(attribute_domain); diff --git a/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc index dcd9bcfb034..52156b59c51 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc @@ -153,7 +153,7 @@ static void transfer_attributes( continue; } - AttributeDomain out_domain; + eAttrDomain out_domain; if (src_attribute.domain == ATTR_DOMAIN_FACE) { out_domain = ATTR_DOMAIN_POINT; } @@ -164,7 +164,7 @@ static void transfer_attributes( /* Edges and Face Corners. */ out_domain = src_attribute.domain; } - const CustomDataType data_type = bke::cpp_type_to_custom_data_type( + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type( src_attribute.varray.type()); OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, out_domain, data_type); diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc index ebf0c450605..57f8ee395a9 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc @@ -144,7 +144,7 @@ static void threaded_id_offset_copy(const Span offsets, /** Create the copy indices for the duplication domain. */ static void create_duplicate_index_attribute(GeometryComponent &component, - const AttributeDomain output_domain, + const eAttrDomain output_domain, const IndexMask selection, const IndexAttributes &attribute_outputs, const Span offsets) @@ -208,8 +208,8 @@ static void copy_point_attributes_without_id(GeometrySet &geometry_set, if (!src_attribute || src_attribute.domain != ATTR_DOMAIN_POINT) { continue; } - AttributeDomain out_domain = src_attribute.domain; - const CustomDataType data_type = bke::cpp_type_to_custom_data_type( + eAttrDomain out_domain = src_attribute.domain; + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type( src_attribute.varray.type()); OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, out_domain, data_type); @@ -254,8 +254,8 @@ static void copy_curve_attributes_without_id(const GeometrySet &geometry_set, continue; } - AttributeDomain out_domain = src_attribute.domain; - const CustomDataType data_type = bke::cpp_type_to_custom_data_type( + eAttrDomain out_domain = src_attribute.domain; + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type( src_attribute.varray.type()); OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, out_domain, data_type); @@ -435,8 +435,8 @@ static void copy_face_attributes_without_id(GeometrySet &geometry_set, continue; } - AttributeDomain out_domain = src_attribute.domain; - const CustomDataType data_type = bke::cpp_type_to_custom_data_type( + eAttrDomain out_domain = src_attribute.domain; + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type( src_attribute.varray.type()); OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, out_domain, data_type); @@ -648,8 +648,8 @@ static void copy_edge_attributes_without_id(GeometrySet &geometry_set, continue; } - const AttributeDomain out_domain = src_attribute.domain; - const CustomDataType data_type = bke::cpp_type_to_custom_data_type( + const eAttrDomain out_domain = src_attribute.domain; + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type( src_attribute.varray.type()); OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, out_domain, data_type); @@ -849,8 +849,8 @@ static void duplicate_points_curve(GeometrySet &geometry_set, continue; } - AttributeDomain domain = src_attribute.domain; - const CustomDataType data_type = bke::cpp_type_to_custom_data_type( + eAttrDomain domain = src_attribute.domain; + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type( src_attribute.varray.type()); OutputAttribute dst_attribute = dst_component.attribute_try_get_for_output_only( attribute_id, domain, data_type); @@ -1103,7 +1103,7 @@ static void node_geo_exec(GeoNodeExecParams params) GeometrySet geometry_set = params.extract_input("Geometry"); const NodeGeometryDuplicateElements &storage = node_storage(params.node()); - const AttributeDomain duplicate_domain = AttributeDomain(storage.domain); + const eAttrDomain duplicate_domain = eAttrDomain(storage.domain); Field count_field = params.extract_input>("Amount"); Field selection_field = params.extract_input>("Selection"); diff --git a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc index 1f16e8d55bd..25c7840d633 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc @@ -63,7 +63,7 @@ struct AttributeOutputs { static void save_selection_as_attribute(MeshComponent &component, const AnonymousAttributeID *id, - const AttributeDomain domain, + const eAttrDomain domain, const IndexMask selection) { BLI_assert(!component.attribute_exists(id)); diff --git a/source/blender/nodes/geometry/nodes/node_geo_field_at_index.cc b/source/blender/nodes/geometry/nodes/node_geo_field_at_index.cc index bf956f3b83d..58281df43d3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_field_at_index.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_field_at_index.cc @@ -42,7 +42,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { - const CustomDataType data_type = static_cast(node->custom2); + const eCustomDataType data_type = static_cast(node->custom2); bNodeSocket *sock_index = static_cast(node->inputs.first); bNodeSocket *sock_in_float = sock_index->next; @@ -74,10 +74,10 @@ class FieldAtIndex final : public GeometryFieldInput { private: Field index_field_; GField value_field_; - AttributeDomain value_field_domain_; + eAttrDomain value_field_domain_; public: - FieldAtIndex(Field index_field, GField value_field, AttributeDomain value_field_domain) + FieldAtIndex(Field index_field, GField value_field, eAttrDomain value_field_domain) : GeometryFieldInput(value_field.cpp_type(), "Field at Index"), index_field_(std::move(index_field)), value_field_(std::move(value_field)), @@ -86,7 +86,7 @@ class FieldAtIndex final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { const GeometryComponentFieldContext value_field_context{component, value_field_domain_}; @@ -125,7 +125,7 @@ class FieldAtIndex final : public GeometryFieldInput { } }; -static StringRefNull identifier_suffix(CustomDataType data_type) +static StringRefNull identifier_suffix(eCustomDataType data_type) { switch (data_type) { case CD_PROP_BOOL: @@ -147,8 +147,8 @@ static StringRefNull identifier_suffix(CustomDataType data_type) static void node_geo_exec(GeoNodeExecParams params) { const bNode &node = params.node(); - const AttributeDomain domain = static_cast(node.custom1); - const CustomDataType data_type = static_cast(node.custom2); + const eAttrDomain domain = static_cast(node.custom1); + const eCustomDataType data_type = static_cast(node.custom2); Field index_field = params.extract_input>("Index"); attribute_math::convert_to_static_type(data_type, [&](auto dummy) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc index 3ba1378abe1..da249278867 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc @@ -26,7 +26,7 @@ class HandlePositionFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { if (component.type() != GEO_COMPONENT_TYPE_CURVE) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_angle.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_angle.cc index 60640bcb112..f27e0305c7d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_angle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_angle.cc @@ -61,7 +61,7 @@ class AngleFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() != GEO_COMPONENT_TYPE_MESH) { @@ -115,7 +115,7 @@ class SignedAngleFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() != GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_neighbors.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_neighbors.cc index 92172ce7ebd..cbc2ebc3e68 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_neighbors.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_neighbors.cc @@ -25,7 +25,7 @@ class EdgeNeighborCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc index 213a692d80f..6201ad26bfb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc @@ -29,7 +29,7 @@ enum VertexNumber { VERTEX_ONE, VERTEX_TWO }; static VArray construct_edge_vertices_gvarray(const MeshComponent &component, const VertexNumber vertex, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -58,7 +58,7 @@ class EdgeVerticesFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { @@ -85,7 +85,7 @@ class EdgeVerticesFieldInput final : public GeometryFieldInput { static VArray construct_edge_positions_gvarray(const MeshComponent &component, const VertexNumber vertex, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -120,7 +120,7 @@ class EdgePositionFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc index 6f58d28100a..7a0e3e37a65 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc @@ -17,7 +17,7 @@ static void node_declare(NodeDeclarationBuilder &b) } static VArray construct_face_area_gvarray(const MeshComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -41,7 +41,7 @@ class FaceAreaFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc index 62af0476057..c400760f902 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_is_planar.cc @@ -34,7 +34,7 @@ class PlanarFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, [[maybe_unused]] IndexMask mask) const final { if (component.type() != GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_neighbors.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_neighbors.cc index 9968c53f649..67a21cb06f0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_neighbors.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_neighbors.cc @@ -20,7 +20,7 @@ static void node_declare(NodeDeclarationBuilder &b) } static VArray construct_neighbor_count_gvarray(const MeshComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -53,7 +53,7 @@ class FaceNeighborCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { @@ -76,7 +76,7 @@ class FaceNeighborCountFieldInput final : public GeometryFieldInput { }; static VArray construct_vertex_count_gvarray(const MeshComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -98,7 +98,7 @@ class FaceVertexCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_island.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_island.cc index 8e3a9b6769d..bd57924d685 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_island.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_island.cc @@ -30,7 +30,7 @@ class IslandFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() != GEO_COMPONENT_TYPE_MESH) { @@ -78,7 +78,7 @@ class IslandCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() != GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_vertex_neighbors.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_vertex_neighbors.cc index b81016eda18..62b3f9d0e92 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_vertex_neighbors.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_vertex_neighbors.cc @@ -21,7 +21,7 @@ static void node_declare(NodeDeclarationBuilder &b) } static VArray construct_vertex_count_gvarray(const MeshComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -47,7 +47,7 @@ class VertexCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { @@ -70,7 +70,7 @@ class VertexCountFieldInput final : public GeometryFieldInput { }; static VArray construct_face_count_gvarray(const MeshComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { const Mesh *mesh = component.get_for_read(); if (mesh == nullptr) { @@ -96,7 +96,7 @@ class VertexFaceCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc index 553ea6cfcf0..122c7b352c7 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc @@ -37,7 +37,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { const NodeGeometryInputNamedAttribute &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); bNodeSocket *socket_vector = (bNodeSocket *)node->outputs.first; bNodeSocket *socket_float = socket_vector->next; @@ -58,7 +58,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.inputs()); if (params.in_out() == SOCK_OUT) { - const std::optional type = node_data_type_to_custom_data_type( + const std::optional type = node_data_type_to_custom_data_type( static_cast(params.other_socket().type)); if (type && *type != CD_PROP_STRING) { /* The input and output sockets have the same name. */ @@ -74,7 +74,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) static void node_geo_exec(GeoNodeExecParams params) { const NodeGeometryInputNamedAttribute &storage = node_storage(params.node()); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); const std::string name = params.extract_input("Name"); @@ -88,7 +88,7 @@ static void node_geo_exec(GeoNodeExecParams params) return; } - params.used_named_attribute(name, NamedAttributeUsage::Read); + params.used_named_attribute(name, eNamedAttrUsage::Read); switch (data_type) { case CD_PROP_FLOAT: diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc b/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc index 84d773ff8eb..def82eefca5 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc @@ -17,7 +17,7 @@ static void node_declare(NodeDeclarationBuilder &b) */ static VArray construct_curve_point_count_gvarray(const CurveComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { if (!component.has_curves()) { return {}; @@ -47,7 +47,7 @@ class SplineCountFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_CURVE) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_tangent.cc b/source/blender/nodes/geometry/nodes/node_geo_input_tangent.cc index 039d6b69585..f5831941094 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_tangent.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_tangent.cc @@ -64,7 +64,7 @@ static Array curve_tangent_point_domain(const bke::CurvesGeometry &curve } static VArray construct_curve_tangent_gvarray(const CurveComponent &component, - const AttributeDomain domain) + const eAttrDomain domain) { if (!component.has_curves()) { return {}; @@ -101,7 +101,7 @@ class TangentFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask UNUSED(mask)) const final { if (component.type() == GEO_COMPONENT_TYPE_CURVE) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc b/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc index 12582f9e9c6..21ef8765e43 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc @@ -49,7 +49,7 @@ static void add_instances_from_component( const GeoNodeExecParams ¶ms, const Map &attributes_to_propagate) { - const AttributeDomain domain = ATTR_DOMAIN_POINT; + const eAttrDomain domain = ATTR_DOMAIN_POINT; const int domain_num = src_component.attribute_domain_num(domain); VArray pick_instance; diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc index 2067086c298..0c56b0e9804 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc @@ -47,8 +47,8 @@ static Map get_final_attribute_info( static void fill_new_attribute(Span src_components, const AttributeIDRef &attribute_id, - const CustomDataType data_type, - const AttributeDomain domain, + const eCustomDataType data_type, + const eAttrDomain domain, GMutableSpan dst_span) { const CPPType *cpp_type = bke::custom_data_type_to_cpp_type(data_type); diff --git a/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc index c245260f259..5875606da97 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc @@ -51,7 +51,7 @@ class MaterialSelectionFieldInput final : public GeometryFieldInput { } GVArray get_varray_for_context(const GeometryComponent &component, - const AttributeDomain domain, + const eAttrDomain domain, IndexMask mask) const final { if (component.type() != GEO_COMPONENT_TYPE_MESH) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc index 6b23b685549..7463eb01471 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc @@ -58,7 +58,7 @@ static void geometry_set_mesh_to_points(GeometrySet &geometry_set, Field &position_field, Field &radius_field, Field &selection_field, - const AttributeDomain domain) + const eAttrDomain domain) { const MeshComponent *mesh_component = geometry_set.get_component_for_read(); if (mesh_component == nullptr) { @@ -105,7 +105,7 @@ static void geometry_set_mesh_to_points(GeometrySet &geometry_set, for (Map::Item entry : attributes.items()) { const AttributeIDRef attribute_id = entry.key; - const CustomDataType data_type = entry.value.data_type; + const eCustomDataType data_type = entry.value.data_type; GVArray src = mesh_component->attribute_get_for_read(attribute_id, domain, data_type); OutputAttribute dst = point_component.attribute_try_get_for_output_only( attribute_id, ATTR_DOMAIN_POINT, data_type); diff --git a/source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc b/source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc index 577b001fd06..00b3d167755 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_points_to_vertices.cc @@ -59,7 +59,7 @@ static void geometry_set_points_to_vertices(GeometrySet &geometry_set, for (Map::Item entry : attributes.items()) { const AttributeIDRef attribute_id = entry.key; - const CustomDataType data_type = entry.value.data_type; + const eCustomDataType data_type = entry.value.data_type; GVArray src = point_component->attribute_get_for_read( attribute_id, ATTR_DOMAIN_POINT, data_type); OutputAttribute dst = mesh_component.attribute_try_get_for_output_only( diff --git a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc index 0c30d50076f..a92cee2d066 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc @@ -70,7 +70,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { const NodeGeometryRaycast &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); bNodeSocket *socket_vector = (bNodeSocket *)BLI_findlink(&node->inputs, 1); bNodeSocket *socket_float = socket_vector->next; @@ -104,7 +104,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.inputs().take_back(3)); search_link_ops_for_declarations(params, declaration.outputs().take_front(4)); - const std::optional type = node_data_type_to_custom_data_type( + const std::optional type = node_data_type_to_custom_data_type( (eNodeSocketDatatype)params.other_socket().type); if (type && *type != CD_PROP_STRING) { /* The input and output sockets have the same name. */ @@ -215,7 +215,7 @@ class RaycastFunction : public fn::MultiFunction { /* Always evaluate the target domain data on the face corner domain because it contains the most * information. Eventually this could be exposed as an option or determined automatically from * the field inputs for better performance. */ - const AttributeDomain domain_ = ATTR_DOMAIN_CORNER; + const eAttrDomain domain_ = ATTR_DOMAIN_CORNER; fn::MFSignature signature_; @@ -320,7 +320,7 @@ class RaycastFunction : public fn::MultiFunction { } }; -static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const CustomDataType data_type) +static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustomDataType data_type) { switch (data_type) { case CD_PROP_FLOAT: @@ -387,7 +387,7 @@ static void node_geo_exec(GeoNodeExecParams params) GeometrySet target = params.extract_input("Target Geometry"); const NodeGeometryRaycast &storage = node_storage(params.node()); const GeometryNodeRaycastMapMode mapping = (GeometryNodeRaycastMapMode)storage.mapping; - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); if (target.is_empty()) { params.set_default_remaining_outputs(); diff --git a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc index ecda35f6363..da42b8c5ee0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc @@ -55,7 +55,7 @@ static void node_geo_exec(GeoNodeExecParams params) }); if (attribute_exists && !cannot_delete) { - params.used_named_attribute(name, NamedAttributeUsage::Remove); + params.used_named_attribute(name, eNamedAttrUsage::Remove); } if (!attribute_exists) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc index 7923ad6264d..698efa8865d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc @@ -397,7 +397,7 @@ static void scale_edges_on_axis(MeshComponent &mesh_component, const AxisScaleFi static void node_geo_exec(GeoNodeExecParams params) { const bNode &node = params.node(); - const AttributeDomain domain = static_cast(node.custom1); + const eAttrDomain domain = static_cast(node.custom1); const GeometryNodeScaleElementsMode scale_mode = static_cast( node.custom2); diff --git a/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc index a48d422e4c0..22712c873a3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc @@ -43,7 +43,7 @@ static void node_geo_exec(GeoNodeExecParams params) const Field selection_field = params.extract_input>("Selection"); const NodeGeometrySeparateGeometry &storage = node_storage(params.node()); - const AttributeDomain domain = static_cast(storage.domain); + const eAttrDomain domain = static_cast(storage.domain); auto separate_geometry_maybe_recursively = [&](GeometrySet &geometry_set, bool invert) { bool is_error; diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_id.cc b/source/blender/nodes/geometry/nodes/node_geo_set_id.cc index ec95f9a89f5..87d48daddea 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_id.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_id.cc @@ -16,9 +16,9 @@ static void set_id_in_component(GeometryComponent &component, const Field &selection_field, const Field &id_field) { - const AttributeDomain domain = (component.type() == GEO_COMPONENT_TYPE_INSTANCES) ? - ATTR_DOMAIN_INSTANCE : - ATTR_DOMAIN_POINT; + const eAttrDomain domain = (component.type() == GEO_COMPONENT_TYPE_INSTANCES) ? + ATTR_DOMAIN_INSTANCE : + ATTR_DOMAIN_POINT; GeometryComponentFieldContext field_context{component, domain}; const int domain_num = component.attribute_domain_num(domain); if (domain_num == 0) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc index caf33108716..e9ed87e552f 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc @@ -25,7 +25,7 @@ static void node_declare(NodeDeclarationBuilder &b) static void set_computed_position_and_offset(GeometryComponent &component, const VArray &in_positions, const VArray &in_offsets, - const AttributeDomain domain, + const eAttrDomain domain, const IndexMask selection) { @@ -139,9 +139,8 @@ static void set_position_in_component(GeometryComponent &component, const Field &position_field, const Field &offset_field) { - AttributeDomain domain = component.type() == GEO_COMPONENT_TYPE_INSTANCES ? - ATTR_DOMAIN_INSTANCE : - ATTR_DOMAIN_POINT; + eAttrDomain domain = component.type() == GEO_COMPONENT_TYPE_INSTANCES ? ATTR_DOMAIN_INSTANCE : + ATTR_DOMAIN_POINT; GeometryComponentFieldContext field_context{component, domain}; const int domain_num = component.attribute_domain_num(domain); if (domain_num == 0) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc index 669740f27cb..7ccdae2e5a6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc @@ -45,7 +45,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { const NodeGeometryStoreNamedAttribute &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); bNodeSocket *socket_geometry = (bNodeSocket *)node->inputs.first; bNodeSocket *socket_name = socket_geometry->next; @@ -69,7 +69,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.inputs().take_front(2)); if (params.in_out() == SOCK_OUT) { - const std::optional type = node_data_type_to_custom_data_type( + const std::optional type = node_data_type_to_custom_data_type( static_cast(params.other_socket().type)); if (type && *type != CD_PROP_STRING) { /* The input and output sockets have the same name. */ @@ -84,7 +84,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) static void try_capture_field_on_geometry(GeometryComponent &component, const StringRef name, - const AttributeDomain domain, + const eAttrDomain domain, const GField &field) { GeometryComponentFieldContext field_context{component, domain}; @@ -92,7 +92,7 @@ static void try_capture_field_on_geometry(GeometryComponent &component, const IndexMask mask{IndexMask(domain_num)}; const CPPType &type = field.cpp_type(); - const CustomDataType data_type = bke::cpp_type_to_custom_data_type(type); + const eCustomDataType data_type = bke::cpp_type_to_custom_data_type(type); /* Could avoid allocating a new buffer if: * - We are writing to an attribute that exists already. @@ -137,11 +137,11 @@ static void node_geo_exec(GeoNodeExecParams params) return; } - params.used_named_attribute(name, NamedAttributeUsage::Write); + params.used_named_attribute(name, eNamedAttrUsage::Write); const NodeGeometryStoreNamedAttribute &storage = node_storage(params.node()); - const CustomDataType data_type = static_cast(storage.data_type); - const AttributeDomain domain = static_cast(storage.domain); + const eCustomDataType data_type = static_cast(storage.data_type); + const eAttrDomain domain = static_cast(storage.domain); GField field; switch (data_type) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc index dca214660c8..0af6c76feaf 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc @@ -81,7 +81,7 @@ static void node_init(bNodeTree *UNUSED(tree), bNode *node) static void node_update(bNodeTree *ntree, bNode *node) { const NodeGeometryTransferAttribute &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); const GeometryNodeAttributeTransferMode mapping = (GeometryNodeAttributeTransferMode) storage.mode; @@ -123,7 +123,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.inputs().take_back(2)); search_link_ops_for_declarations(params, declaration.inputs().take_front(1)); - const std::optional type = node_data_type_to_custom_data_type( + const std::optional type = node_data_type_to_custom_data_type( (eNodeSocketDatatype)params.other_socket().type); if (type && *type != CD_PROP_STRING) { /* The input and output sockets have the same name. */ @@ -356,7 +356,7 @@ void copy_with_indices_and_comparison(const VArray &src_1, static bool component_is_available(const GeometrySet &geometry, const GeometryComponentType type, - const AttributeDomain domain) + const eAttrDomain domain) { if (!geometry.has(type)) { return false; @@ -383,7 +383,7 @@ class NearestInterpolatedTransferFunction : public fn::MultiFunction { * future, it should be possible to use the most complex domain required by the field inputs, to * simplify sampling and avoid domain conversions. */ - AttributeDomain domain_ = ATTR_DOMAIN_CORNER; + eAttrDomain domain_ = ATTR_DOMAIN_CORNER; fn::MFSignature signature_; @@ -449,7 +449,7 @@ class NearestInterpolatedTransferFunction : public fn::MultiFunction { class NearestTransferFunction : public fn::MultiFunction { GeometrySet source_; GField src_field_; - AttributeDomain domain_; + eAttrDomain domain_; fn::MFSignature signature_; @@ -466,7 +466,7 @@ class NearestTransferFunction : public fn::MultiFunction { const GVArray *point_data_; public: - NearestTransferFunction(GeometrySet geometry, GField src_field, AttributeDomain domain) + NearestTransferFunction(GeometrySet geometry, GField src_field, eAttrDomain domain) : source_(std::move(geometry)), src_field_(std::move(src_field)), domain_(domain) { source_.ensure_owns_direct_data(); @@ -599,7 +599,7 @@ class NearestTransferFunction : public fn::MultiFunction { }; static const GeometryComponent *find_source_component(const GeometrySet &geometry, - const AttributeDomain domain) + const eAttrDomain domain) { /* Choose the other component based on a consistent order, rather than some more complicated * heuristic. This is the same order visible in the spreadsheet and used in the ray-cast node. */ @@ -624,7 +624,7 @@ static const GeometryComponent *find_source_component(const GeometrySet &geometr class IndexTransferFunction : public fn::MultiFunction { GeometrySet src_geometry_; GField src_field_; - AttributeDomain domain_; + eAttrDomain domain_; fn::MFSignature signature_; @@ -633,7 +633,7 @@ class IndexTransferFunction : public fn::MultiFunction { const GVArray *src_data_ = nullptr; public: - IndexTransferFunction(GeometrySet geometry, GField src_field, const AttributeDomain domain) + IndexTransferFunction(GeometrySet geometry, GField src_field, const eAttrDomain domain) : src_geometry_(std::move(geometry)), src_field_(std::move(src_field)), domain_(domain) { src_geometry_.ensure_owns_direct_data(); @@ -684,7 +684,7 @@ class IndexTransferFunction : public fn::MultiFunction { } }; -static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const CustomDataType data_type) +static GField get_input_attribute_field(GeoNodeExecParams ¶ms, const eCustomDataType data_type) { switch (data_type) { case CD_PROP_FLOAT: @@ -737,8 +737,8 @@ static void node_geo_exec(GeoNodeExecParams params) const NodeGeometryTransferAttribute &storage = node_storage(params.node()); const GeometryNodeAttributeTransferMode mapping = (GeometryNodeAttributeTransferMode) storage.mode; - const CustomDataType data_type = static_cast(storage.data_type); - const AttributeDomain domain = static_cast(storage.domain); + const eCustomDataType data_type = static_cast(storage.data_type); + const eAttrDomain domain = static_cast(storage.domain); GField field = get_input_attribute_field(params, data_type); diff --git a/source/blender/nodes/geometry/nodes/node_geo_viewer.cc b/source/blender/nodes/geometry/nodes/node_geo_viewer.cc index 8e9d7b0e46d..6979693e215 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_viewer.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_viewer.cc @@ -39,7 +39,7 @@ static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE); } -static eNodeSocketDatatype custom_data_type_to_socket_type(const CustomDataType type) +static eNodeSocketDatatype custom_data_type_to_socket_type(const eCustomDataType type) { switch (type) { case CD_PROP_FLOAT: @@ -61,7 +61,7 @@ static eNodeSocketDatatype custom_data_type_to_socket_type(const CustomDataType static void node_update(bNodeTree *ntree, bNode *node) { const NodeGeometryViewer &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); const eNodeSocketDatatype socket_type = custom_data_type_to_socket_type(data_type); LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) { @@ -82,7 +82,7 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) ED_spreadsheet_context_paths_set_geometry_node(bmain, snode, &viewer_node); }; - const std::optional type = node_socket_to_custom_data_type( + const std::optional type = node_socket_to_custom_data_type( params.other_socket()); if (params.in_out() == SOCK_OUT) { /* The viewer node only has inputs. */ diff --git a/source/blender/nodes/intern/geometry_nodes_eval_log.cc b/source/blender/nodes/intern/geometry_nodes_eval_log.cc index 9a316190720..85dfdf03b82 100644 --- a/source/blender/nodes/intern/geometry_nodes_eval_log.cc +++ b/source/blender/nodes/intern/geometry_nodes_eval_log.cc @@ -495,7 +495,7 @@ void LocalGeoLogger::log_execution_time(DNode node, std::chrono::microseconds ex void LocalGeoLogger::log_used_named_attribute(DNode node, std::string attribute_name, - NamedAttributeUsage usage) + eNamedAttrUsage usage) { used_named_attributes_.append({node, {std::move(attribute_name), usage}}); } diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc index 9aee3ddcce7..27ad12ba252 100644 --- a/source/blender/nodes/intern/node_geometry_exec.cc +++ b/source/blender/nodes/intern/node_geometry_exec.cc @@ -24,7 +24,7 @@ void GeoNodeExecParams::error_message_add(const NodeWarningType type, std::strin } void GeoNodeExecParams::used_named_attribute(std::string attribute_name, - const NamedAttributeUsage usage) + const eNamedAttrUsage usage) { if (provider_->logger == nullptr) { return; @@ -112,8 +112,8 @@ const bNodeSocket *GeoNodeExecParams::find_available_socket(const StringRef name GVArray GeoNodeExecParams::get_input_attribute(const StringRef name, const GeometryComponent &component, - const AttributeDomain domain, - const CustomDataType type, + const eAttrDomain domain, + const eCustomDataType type, const void *default_value) const { const bNodeSocket *found_socket = this->find_available_socket(name); @@ -176,10 +176,10 @@ GVArray GeoNodeExecParams::get_input_attribute(const StringRef name, return GVArray::ForSingle(*cpp_type, domain_num, default_value); } -CustomDataType GeoNodeExecParams::get_input_attribute_data_type( +eCustomDataType GeoNodeExecParams::get_input_attribute_data_type( const StringRef name, const GeometryComponent &component, - const CustomDataType default_type) const + const eCustomDataType default_type) const { const bNodeSocket *found_socket = this->find_available_socket(name); BLI_assert(found_socket != nullptr); /* There should always be available socket for the name. */ @@ -212,12 +212,12 @@ CustomDataType GeoNodeExecParams::get_input_attribute_data_type( return default_type; } -AttributeDomain GeoNodeExecParams::get_highest_priority_input_domain( +eAttrDomain GeoNodeExecParams::get_highest_priority_input_domain( Span names, const GeometryComponent &component, - const AttributeDomain default_domain) const + const eAttrDomain default_domain) const { - Vector input_domains; + Vector input_domains; for (const std::string &name : names) { const bNodeSocket *found_socket = this->find_available_socket(name); BLI_assert(found_socket != nullptr); /* A socket should be available socket for the name. */ diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc index a487e07bd5a..5fc69987c67 100644 --- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc +++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc @@ -53,7 +53,7 @@ static void node_shader_buts_map_range(uiLayout *layout, bContext *UNUSED(C), Po static int node_shader_map_range_ui_class(const bNode *node) { const NodeMapRange &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); if (data_type == CD_PROP_FLOAT3) { return NODE_CLASS_OP_VECTOR; } @@ -63,7 +63,7 @@ static int node_shader_map_range_ui_class(const bNode *node) static void node_shader_update_map_range(bNodeTree *ntree, bNode *node) { const NodeMapRange &storage = node_storage(*node); - const CustomDataType data_type = static_cast(storage.data_type); + const eCustomDataType data_type = static_cast(storage.data_type); const int type = (data_type == CD_PROP_FLOAT) ? SOCK_FLOAT : SOCK_VECTOR; Array new_input_availability(BLI_listbase_count(&node->inputs)); @@ -108,7 +108,7 @@ static void node_shader_init_map_range(bNodeTree *UNUSED(ntree), bNode *node) class SocketSearchOp { public: std::string socket_name; - CustomDataType data_type; + eCustomDataType data_type; int interpolation_type = NODE_MAP_RANGE_LINEAR; void operator()(LinkSearchOpParams ¶ms) @@ -120,7 +120,7 @@ class SocketSearchOp { } }; -static std::optional node_type_from_other_socket(const bNodeSocket &socket) +static std::optional node_type_from_other_socket(const bNodeSocket &socket) { switch (socket.type) { case SOCK_FLOAT: @@ -137,7 +137,7 @@ static std::optional node_type_from_other_socket(const bNodeSock static void node_map_range_gather_link_searches(GatherLinkSearchOpParams ¶ms) { - const std::optional type = node_type_from_other_socket(params.other_socket()); + const std::optional type = node_type_from_other_socket(params.other_socket()); if (!type) { return; } diff --git a/source/blender/nodes/shader/nodes/node_shader_uvmap.cc b/source/blender/nodes/shader/nodes/node_shader_uvmap.cc index 91d89952da7..53228f0a314 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvmap.cc +++ b/source/blender/nodes/shader/nodes/node_shader_uvmap.cc @@ -46,7 +46,7 @@ static int node_shader_gpu_uvmap(GPUMaterial *mat, NodeShaderUVMap *attr = static_cast(node->storage); /* NOTE: using CD_AUTO_FROM_NAME instead of CD_MTFACE as geometry nodes may overwrite data which - * will also change the CustomDataType. This will also make EEVEE and Cycles consistent. See + * will also change the eCustomDataType. This will also make EEVEE and Cycles consistent. See * T93179. */ GPUNodeLink *mtface = GPU_attribute(mat, CD_AUTO_FROM_NAME, attr->uv_map); diff --git a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc index cba944c671c..830f02d8df1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc @@ -43,7 +43,7 @@ static int node_shader_gpu_vertex_color(GPUMaterial *mat, { NodeShaderVertexColor *vertexColor = (NodeShaderVertexColor *)node->storage; /* NOTE: using CD_AUTO_FROM_NAME instead of CD_MCOL or CD_PROP_COLOR for named attributes - * as geometry nodes may overwrite data which will also change the CustomDataType. + * as geometry nodes may overwrite data which will also change the eCustomDataType. * This will also make EEVEE and Cycles * consistent. See T93179. */ -- cgit v1.2.3