[Bf-blender-cvs] [325ab1a7883] soc-2020-soft-body: using legacy as default to pass unit test

mattoverby noreply at git.blender.org
Thu Aug 13 17:06:10 CEST 2020


Commit: 325ab1a7883d81f3be40d76168dfdfc048141b18
Author: mattoverby
Date:   Thu Aug 13 10:06:06 2020 -0500
Branches: soc-2020-soft-body
https://developer.blender.org/rB325ab1a7883d81f3be40d76168dfdfc048141b18

using legacy as default to pass unit test

===================================================================

M	extern/discregrid/discregrid/src/geometry/mesh_distance.cpp
M	source/blender/blenkernel/intern/softbody.c

===================================================================

diff --git a/extern/discregrid/discregrid/src/geometry/mesh_distance.cpp b/extern/discregrid/discregrid/src/geometry/mesh_distance.cpp
index 297fcffb3b5..33f84dffc49 100755
--- a/extern/discregrid/discregrid/src/geometry/mesh_distance.cpp
+++ b/extern/discregrid/discregrid/src/geometry/mesh_distance.cpp
@@ -83,8 +83,10 @@ MeshDistance::distance(Vector3d const& x, Vector3d* nearest_point,
 {
 	using namespace std::placeholders;
 
+	int thread_num = get_thread_num();
+
 	auto dist_candidate = std::numeric_limits<double>::max();
-	auto f = m_nearest_face[get_thread_num()];
+	auto f = m_nearest_face[thread_num];
 	if (f < m_mesh.nFaces())
 	{
 		auto t = std::array<Vector3d const*, 3>{
@@ -115,11 +117,11 @@ MeshDistance::distance(Vector3d const& x, Vector3d* nearest_point,
 		return d0_2 < d1_2;
 	};
 
-	while (!m_queues[get_thread_num()].empty())
-		m_queues[get_thread_num()].pop();
+	while (!m_queues[thread_num].empty())
+		m_queues[thread_num].pop();
 	m_bsh.traverseDepthFirst(pred, cb, pless);
 
-	f = m_nearest_face[get_thread_num()];
+	f = m_nearest_face[thread_num];
 	if (nearest_point)
 	{
 		auto t = std::array<Vector3d const*, 3>{
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 4c4aa450de2..443c8fa00a4 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -3123,7 +3123,7 @@ SoftBody *sbNew(Scene *scene)
   SoftBody *sb;
   sb = MEM_callocN(sizeof(SoftBody), "softbody");
 
-  sb->solver_mode = SOLVER_MODE_ADMMPD;
+  sb->solver_mode = SOLVER_MODE_LEGACY;//SOLVER_MODE_ADMMPD;
   sb->admmpd_mesh_mode = 0; // embedded
   sb->admmpd_substeps = 1;
   sb->admmpd_max_admm_iters = 20;



More information about the Bf-blender-cvs mailing list