[Bf-blender-cvs] [8fa50b522a1] master: Fix T66587: Can't bake second dynamic paint canvas to image sequence
Sebastian Parborg
noreply at git.blender.org
Mon Jul 15 10:47:47 CEST 2019
Commit: 8fa50b522a10a3d8f2546d79410cfed35660e835
Author: Sebastian Parborg
Date: Mon Jul 15 10:46:36 2019 +0200
Branches: master
https://developer.blender.org/rB8fa50b522a10a3d8f2546d79410cfed35660e835
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
===================================================================
M source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
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;
More information about the Bf-blender-cvs
mailing list