svn merge ^/trunk/blender -r47413:47423
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Jun 2012 16:56:51 +0000 (16:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Jun 2012 16:56:51 +0000 (16:56 +0000)
1  2 
source/blender/blenloader/intern/readfile.c

index 70bcf6c758ec51204e4133971681589165db3f45,826d9d196b86017616a9ce776bcd84e8dffde39c..4c82e10d717f545325d8d48781b8e4371096aa92
@@@ -1210,7 -1210,6 +1210,6 @@@ static void change_idid_adr_fd(FileDat
                if (old==entry->newp && entry->nr==ID_ID) {
                        entry->newp = new;
                        if (new) entry->nr = GS( ((ID *)new)->name );
-                       break;
                }
        }
  }
@@@ -6113,15 -6112,14 +6112,15 @@@ static void direct_link_movieReconstruc
        reconstruction->cameras = newdataadr(fd, reconstruction->cameras);
  }
  
 -static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
 +static void direct_link_movieTracks(FileData *fd, MovieClip *clip, ListBase *tracksbase)
  {
        MovieTrackingTrack *track;
        
        link_list(fd, tracksbase);
 -      
 +
        for (track = tracksbase->first; track; track = track->next) {
                track->markers = newdataadr(fd, track->markers);
 +              track->gpd = newlibadr_us(fd, clip->id.lib, track->gpd);
        }
  }
  
@@@ -6138,7 -6136,7 +6137,7 @@@ static void direct_link_movieclip(FileD
        if (fd->movieclipmap) clip->tracking.camera.intrinsics = newmclipadr(fd, clip->tracking.camera.intrinsics);
        else clip->tracking.camera.intrinsics = NULL;
  
 -      direct_link_movieTracks(fd, &tracking->tracks);
 +      direct_link_movieTracks(fd, clip, &tracking->tracks);
        direct_link_movieReconstruction(fd, &tracking->reconstruction);
  
        clip->tracking.act_track = newdataadr(fd, clip->tracking.act_track);
        link_list(fd, &tracking->objects);
        
        for (object = tracking->objects.first; object; object = object->next) {
 -              direct_link_movieTracks(fd, &object->tracks);
 +              direct_link_movieTracks(fd, clip, &object->tracks);
                direct_link_movieReconstruction(fd, &object->reconstruction);
        }
  }
@@@ -7043,9 -7041,12 +7042,9 @@@ static void do_versions(FileData *fd, L
                                        
                                track = clip->tracking.tracks.first;
                                while (track) {
 -                                      if (track->pyramid_levels == 0)
 -                                              track->pyramid_levels = 2;
 -                                      
                                        if (track->minimum_correlation == 0.0f)
                                                track->minimum_correlation = 0.75f;
 -                                      
 +
                                        track = track->next;
                                }
                        }
                
                for (clip= main->movieclip.first; clip; clip= clip->id.next) {
                        MovieTrackingSettings *settings= &clip->tracking.settings;
 -                      
 -                      if (settings->default_pyramid_levels == 0) {
 -                              settings->default_tracker= TRACKER_KLT;
 -                              settings->default_pyramid_levels = 2;
 +
 +                      if (settings->default_pattern_size == 0.0f) {
 +                              settings->default_motion_model = TRACK_MOTION_MODEL_TRANSLATION;
                                settings->default_minimum_correlation = 0.75;
                                settings->default_pattern_size = 11;
                                settings->default_search_size = 51;
                }
        }
  
-               bScreen *sc;
++
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 8))
+       {
+               /* set new deactivation values for game settings */
+               Scene *sce;
+               for (sce = main->scene.first; sce; sce = sce->id.next) {
+                       /* Game Settings */
+                       sce->gm.lineardeactthreshold = 0.8f;
+                       sce->gm.angulardeactthreshold = 1.0f;
+                       sce->gm.deactivationtime = 2.0f;
+               }
+       }
+       /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
+       /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
+       {
+               Scene *scene;
+               // composite redesign
+               for (scene=main->scene.first; scene; scene=scene->id.next) {
+                       if (scene->nodetree) {
+                               if (scene->nodetree->chunksize == 0) {
+                                       scene->nodetree->chunksize = 256;
+                               }
+                       }
+               }
+       }
 +      {
 +              MovieClip *clip;
 +
 +              for (clip = main->movieclip.first; clip; clip = clip->id.next) {
 +                      MovieTrackingTrack *track;
 +
 +                      track = clip->tracking.tracks.first;
 +                      while (track) {
 +                              int i;
 +
 +                              for (i = 0; i < track->markersnr; i++) {
 +                                      MovieTrackingMarker *marker = &track->markers[i];
 +
 +                                      if (is_zero_v2(marker->pattern_corners[0]) && is_zero_v2(marker->pattern_corners[1]) &&
 +                                          is_zero_v2(marker->pattern_corners[3]) && is_zero_v2(marker->pattern_corners[3]))
 +                                      {
 +                                              marker->pattern_corners[0][0] = track->pat_min[0];
 +                                              marker->pattern_corners[0][1] = track->pat_min[1];
 +
 +                                              marker->pattern_corners[1][0] = track->pat_max[0];
 +                                              marker->pattern_corners[1][1] = track->pat_min[1];
 +
 +                                              marker->pattern_corners[2][0] = track->pat_max[0];
 +                                              marker->pattern_corners[2][1] = track->pat_max[1];
 +
 +                                              marker->pattern_corners[3][0] = track->pat_min[0];
 +                                              marker->pattern_corners[3][1] = track->pat_max[1];
 +                                      }
 +
 +                                      if (is_zero_v2(marker->search_min) && is_zero_v2(marker->search_max)) {
 +                                              copy_v2_v2(marker->search_min, track->search_min);
 +                                              copy_v2_v2(marker->search_max, track->search_max);
 +                                      }
 +                              }
 +
 +                              track = track->next;
 +                      }
 +              }
++      }
++
+       {
+               bScreen *sc;
  
                for (sc = main->screen.first; sc; sc = sc->id.next) {
                        ScrArea *sa;
                }
        }
  
-       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 8))
-       {
-               /* set new deactivation values for game settings */
-               Scene *sce;
-               for (sce = main->scene.first; sce; sce = sce->id.next) {
-                       /* Game Settings */
-                       sce->gm.lineardeactthreshold = 0.8f;
-                       sce->gm.angulardeactthreshold = 1.0f;
-                       sce->gm.deactivationtime = 2.0f;
-               }
-       }
-       /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
-       /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
-       {
-               Scene *scene;
-               // composite redesign
-               for (scene=main->scene.first; scene; scene=scene->id.next) {
-                       if (scene->nodetree) {
-                               if (scene->nodetree->chunksize == 0) {
-                                       scene->nodetree->chunksize = 256;
-                               }
-                       }
-               }
-       }
-       
        /* don't forget to set version number in blender.c! */
  }