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>2018-09-06 18:06:17 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-09-11 17:37:02 +0300
commit3fbdcefa174dd85972b7b63c0955e3a8d42f6943 (patch)
tree6b1d4b1538f18e847f2e12204a79d89b937edc28 /source/blender/blenkernel/intern/mesh_runtime.c
parent998a80435819387ce88d922d7fd7049e8e27b7bf (diff)
Subdiv: Initial implementation of CCG
Attempts to substitude CCGDM with an OpenSubdiv based structure which has less abstraction levels. The missing part in this substitude is a face pointers which old CCGDM/multires code was using to stitch faces (averaging boundaries). Another curial bit missing: "reshaping" of multires CD_MDISPS to the state of new PBVH grids. The new code is only available when OpenSubdiv modifier is enabled (WITH_OPENSUBDIV_MODIFIER=ON) and with debug value of 128. This is so this WIP code is not interfering with current production machines in the studio. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D3685
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_runtime.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_runtime.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_runtime.c b/source/blender/blenkernel/intern/mesh_runtime.c
index 60699589a77..51dd9a9ea3a 100644
--- a/source/blender/blenkernel/intern/mesh_runtime.c
+++ b/source/blender/blenkernel/intern/mesh_runtime.c
@@ -43,6 +43,7 @@
#include "BKE_bvhutils.h"
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
+#include "BKE_subdiv_ccg.h"
/* -------------------------------------------------------------------- */
/** \name Mesh Runtime Struct Utils
@@ -196,6 +197,11 @@ void BKE_mesh_runtime_clear_geometry(Mesh *mesh)
{
bvhcache_free(&mesh->runtime.bvh_cache);
MEM_SAFE_FREE(mesh->runtime.looptris.array);
+ /* TODO(sergey): Does this really belong here? */
+ if (mesh->runtime.subsurf_ccg != NULL) {
+ BKE_subdiv_ccg_destroy(mesh->runtime.subsurf_ccg);
+ mesh->runtime.subsurf_ccg = NULL;
+ }
}
/** \} */