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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-03-23 18:56:38 +0300
committerJacques Lucke <jacques@blender.org>2021-03-23 18:56:38 +0300
commit3a68dcb1e61e2be5757b8e7f45fa8a21d5cfb46f (patch)
tree9c27c83352ca165caeee958c49be8f4782e2ad48
parent9a2e623372cbdbffc0daf25427fdf72e1cdb9b51 (diff)
Cleanup: allow looking up size of unsupported domains
There isn't really a reason for not supporting it.
-rw-r--r--source/blender/blenkernel/intern/attribute_access.cc1
-rw-r--r--source/blender/blenkernel/intern/geometry_component_mesh.cc7
-rw-r--r--source/blender/blenkernel/intern/geometry_component_pointcloud.cc5
3 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index 2ab0b6ce531..6a8ceb467e7 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -703,7 +703,6 @@ bool GeometryComponent::attribute_domain_supported(const AttributeDomain domain)
int GeometryComponent::attribute_domain_size(const AttributeDomain UNUSED(domain)) const
{
- BLI_assert_unreachable();
return 0;
}
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc
index 5dc14104046..4e51f42876c 100644
--- a/source/blender/blenkernel/intern/geometry_component_mesh.cc
+++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc
@@ -165,7 +165,6 @@ bool MeshComponent::is_empty() const
int MeshComponent::attribute_domain_size(const AttributeDomain domain) const
{
- BLI_assert(this->attribute_domain_supported(domain));
if (mesh_ == nullptr) {
return 0;
}
@@ -179,7 +178,6 @@ int MeshComponent::attribute_domain_size(const AttributeDomain domain) const
case ATTR_DOMAIN_POLYGON:
return mesh_->totpoly;
default:
- BLI_assert_unreachable();
break;
}
return 0;
@@ -665,7 +663,6 @@ ReadAttributePtr MeshComponent::attribute_try_adapt_domain(ReadAttributePtr attr
case ATTR_DOMAIN_EDGE:
return blender::bke::adapt_mesh_domain_corner_to_edge(*mesh_, std::move(attribute));
default:
- BLI_assert(false);
break;
}
break;
@@ -679,7 +676,6 @@ ReadAttributePtr MeshComponent::attribute_try_adapt_domain(ReadAttributePtr attr
case ATTR_DOMAIN_EDGE:
return blender::bke::adapt_mesh_domain_point_to_edge(*mesh_, std::move(attribute));
default:
- BLI_assert(false);
break;
}
break;
@@ -693,7 +689,6 @@ ReadAttributePtr MeshComponent::attribute_try_adapt_domain(ReadAttributePtr attr
case ATTR_DOMAIN_EDGE:
return blender::bke::adapt_mesh_domain_polygon_to_edge(*mesh_, std::move(attribute));
default:
- BLI_assert(false);
break;
}
break;
@@ -707,13 +702,11 @@ ReadAttributePtr MeshComponent::attribute_try_adapt_domain(ReadAttributePtr attr
case ATTR_DOMAIN_POLYGON:
return blender::bke::adapt_mesh_domain_edge_to_polygon(*mesh_, std::move(attribute));
default:
- BLI_assert(false);
break;
}
break;
}
default:
- BLI_assert(false);
break;
}
diff --git a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc
index 073f457ae54..32c4ee8a6a6 100644
--- a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc
+++ b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc
@@ -115,11 +115,12 @@ bool PointCloudComponent::is_empty() const
int PointCloudComponent::attribute_domain_size(const AttributeDomain domain) const
{
- BLI_assert(domain == ATTR_DOMAIN_POINT);
- UNUSED_VARS_NDEBUG(domain);
if (pointcloud_ == nullptr) {
return 0;
}
+ if (domain != ATTR_DOMAIN_POINT) {
+ return 0;
+ }
return pointcloud_->totpoint;
}