diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-06-19 13:25:41 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-06-19 13:25:41 +0300 |
commit | 0d5c7e5e36b96176139d8d0d55648e2019a43038 (patch) | |
tree | b234cf4d5b40a45d4bf4b7153edc846be4fae7a5 /source/blender/modifiers/intern/MOD_dynamicpaint.c | |
parent | e9aaf5ed211d5f71fd2934c8814143c15fd47d5e (diff) |
Fix (unreported) Dynamic Paint modifier not increasing ID usercount in copy function.
*Sigh* One more example of why we should keep ID management handling in
as few places as possible! It's impossible to keep more than a few
places in sync regarding which ID pointer is refcounted etc.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_dynamicpaint.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_dynamicpaint.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index bb75d655802..d54e052e438 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -36,6 +36,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_dynamicpaint.h" +#include "BKE_library.h" #include "BKE_library_query.h" #include "BKE_modifier.h" @@ -58,6 +59,15 @@ static void copyData(ModifierData *md, ModifierData *target) DynamicPaintModifierData *tpmd = (DynamicPaintModifierData *)target; dynamicPaint_Modifier_copy(pmd, tpmd); + + if (tpmd->canvas) { + for (DynamicPaintSurface *surface = tpmd->canvas->surfaces.first; surface; surface = surface->next) { + id_us_plus(surface->init_texture); + } + } + if (tpmd->brush) { + id_us_plus(tpmd->brush->mat); + } } static void freeData(ModifierData *md) |