[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45646] trunk/blender/source/blender/ blenkernel/intern/scene.c: Fix #30948: add scene > copy settings did not copy settings like units, audio, game

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Apr 15 10:48:12 CEST 2012


Revision: 45646
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45646
Author:   blendix
Date:     2012-04-15 08:48:11 +0000 (Sun, 15 Apr 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/scene.c

Modified: trunk/blender/source/blender/blenkernel/intern/scene.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/scene.c	2012-04-15 07:54:07 UTC (rev 45645)
+++ trunk/blender/source/blender/blenkernel/intern/scene.c	2012-04-15 08:48:11 UTC (rev 45646)
@@ -123,6 +123,12 @@
 		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 @@
 		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 @@
 			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) {




More information about the Bf-blender-cvs mailing list