[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25478] trunk/blender/source/blender: Fix preview do_version bug (causing region type missing errors)

Martin Poirier theeth at yahoo.com
Sat Dec 19 23:40:45 CET 2009


Revision: 25478
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25478
Author:   theeth
Date:     2009-12-19 23:40:45 +0100 (Sat, 19 Dec 2009)

Log Message:
-----------
Fix preview do_version bug (causing region type missing errors)

The missing region was added to the wrong region base.

Bump the subversion, new code to fix wrong region layouts saved in previous subversion and correct all old files correctly.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_blender.h
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_blender.h	2009-12-19 22:37:51 UTC (rev 25477)
+++ trunk/blender/source/blender/blenkernel/BKE_blender.h	2009-12-19 22:40:45 UTC (rev 25478)
@@ -43,7 +43,7 @@
 struct ReportList;
 
 #define BLENDER_VERSION			250
-#define BLENDER_SUBVERSION		10
+#define BLENDER_SUBVERSION		11
 
 #define BLENDER_MINVERSION		250
 #define BLENDER_MINSUBVERSION	0

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2009-12-19 22:37:51 UTC (rev 25477)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2009-12-19 22:40:45 UTC (rev 25478)
@@ -139,6 +139,7 @@
 #include "BKE_report.h"
 #include "BKE_sca.h" // for init_actuator
 #include "BKE_scene.h"
+#include "BKE_screen.h"
 #include "BKE_softbody.h"	// sbNew()
 #include "BKE_bullet.h"		// bsbNew()
 #include "BKE_sequencer.h"
@@ -10194,40 +10195,88 @@
 
 	if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 10))
 	{
-		{
-			Object *ob;
-			
-			/* properly initialise hair clothsim data on old files */
-			for(ob = main->object.first; ob; ob = ob->id.next) {
-				ModifierData *md;
-				for(md= ob->modifiers.first; md; md= md->next) {
-					if (md->type == eModifierType_Cloth) {
-						ClothModifierData *clmd = (ClothModifierData *)md;
-						if (clmd->sim_parms->velocity_smooth < 0.01f)
-							clmd->sim_parms->velocity_smooth = 0.f;
+		Object *ob;
+
+		/* properly initialise hair clothsim data on old files */
+		for(ob = main->object.first; ob; ob = ob->id.next) {
+			ModifierData *md;
+			for(md= ob->modifiers.first; md; md= md->next) {
+				if (md->type == eModifierType_Cloth) {
+					ClothModifierData *clmd = (ClothModifierData *)md;
+					if (clmd->sim_parms->velocity_smooth < 0.01f)
+						clmd->sim_parms->velocity_smooth = 0.f;
+				}
+			}
+		}
+	}
+
+	/* fix bad area setup in subversion 10 */
+	if (main->versionfile == 250 && main->subversionfile == 10)
+	{
+		/* fix for new view type in sequencer */
+		bScreen *screen;
+		ScrArea *sa;
+		SpaceLink *sl;
+
+
+		/* remove all preview window in wrong spaces */
+		for(screen= main->screen.first; screen; screen= screen->id.next) {
+			for(sa= screen->areabase.first; sa; sa= sa->next) {
+				for(sl= sa->spacedata.first; sl; sl= sl->next) {
+					if(sl->spacetype!=SPACE_SEQ) {
+						ARegion *ar;
+
+						for( ar = sl->regionbase.first; ar; ar = ar->next) {
+							if (ar->regiontype == RGN_TYPE_PREVIEW)
+								break;
+						}
+
+						if (ar) {
+							SpaceType *st= BKE_spacetype_from_id(SPACE_SEQ);
+							BKE_area_region_free(st, ar);
+							BLI_freelinkN(&sl->regionbase, ar);
+						}
 					}
 				}
+				if(sa->spacetype!=SPACE_SEQ) {
+					ARegion *ar;
+
+					for( ar = sa->regionbase.first; ar; ar = ar->next) {
+						if (ar->regiontype == RGN_TYPE_PREVIEW)
+							break;
+					}
+
+					if (ar) {
+						SpaceType *st= BKE_spacetype_from_id(SPACE_SEQ);
+						BKE_area_region_free(st, ar);
+						BLI_freelinkN(&sa->regionbase, ar);
+					}
+				}
 			}
 		}
+	}
+
+	if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 11))
+	{
 		{
 			/* fix for new view type in sequencer */
 			bScreen *screen;
 			ScrArea *sa;
 			SpaceLink *sl;
-			
 
+
 			for(screen= main->screen.first; screen; screen= screen->id.next) {
 				for(sa= screen->areabase.first; sa; sa= sa->next) {
 					for(sl= sa->spacedata.first; sl; sl= sl->next) {
 						if(sl->spacetype==SPACE_SEQ) {
 							ARegion *ar;
 							ARegion *ar_main;
-							ListBase *lb = &sa->regionbase;
+							ListBase *lb = &sl->regionbase;
 							SpaceSeq *sseq = (SpaceSeq *)sl;
 
 							if (sseq->view == 0) sseq->view = SEQ_VIEW_SEQUENCE;
 							if (sseq->mainb == 0) sseq->mainb = SEQ_DRAW_IMG_IMBUF;
-							
+
 							ar_main = (ARegion*)lb->first;
 							for (; ar_main; ar_main = ar_main->next) {
 								if (ar_main->regiontype == RGN_TYPE_WINDOW)





More information about the Bf-blender-cvs mailing list