[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43125] branches/bmesh/blender: svn merge ^/trunk/blender -r43117:43124

Campbell Barton ideasman42 at gmail.com
Wed Jan 4 13:57:28 CET 2012


Revision: 43125
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43125
Author:   campbellbarton
Date:     2012-01-04 12:57:15 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r43117:43124

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43117

Modified Paths:
--------------
    branches/bmesh/blender/release/scripts/startup/bl_operators/clip.py
    branches/bmesh/blender/source/blender/editors/space_view3d/view3d_snap.c
    branches/bmesh/blender/source/blender/imbuf/intern/anim_movie.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_tracking.c

Property Changed:
----------------
    branches/bmesh/blender/
    branches/bmesh/blender/release/


Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43117
   + /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43124


Property changes on: branches/bmesh/blender/release
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender/release:31524-42516,42522-42548,42551-42585,42587-42655,42681-42757,42779-42870,42921-42927,42954-42957,42974-43085,43093-43117
   + /trunk/blender/release:31524-42516,42522-42548,42551-42585,42587-42655,42681-42757,42779-42870,42921-42927,42954-42957,42974-43085,43093-43124

Modified: branches/bmesh/blender/release/scripts/startup/bl_operators/clip.py
===================================================================
--- branches/bmesh/blender/release/scripts/startup/bl_operators/clip.py	2012-01-04 11:20:50 UTC (rev 43124)
+++ branches/bmesh/blender/release/scripts/startup/bl_operators/clip.py	2012-01-04 12:57:15 UTC (rev 43125)
@@ -60,6 +60,22 @@
                       set_background, clip, clip_user)
 
 
+def CLIP_camera_for_clip(context, clip):
+    scene = context.scene
+
+    camera = scene.camera
+
+    for ob in scene.objects:
+        if ob.type == 'CAMERA':
+            for con in ob.constraints:
+                if con.type == 'CAMERA_SOLVER':
+                    cur_clip = scene.clip if con.use_active_clip else con.clip
+
+                    if cur_clip == clip:
+                        return ob
+
+    return camera
+
 def CLIP_track_view_selected(sc, track):
     if track.select_anchor:
         return True
@@ -80,7 +96,7 @@
     bl_label = "Link Empty to Track"
     bl_options = {'UNDO', 'REGISTER'}
 
-    def _link_track(self, context, track):
+    def _link_track(self, context, clip, tracking_object, track):
         sc = context.space_data
         constraint = None
         ob = None
@@ -101,14 +117,17 @@
         constraint.clip = sc.clip
         constraint.track = track.name
         constraint.use_3d_position = False
+        constraint.object = tracking_object.name
+        constraint.camera = CLIP_camera_for_clip(context, clip);
 
     def execute(self, context):
         sc = context.space_data
         clip = sc.clip
+        tracking_object = clip.tracking.objects.active
 
-        for track in clip.tracking.tracks:
+        for track in tracking_object.tracks:
             if CLIP_track_view_selected(sc, track):
-                self._link_track(context, track)
+                self._link_track(context, clip, tracking_object ,track)
 
         return {'FINISHED'}
 
@@ -130,11 +149,12 @@
 
         sc = context.space_data
         clip = sc.clip
+        tracking_object = clip.tracking.objects.active
 
         new_verts = []
 
         mesh = bpy.data.meshes.new(name="Tracks")
-        for track in clip.tracking.tracks:
+        for track in tracking_object.tracks:
             if track.has_bundle:
                 new_verts.append(track.bundle)
 
@@ -269,7 +289,7 @@
         # TODO: several camera solvers and track followers would fail,
         #       but can't think about eal workflow where it'll be useful
         for x in ob.constraints:
-            if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK'}:
+            if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK', 'OBJECT_SOLVER'}:
                 con = x
 
         if not con:

Modified: branches/bmesh/blender/source/blender/editors/space_view3d/view3d_snap.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/space_view3d/view3d_snap.c	2012-01-04 11:20:50 UTC (rev 43124)
+++ branches/bmesh/blender/source/blender/editors/space_view3d/view3d_snap.c	2012-01-04 12:57:15 UTC (rev 43125)
@@ -827,8 +827,7 @@
 
 	tracking= &clip->tracking;
 
-	if(scene->camera)
-		copy_m4_m4(cammat, scene->camera->obmat);
+	copy_m4_m4(cammat, ob->obmat);
 
 	BKE_get_tracking_mat(scene, ob, mat);
 

Modified: branches/bmesh/blender/source/blender/imbuf/intern/anim_movie.c
===================================================================
--- branches/bmesh/blender/source/blender/imbuf/intern/anim_movie.c	2012-01-04 11:20:50 UTC (rev 43124)
+++ branches/bmesh/blender/source/blender/imbuf/intern/anim_movie.c	2012-01-04 12:57:15 UTC (rev 43125)
@@ -768,8 +768,8 @@
 					== AV_NOPTS_VALUE) ?
 				       -1 : (long long int)anim->pFrame->pkt_pts,
 					(long long int)anim->next_pts);
+				break;
 			}
-			break;
 		}
 		av_free_packet(&anim->next_packet);
 		anim->next_packet.stream_index = -1;

Modified: branches/bmesh/blender/source/blender/makesrna/intern/rna_tracking.c
===================================================================
--- branches/bmesh/blender/source/blender/makesrna/intern/rna_tracking.c	2012-01-04 11:20:50 UTC (rev 43124)
+++ branches/bmesh/blender/source/blender/makesrna/intern/rna_tracking.c	2012-01-04 12:57:15 UTC (rev 43125)
@@ -305,7 +305,14 @@
 {
 	MovieTrackingObject *object= (MovieTrackingObject* )ptr->data;
 
-	rna_iterator_listbase_begin(iter, &object->tracks, NULL);
+	if(object->flag&TRACKING_OBJECT_CAMERA) {
+		MovieClip *clip= (MovieClip*)ptr->id.data;
+
+		rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
+	}
+	else {
+		rna_iterator_listbase_begin(iter, &object->tracks, NULL);
+	}
 }
 
 static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr)



More information about the Bf-blender-cvs mailing list