From ac07f8983865d3bddd583210f40538f116403b92 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 15 Apr 2012 08:48:11 +0000 Subject: Fix #30948: add scene > copy settings did not copy settings like units, audio, game data, and tool settings. What exactly should be copied is a bit up to interpretation, but I think these make sense, and things like audio or game data used to be part of render settings which do get copied so at least for those it was a regression. --- source/blender/blenkernel/intern/scene.c | 63 ++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 7c242da9aff..c950a6ccdb5 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -123,6 +123,12 @@ Scene *copy_scene(Scene *sce, int type) lb= scen->r.layers; scen->r= sce->r; scen->r.layers= lb; + scen->unit= sce->unit; + scen->physics_settings= sce->physics_settings; + scen->gm= sce->gm; + scen->audio= sce->audio; + + MEM_freeN(scen->toolsettings); } else { scen= copy_libblock(&sce->id); @@ -137,37 +143,9 @@ Scene *copy_scene(Scene *sce, int type) scen->ed= NULL; scen->theDag= NULL; scen->obedit= NULL; - scen->toolsettings= MEM_dupallocN(sce->toolsettings); scen->stats= NULL; scen->fps_info= NULL; - ts= scen->toolsettings; - if (ts) { - if (ts->vpaint) { - ts->vpaint= MEM_dupallocN(ts->vpaint); - ts->vpaint->paintcursor= NULL; - ts->vpaint->vpaint_prev= NULL; - ts->vpaint->wpaint_prev= NULL; - copy_paint(&ts->vpaint->paint, &ts->vpaint->paint); - } - if (ts->wpaint) { - ts->wpaint= MEM_dupallocN(ts->wpaint); - ts->wpaint->paintcursor= NULL; - ts->wpaint->vpaint_prev= NULL; - ts->wpaint->wpaint_prev= NULL; - copy_paint(&ts->wpaint->paint, &ts->wpaint->paint); - } - if (ts->sculpt) { - ts->sculpt= MEM_dupallocN(ts->sculpt); - copy_paint(&ts->sculpt->paint, &ts->sculpt->paint); - } - - copy_paint(&ts->imapaint.paint, &ts->imapaint.paint); - ts->imapaint.paintcursor= NULL; - - ts->particle.paintcursor= NULL; - } - BLI_duplicatelist(&(scen->markers), &(sce->markers)); BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces)); BLI_duplicatelist(&(scen->r.layers), &(sce->r.layers)); @@ -188,6 +166,35 @@ Scene *copy_scene(Scene *sce, int type) base= base->next; } } + + /* tool settings */ + scen->toolsettings= MEM_dupallocN(sce->toolsettings); + + ts= scen->toolsettings; + if (ts) { + if (ts->vpaint) { + ts->vpaint= MEM_dupallocN(ts->vpaint); + ts->vpaint->paintcursor= NULL; + ts->vpaint->vpaint_prev= NULL; + ts->vpaint->wpaint_prev= NULL; + copy_paint(&ts->vpaint->paint, &ts->vpaint->paint); + } + if (ts->wpaint) { + ts->wpaint= MEM_dupallocN(ts->wpaint); + ts->wpaint->paintcursor= NULL; + ts->wpaint->vpaint_prev= NULL; + ts->wpaint->wpaint_prev= NULL; + copy_paint(&ts->wpaint->paint, &ts->wpaint->paint); + } + if (ts->sculpt) { + ts->sculpt= MEM_dupallocN(ts->sculpt); + copy_paint(&ts->sculpt->paint, &ts->sculpt->paint); + } + + copy_paint(&ts->imapaint.paint, &ts->imapaint.paint); + ts->imapaint.paintcursor= NULL; + ts->particle.paintcursor= NULL; + } /* make a private copy of the avicodecdata */ if (sce->r.avicodecdata) { -- cgit v1.2.3