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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-15 12:48:11 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-15 12:48:11 +0400
commitac07f8983865d3bddd583210f40538f116403b92 (patch)
tree160c0ca81a343a5453d7ff28c0d30b6da8fae348 /source/blender/blenkernel/intern/scene.c
parenta73d0d3e72940ecd0e3e60c8e4e858c7e00ff5e2 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c63
1 files 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) {