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-03-27 19:24:24 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-04-01 10:32:46 +0300
commit60d3a801db3a848fa82bc4bece08e0d27c7b8ecf (patch)
tree4379896bc730ea9711d74fefc03cd8026a212a0e /source/blender/blenkernel/intern/subdiv_eval.c
parent29eb8916587be9bc58418937e86802b3d4eca4a3 (diff)
Subdiv: Split evaluation begin+refine into separate steps
Actually, begin will do the entire initialization. Refine will only refine if there is a topology refiner associated with the Subdiv descriptor. Allows to refine Subdiv to new coarse positions without touching displacement evaluation. Will be needed to update SubdivCCG during sculpt undo.
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_eval.c')
-rw-r--r--source/blender/blenkernel/intern/subdiv_eval.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_eval.c b/source/blender/blenkernel/intern/subdiv_eval.c
index 78e0e42753a..1c10a9a1935 100644
--- a/source/blender/blenkernel/intern/subdiv_eval.c
+++ b/source/blender/blenkernel/intern/subdiv_eval.c
@@ -121,13 +121,20 @@ static void set_face_varying_data_from_uv(Subdiv *subdiv,
}
}
-bool BKE_subdiv_eval_update_from_mesh(Subdiv *subdiv,
- const Mesh *mesh,
- const float (*coarse_vertex_cos)[3])
+bool BKE_subdiv_eval_begin_from_mesh(Subdiv *subdiv,
+ const Mesh *mesh,
+ const float (*coarse_vertex_cos)[3])
{
if (!BKE_subdiv_eval_begin(subdiv)) {
return false;
}
+ return BKE_subdiv_eval_refine_from_mesh(subdiv, mesh, coarse_vertex_cos);
+}
+
+bool BKE_subdiv_eval_refine_from_mesh(Subdiv *subdiv,
+ const Mesh *mesh,
+ const float (*coarse_vertex_cos)[3])
+{
if (subdiv->evaluator == NULL) {
/* NOTE: This situation is supposed to be handled by begin(). */
BLI_assert(!"Is not supposed to happen");