Revision: 25388
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25388
Author:   elubie
Date:     2009-12-14 23:59:41 +0100 (Mon, 14 Dec 2009)

Log Message:
-----------
Sequencer:
* fix crash due to missing preview region
* had to bump up subversion to catch all files saved without preview region in 
sequencer.

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-14 
22:29:10 UTC (rev 25387)
+++ trunk/blender/source/blender/blenkernel/BKE_blender.h       2009-12-14 
22:59:41 UTC (rev 25388)
@@ -43,7 +43,7 @@
 struct ReportList;
 
 #define BLENDER_VERSION                        250
-#define BLENDER_SUBVERSION             9
+#define BLENDER_SUBVERSION             10
 
 #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-14 
22:29:10 UTC (rev 25387)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2009-12-14 
22:59:41 UTC (rev 25388)
@@ -5944,7 +5944,8 @@
 static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
 {
        ARegion *ar;
-       
+       ARegion *ar_main;
+
        if(sl) {
                /* first channels for ipo action nla... */
                switch(sl->spacetype) {
@@ -6004,10 +6005,16 @@
                                ar->alignment= RGN_ALIGN_TOP;
                                break;
                        case SPACE_SEQ:
+                               ar_main = (ARegion*)lb->first;
+                               for (; ar_main; ar_main = ar_main->next) {
+                                       if (ar_main->regiontype == 
RGN_TYPE_WINDOW)
+                                               break;
+                               }
                                ar= MEM_callocN(sizeof(ARegion), "preview area 
for sequencer");
-                               BLI_addtail(lb, ar);
-                               ar->regiontype= RGN_TYPE_UI;
+                               BLI_insertlinkbefore(lb, ar_main, ar);
+                               ar->regiontype= RGN_TYPE_PREVIEW;
                                ar->alignment= RGN_ALIGN_TOP;
+                               ar->flag |= RGN_FLAG_HIDDEN;
                                break;
                        case SPACE_VIEW3D:
                                /* toolbar */
@@ -10159,40 +10166,62 @@
                }
        }
 
-       /* put 2.50 compatibility code here until next subversion bump */
+       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 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) {
-                                               SpaceSeq *sseq = (SpaceSeq *)sl;
-                                               if (sseq->view == 0) sseq->view 
= SEQ_VIEW_SEQUENCE;
-                                               if (sseq->mainb == 0) 
sseq->mainb = SEQ_DRAW_IMG_IMBUF;
+               {
+                       /* 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;
+                                                       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)
+                                                                       break;
+                                                       }
+                                                       ar= 
MEM_callocN(sizeof(ARegion), "preview area for sequencer");
+                                                       
BLI_insertlinkbefore(lb, ar_main, ar);
+                                                       ar->regiontype= 
RGN_TYPE_PREVIEW;
+                                                       ar->alignment= 
RGN_ALIGN_TOP;
+                                                       ar->flag |= 
RGN_FLAG_HIDDEN;
+                                               }
                                        }
                                }
                        }
                }
        }
 
+       /* put 2.50 compatibility code here until next subversion bump */
+
+
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! 
*/
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to