diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-07 19:55:56 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-07 19:55:56 +0300 |
commit | 9fda23389758c80d97439a0f5ee718d0f898ff79 (patch) | |
tree | 889fd1d36729a7243f4147104cb869b18fcc64b9 /source/blender/blenkernel/intern | |
parent | d39e0f9616680042d67979424e400bdf8a4b89f4 (diff) |
Cleanup: Use const pointers in attribute API
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/attribute.cc | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curves.cc | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcloud.cc | 3 |
4 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index 1818befba4c..509161386cd 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -105,7 +105,7 @@ static CustomData *attribute_customdata_find(ID *id, CustomDataLayer *layer) return nullptr; } -bool BKE_id_attributes_supported(ID *id) +bool BKE_id_attributes_supported(const ID *id) { DomainInfo info[ATTR_DOMAIN_NUM]; get_domains(id, info); @@ -382,14 +382,14 @@ int BKE_id_attribute_data_length(ID *id, CustomDataLayer *layer) return 0; } -bool BKE_id_attribute_required(ID *id, CustomDataLayer *layer) +bool BKE_id_attribute_required(const ID *id, CustomDataLayer *layer) { switch (GS(id->name)) { case ID_PT: { - return BKE_pointcloud_customdata_required((PointCloud *)id, layer); + return BKE_pointcloud_customdata_required((const PointCloud *)id, layer); } case ID_CV: { - return BKE_curves_customdata_required((Curves *)id, layer); + return BKE_curves_customdata_required((const Curves *)id, layer); } default: return false; diff --git a/source/blender/blenkernel/intern/curves.cc b/source/blender/blenkernel/intern/curves.cc index 9abd5a7fdf0..a348e546e46 100644 --- a/source/blender/blenkernel/intern/curves.cc +++ b/source/blender/blenkernel/intern/curves.cc @@ -273,7 +273,7 @@ BoundBox *BKE_curves_boundbox_get(Object *ob) return ob->runtime.bb; } -bool BKE_curves_customdata_required(Curves *UNUSED(curves), CustomDataLayer *layer) +bool BKE_curves_customdata_required(const Curves *UNUSED(curves), CustomDataLayer *layer) { return layer->type == CD_PROP_FLOAT3 && STREQ(layer->name, ATTR_POSITION); } diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index e5b875cadf9..04a07fb42be 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1448,7 +1448,7 @@ static bool fill_texpaint_slots_cb(bNode *node, void *userdata) slot->attribute_name = storage->name; if (storage->type == SHD_ATTRIBUTE_GEOMETRY) { const Mesh *mesh = (const Mesh *)fill_data->ob->data; - CustomDataLayer *layer = BKE_id_attributes_color_find(&mesh->id, storage->name); + const CustomDataLayer *layer = BKE_id_attributes_color_find(&mesh->id, storage->name); slot->valid = layer != NULL; } diff --git a/source/blender/blenkernel/intern/pointcloud.cc b/source/blender/blenkernel/intern/pointcloud.cc index 9720c61e3b9..3e94a865de3 100644 --- a/source/blender/blenkernel/intern/pointcloud.cc +++ b/source/blender/blenkernel/intern/pointcloud.cc @@ -315,7 +315,8 @@ void BKE_pointcloud_update_customdata_pointers(PointCloud *pointcloud) CustomData_get_layer_named(&pointcloud->pdata, CD_PROP_FLOAT, POINTCLOUD_ATTR_RADIUS)); } -bool BKE_pointcloud_customdata_required(PointCloud *UNUSED(pointcloud), CustomDataLayer *layer) +bool BKE_pointcloud_customdata_required(const PointCloud *UNUSED(pointcloud), + CustomDataLayer *layer) { return layer->type == CD_PROP_FLOAT3 && STREQ(layer->name, POINTCLOUD_ATTR_POSITION); } |