From 8fb0b9aebbd409216dec77c4b1bf2a2fbba80698 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 18 Mar 2019 15:56:16 +0100 Subject: Subdiv: Enable topology cache in edit mode The general idea of this change is to have a runtime data pointer in the ModifierData, so it can be preserved through copy-on-write updates by the dependency graph. This is where subdivision surface modifier can store its topology cache, so it is not getting trashed on every copy-on-write which is happening when moving a vertex. Similar mechanism should be used by multiresolution, dynamic paint and some other modifiers which cache evaluated data. This fixes T61746. Thing to keep in mind, that there are more reports about slow subdivision surface in the tracker, but that boils down to the fact that those have a lot of extraordinary vertices, and hence a lot slower to evaluated topology. Other thing is, this speeds up oeprations which doesn't change topology (i.e. moving vertices). Reviewers: brecht Reviewed By: brecht Maniphest Tasks: T61746 Differential Revision: https://developer.blender.org/D4541 --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9a886f494cf..93ef7fe5b73 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5458,6 +5458,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) for (md = lb->first; md; md = md->next) { md->error = NULL; + md->runtime = NULL; /* if modifiers disappear, or for upward compatibility */ if (NULL == modifierType_getInfo(md->type)) @@ -5467,7 +5468,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) SubsurfModifierData *smd = (SubsurfModifierData *)md; smd->emCache = smd->mCache = NULL; - smd->subdiv = NULL; } else if (md->type == eModifierType_Armature) { ArmatureModifierData *amd = (ArmatureModifierData *)md; -- cgit v1.2.3