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
This commit is contained in:
parent
bb165d6df1
commit
8fa50b522a
Notes:
blender-bot
2023-02-14 01:56:09 +01:00
Referenced by issue #66587, Can't bake second dynamic paint canvas to image sequence
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue