Camera tracking: fix for Clean Tracks operator which used to always use
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 2 Feb 2012 19:37:50 +0000 (19:37 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 2 Feb 2012 19:37:50 +0000 (19:37 +0000)
properties values from previous operator run instead of using values
from tool settings.

source/blender/editors/space_clip/tracking_ops.c

index 935dda864bf91b9f7927143b472bec595cab479a..6a9c2755330bab5fe0b09a068a75f42f7abcb20a 100644 (file)
@@ -3417,15 +3417,15 @@ static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
 {
        SpaceClip *sc= CTX_wm_space_clip(C);
        MovieClip *clip= ED_space_clip(sc);
-       int frames= RNA_int_get(op->ptr, "frames");
-       float error= RNA_float_get(op->ptr, "error");
-       int action= RNA_enum_get(op->ptr, "action");
 
-       if(frames==0 && error==0 && action==0) {
+       if(!RNA_struct_property_is_set(op->ptr, "frames"))
                RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames);
+
+       if(!RNA_struct_property_is_set(op->ptr, "error"))
                RNA_float_set(op->ptr, "error", clip->tracking.settings.clean_error);
+
+       if(!RNA_struct_property_is_set(op->ptr, "action"))
                RNA_enum_set(op->ptr, "action", clip->tracking.settings.clean_action);
-       }
 
        return clean_tracks_exec(C, op);
 }