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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-05-07 16:16:10 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-05-07 16:19:32 +0300
commitaa3fc89257f839260e7577881f399011a709badf (patch)
tree2f804ffb355dc2c5659697a841c68f9da5d60fa4 /source/blender/blenkernel/intern/object.c
parent15fd37fab23ad906942726162a677d9254a94be4 (diff)
Fix T44611: 'make_links_data' modifiers would fail and crash with multires modifier.
Since it was not ensuring dest has valid mdisp data matching new multires modifier subdiv level... Also, fixed a bug in `multires_subdivide()`, which would crash when trying to increase from level 0 (aka no subdiv) to > 1 (wrong check, trying to interpolate when it should not). And added a few sanity checks.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index bd0b7275174..5b29187e7cd 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -96,6 +96,7 @@
#include "BKE_editmesh.h"
#include "BKE_mball.h"
#include "BKE_modifier.h"
+#include "BKE_multires.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_paint.h"
@@ -280,6 +281,12 @@ void BKE_object_link_modifiers(struct Object *ob_dst, struct Object *ob_src)
nmd = modifier_new(md->type);
BLI_strncpy(nmd->name, md->name, sizeof(nmd->name));
+
+ if (md->type == eModifierType_Multires) {
+ /* Has to be done after mod creation, but *before* we actually copy its settings! */
+ multiresModifier_sync_levels_ex(ob_dst, (MultiresModifierData *)md, (MultiresModifierData *)nmd);
+ }
+
modifier_copyData(md, nmd);
BLI_addtail(&ob_dst->modifiers, nmd);
modifier_unique_name(&ob_dst->modifiers, nmd);