Merging r42770 through r42799 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 21 Dec 2011 14:50:05 +0000 (14:50 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 21 Dec 2011 14:50:05 +0000 (14:50 +0000)
1  2 
source/blender/blenkernel/intern/movieclip.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c

index 04686e6a8976e3e19e6a58fd8869f68cdad068bb,736c889f66c7dd84df7b9f6e1d223222727f125a..5c9c59e53920925093af40e8d477b33bd9b04bac
@@@ -372,7 -372,10 +372,10 @@@ static MovieClip *movieclip_alloc(cons
        BKE_tracking_init_settings(&clip->tracking);
  
        clip->proxy.build_size_flag= IMB_PROXY_25;
-       clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN|IMB_TC_FREE_RUN|IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
+       clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN |
+                                  IMB_TC_FREE_RUN |
+                                  IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN |
+                                  IMB_TC_RECORD_RUN_NO_GAPS;
        clip->proxy.quality= 90;
  
        return clip;
@@@ -813,8 -816,7 +816,8 @@@ void BKE_movieclip_reload(MovieClip *cl
  
  void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClipScopes *scopes)
  {
 -      if(scopes->ok) return;
 +      if(scopes->ok)
 +              return;
  
        if(scopes->track_preview) {
                IMB_freeImBuf(scopes->track_preview);
        scopes->track= NULL;
  
        if(clip) {
 -              if(clip->tracking.act_track) {
 -                      MovieTrackingTrack *track= clip->tracking.act_track;
 +              MovieTrackingTrack *act_track= BKE_tracking_active_track(&clip->tracking);
 +
 +              if(act_track) {
 +                      MovieTrackingTrack *track= act_track;
                        MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr);
  
                        if(marker->flag&MARKER_DISABLED) {
index 8c96e4fa3772a1b1a3bd98f1b4d502af60eec43b,bf40a3e73b3c6785786c5f46e418af5c7a75f161..0e4d365305f0d56335045a6bffd16e50d7911e6f
  #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
  #include "BKE_sound.h"
  
+ #include "IMB_imbuf.h"  // for proxy / timecode versioning stuff
  #include "NOD_socket.h"
  
  //XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes
@@@ -5934,29 -5936,10 +5936,29 @@@ static void lib_link_group(FileData *fd
  
  /* ***************** READ MOVIECLIP *************** */
  
 +static void direct_link_movieReconstruction(FileData *fd, MovieTrackingReconstruction *reconstruction)
 +{
 +      reconstruction->cameras= newdataadr(fd, reconstruction->cameras);
 +}
 +
 +static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
 +{
 +      MovieTrackingTrack *track;
 +
 +      link_list(fd, tracksbase);
 +
 +      track= tracksbase->first;
 +      while(track) {
 +              track->markers= newdataadr(fd, track->markers);
 +
 +              track= track->next;
 +      }
 +}
 +
  static void direct_link_movieclip(FileData *fd, MovieClip *clip)
  {
        MovieTracking *tracking= &clip->tracking;
 -      MovieTrackingTrack *track;
 +      MovieTrackingObject *object;
  
        if(fd->movieclipmap) clip->cache= newmclipadr(fd, clip->cache);
        else clip->cache= NULL;
        if(fd->movieclipmap) clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
        else clip->tracking.camera.intrinsics= NULL;
  
 -      tracking->reconstruction.cameras= newdataadr(fd, tracking->reconstruction.cameras);
 -
 -      link_list(fd, &tracking->tracks);
 -
 -      track= tracking->tracks.first;
 -      while(track) {
 -              track->markers= newdataadr(fd, track->markers);
 -
 -              track= track->next;
 -      }
 +      direct_link_movieTracks(fd, &tracking->tracks);
 +      direct_link_movieReconstruction(fd, &tracking->reconstruction);
  
        clip->tracking.act_track= newdataadr(fd, clip->tracking.act_track);
  
        clip->tracking.stabilization.ok= 0;
        clip->tracking.stabilization.scaleibuf= NULL;
        clip->tracking.stabilization.rot_track= newdataadr(fd, clip->tracking.stabilization.rot_track);
 +
 +      link_list(fd, &tracking->objects);
 +
 +      object= tracking->objects.first;
 +      while(object) {
 +              direct_link_movieTracks(fd, &object->tracks);
 +              direct_link_movieReconstruction(fd, &object->reconstruction);
 +
 +              object= object->next;
 +      }
  }
  
  static void lib_link_movieclip(FileData *fd, Main *main)
@@@ -12609,10 -12590,12 +12611,12 @@@ static void do_versions(FileData *fd, L
                                        clip->aspy= 1.0f;
                                }
  
-                               /* XXX: a bit hacky, probably include imbuf and use real constants are nicer */
-                               clip->proxy.build_tc_flag= 7;
+                               clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN |
+                                                          IMB_TC_FREE_RUN |
+                                                          IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
                                if(clip->proxy.build_size_flag==0)
-                                       clip->proxy.build_size_flag= 1;
+                                       clip->proxy.build_size_flag= IMB_PROXY_25;
  
                                if(clip->proxy.quality==0)
                                        clip->proxy.quality= 90;
                }
                {
                        MovieClip *clip;
 -                      for(clip= main->movieclip.first; clip; clip= clip->id.next) {
 +                      Object *ob;
 +
 +                      for (clip= main->movieclip.first; clip; clip= clip->id.next) {
 +                              MovieTracking *tracking= &clip->tracking;
 +                              MovieTrackingObject *tracking_object= tracking->objects.first;
 +
+                               clip->proxy.build_tc_flag|= IMB_TC_RECORD_RUN_NO_GAPS;
++
 +                              if(!tracking->settings.object_distance)
 +                                      tracking->settings.object_distance= 1.0f;
 +
 +                              if(tracking->objects.first == NULL)
 +                                      BKE_tracking_new_object(tracking, "Camera");
 +
 +                              while(tracking_object) {
 +                                      if(!tracking_object->scale)
 +                                              tracking_object->scale= 1.0f;
 +
 +                                      tracking_object= tracking_object->next;
 +                              }
 +                      }
 +
 +                      for (ob= main->object.first; ob; ob= ob->id.next) {
 +                              bConstraint *con;
 +                              for (con= ob->constraints.first; con; con=con->next) {
 +                                      bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
 +
 +                                      if(!cti)
 +                                              continue;
 +
 +                                      if(cti->type==CONSTRAINT_TYPE_OBJECTSOLVER) {
 +                                              bObjectSolverConstraint *data= (bObjectSolverConstraint *)con->data;
 +
 +                                              if(data->invmat[3][3]==0.0f)
 +                                                      unit_m4(data->invmat);
 +                                      }
 +                              }
                        }
                }
        }
index d4f68b8816e5ee19a2c833ee3a6a33f307f7efac,35e802e3e112ac7d33b26138761ab29241e4ce8e..8973fb88c85f820169a0add3760df207961e9b0c
@@@ -92,6 -92,7 +92,7 @@@ void OBJECT_OT_game_property_remove(str
  void OBJECT_OT_game_property_copy(struct wmOperatorType *ot);
  void OBJECT_OT_game_property_clear(struct wmOperatorType *ot);
  void OBJECT_OT_logic_bricks_copy(struct wmOperatorType *ot);
+ void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot);
  
  /* object_select.c */
  void OBJECT_OT_select_all(struct wmOperatorType *ot);
@@@ -185,8 -186,6 +186,8 @@@ void CONSTRAINT_OT_stretchto_reset(stru
  void CONSTRAINT_OT_limitdistance_reset(struct wmOperatorType *ot);
  void CONSTRAINT_OT_childof_set_inverse(struct wmOperatorType *ot);
  void CONSTRAINT_OT_childof_clear_inverse(struct wmOperatorType *ot);
 +void CONSTRAINT_OT_objectsolver_set_inverse(struct wmOperatorType *ot);
 +void CONSTRAINT_OT_objectsolver_clear_inverse (struct wmOperatorType *ot);
  
  /* object_vgroup.c */
  void OBJECT_OT_vertex_group_add(struct wmOperatorType *ot);
index 4f598ce44171cf9aa9e1b842d2e104a8fe41d180,a899d60c2abdea6d37ae198a1e3d866b43eb03ab..acc318723d899873fb672b5d80d4e21a955667fa
@@@ -161,8 -161,6 +161,8 @@@ void ED_operatortypes_object(void
        WM_operatortype_append(CONSTRAINT_OT_limitdistance_reset);
        WM_operatortype_append(CONSTRAINT_OT_childof_set_inverse);
        WM_operatortype_append(CONSTRAINT_OT_childof_clear_inverse);
 +      WM_operatortype_append(CONSTRAINT_OT_objectsolver_set_inverse);
 +      WM_operatortype_append(CONSTRAINT_OT_objectsolver_clear_inverse);
  
        WM_operatortype_append(OBJECT_OT_vertex_group_add);
        WM_operatortype_append(OBJECT_OT_vertex_group_remove);
        WM_operatortype_append(OBJECT_OT_game_property_copy);
        WM_operatortype_append(OBJECT_OT_game_property_clear);
        WM_operatortype_append(OBJECT_OT_logic_bricks_copy);
+       WM_operatortype_append(OBJECT_OT_game_physics_copy);
  
        WM_operatortype_append(OBJECT_OT_shape_key_add);
        WM_operatortype_append(OBJECT_OT_shape_key_remove);