Revision: 42444
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42444
Author:   nazgul
Date:     2011-12-05 19:31:21 +0000 (Mon, 05 Dec 2011)
Log Message:
-----------
Object solver: minor tweaks

- Rename solving button to Object Motion if active tracking object isn't a 
camera
- Ignore refine flags when solving object

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py        
2011-12-05 18:57:17 UTC (rev 42443)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py        
2011-12-05 19:31:21 UTC (rev 42444)
@@ -203,10 +203,18 @@
     def draw(self, context):
         layout = self.layout
         clip = context.space_data.clip
-        settings = clip.tracking.settings
+        tracking = clip.tracking
+        settings = tracking.settings
+        tracking_object = tracking.objects.active
 
         col = layout.column(align=True)
-        col.operator("clip.solve_camera", text="Camera Motion")
+
+        if tracking_object.is_camera:
+            solve_text = "Camera Motion"
+        else:
+            solve_text = "Object Motion"
+
+        col.operator("clip.solve_camera", text=solve_text)
         col.operator("clip.clear_solution")
 
         col = layout.column(align=True)
@@ -214,6 +222,7 @@
         col.prop(settings, "keyframe_b")
 
         col = layout.column(align=True)
+        col.active = tracking_object.is_camera
         col.label(text="Refine:")
         col.prop(settings, "refine_intrinsics", text="")
 

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-12-05 18:57:17 UTC (rev 42443)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-12-05 19:31:21 UTC (rev 42444)
@@ -1604,11 +1604,14 @@
        return retrieve_libmv_reconstruct_tracks(context, tracking);
 }
 
-static int get_refine_intrinsics_flags(MovieTracking *tracking)
+static int get_refine_intrinsics_flags(MovieTracking *tracking, 
MovieTrackingObject *object)
 {
        int refine= tracking->settings.refine_camera_intrinsics;
        int flags= 0;
 
+       if((object->flag&TRACKING_OBJECT_CAMERA)==0)
+               return 0;
+
        if(refine&REFINE_FOCAL_LENGTH)
                flags|= LIBMV_REFINE_FOCAL_LENGTH;
 
@@ -1714,7 +1717,7 @@
        context->tracks= create_libmv_tracks(tracksbase, width, height*aspy);
        context->keyframe1= keyframe1;
        context->keyframe2= keyframe2;
-       context->refine_flags= get_refine_intrinsics_flags(tracking);
+       context->refine_flags= get_refine_intrinsics_flags(tracking, object);
 #else
        (void) width;
        (void) height;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to