Revision: 56946
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56946
Author:   nazgul
Date:     2013-05-21 14:44:50 +0000 (Tue, 21 May 2013)
Log Message:
-----------
Fix #35232: Marker right-click misbehavior on adding

Made it so Add Marker button from toolbox will place
marker in the middle of the frame.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/source/blender/editors/space_clip/tracking_ops.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_clip.py   2013-05-21 
13:22:11 UTC (rev 56945)
+++ trunk/blender/release/scripts/startup/bl_ui/space_clip.py   2013-05-21 
14:44:50 UTC (rev 56946)
@@ -211,7 +211,8 @@
         settings = clip.tracking.settings
 
         col = layout.column(align=True)
-        col.operator("clip.add_marker_move")
+        props = col.operator("clip.add_marker")
+        props.location = (0.5, 0.5)
         col.operator("clip.detect_features")
         col.operator("clip.delete_track")
 

Modified: trunk/blender/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/tracking_ops.c      
2013-05-21 13:22:11 UTC (rev 56945)
+++ trunk/blender/source/blender/editors/space_clip/tracking_ops.c      
2013-05-21 14:44:50 UTC (rev 56946)
@@ -129,12 +129,13 @@
        SpaceClip *sc = CTX_wm_space_clip(C);
        ARegion *ar = CTX_wm_region(C);
 
-       float co[2];
+       if (!RNA_struct_property_is_set(op->ptr, "location")) {
+               /* If location is not set, use mouse positio nas default. */
+               float co[2];
+               ED_clip_mouse_pos(sc, ar, event->mval, co);
+               RNA_float_set_array(op->ptr, "location", co);
+       }
 
-       ED_clip_mouse_pos(sc, ar, event->mval, co);
-
-       RNA_float_set_array(op->ptr, "location", co);
-
        return add_marker_exec(C, op);
 }
 

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

Reply via email to