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:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-05-19 16:48:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-05-27 13:07:16 +0300
commit1e0de7c2ea74d0e390c8d306d70b46da1510d107 (patch)
treea9f7fa1ec563e92ba59f591bfb00eb76ddaeec74 /intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc
parent6a8193e505a33c1a09c9afd01630c7a56a6019f2 (diff)
OpenSubdiv: Compare edge topology
This change makes it so topology refiner comparison will check vertices of all existing/provided edges. The initial claim that due to manifold nature of mesh there is no need in "deep" edges check was wrong: some areas might only provide edges with non-zero creases. So if crease of one edge goes changes from 1.0 to 0.0 and crease of other edge goes from 0.0 to 1.0 the old comparison code would not have caught it.
Diffstat (limited to 'intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc')
-rw-r--r--intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc b/intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc
index 42f7b27adab..3506d93b7aa 100644
--- a/intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc
+++ b/intern/opensubdiv/internal/topology/topology_refiner_impl_compare.cc
@@ -226,9 +226,6 @@ bool checkGeometryFacesMatch(const TopologyRefinerImpl *topology_refiner_impl,
bool checkGeometryMatches(const TopologyRefinerImpl *topology_refiner_impl,
const OpenSubdiv_Converter *converter)
{
- // NOTE: Since OpenSubdiv's topology refiner doesn't contain loose edges, we
- // are only checking for faces to be matched. Changes in edges we don't care
- // here too much (they'll be checked for creases changes later).
return checkGeometryFacesMatch(topology_refiner_impl, converter);
}
@@ -279,9 +276,6 @@ bool checkUVLayersMatch(const TopologyRefinerImpl *topology_refiner_impl,
bool checkTopologyAttributesMatch(const TopologyRefinerImpl *topology_refiner_impl,
const OpenSubdiv_Converter *converter)
{
- if (!topology_refiner_impl->base_mesh_topology.isEqualToConverter(converter)) {
- return false;
- }
return checkUVLayersMatch(topology_refiner_impl, converter);
}
@@ -289,9 +283,21 @@ bool checkTopologyAttributesMatch(const TopologyRefinerImpl *topology_refiner_im
bool TopologyRefinerImpl::isEqualToConverter(const OpenSubdiv_Converter *converter) const
{
- return (blender::opensubdiv::checkPreliminaryMatches(this, converter) &&
- blender::opensubdiv::checkGeometryMatches(this, converter) &&
- blender::opensubdiv::checkTopologyAttributesMatch(this, converter));
+ if (!blender::opensubdiv::checkPreliminaryMatches(this, converter)) {
+ return false;
+ }
+ if (!blender::opensubdiv::checkGeometryMatches(this, converter)) {
+ return false;
+ }
+ if (!blender::opensubdiv::checkTopologyAttributesMatch(this, converter)) {
+ return false;
+ }
+
+ if (!base_mesh_topology.isEqualToConverter(converter)) {
+ return false;
+ }
+
+ return true;
}
} // namespace opensubdiv