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:
authorSebastian Parborg <darkdefende@gmail.com>2019-07-15 11:46:36 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-07-15 11:47:49 +0300
commit8fa50b522a10a3d8f2546d79410cfed35660e835 (patch)
treea719b8d8e1412a8990757b4a0f5a8bbc039a21f6 /source/blender/blenkernel/intern/dynamicpaint.c
parentbb165d6df10dcee953b55a52e169e5b9e6bac78e (diff)
Fix T66587: Can't bake second dynamic paint canvas to image sequence
The issue was the the copy data function didn't copy the active canvas number. So it would always be 0 and thus use the first canvas when trying to bake. Also fix not copying unused type data (unused canvas/brush settings). Reviewed By: Brecht Differential Revision: http://developer.blender.org/D5220
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index ef5e5bb24a8..16ce62da57e 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1216,9 +1216,11 @@ void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd,
{
/* Init modifier */
tpmd->type = pmd->type;
- if ((pmd->canvas && pmd->type == MOD_DYNAMICPAINT_TYPE_CANVAS) ||
- (pmd->brush && pmd->type == MOD_DYNAMICPAINT_TYPE_BRUSH)) {
- dynamicPaint_createType(tpmd, pmd->type, NULL);
+ if (pmd->canvas) {
+ dynamicPaint_createType(tpmd, MOD_DYNAMICPAINT_TYPE_CANVAS, NULL);
+ }
+ if (pmd->brush) {
+ dynamicPaint_createType(tpmd, MOD_DYNAMICPAINT_TYPE_BRUSH, NULL);
}
/* Copy data */
@@ -1230,6 +1232,8 @@ void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd,
dynamicPaint_freeSurface(tpmd, tpmd->canvas->surfaces.first);
}
+ tpmd->canvas->active_sur = pmd->canvas->active_sur;
+
/* copy existing surfaces */
for (surface = pmd->canvas->surfaces.first; surface; surface = surface->next) {
DynamicPaintSurface *t_surface = dynamicPaint_createNewSurface(tpmd->canvas, NULL);
@@ -1296,7 +1300,7 @@ void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd,
BLI_strncpy(t_surface->output_name2, surface->output_name2, sizeof(t_surface->output_name2));
}
}
- else if (tpmd->brush) {
+ if (tpmd->brush) {
DynamicPaintBrushSettings *brush = pmd->brush, *t_brush = tpmd->brush;
t_brush->pmd = tpmd;