[Bf-blender-cvs] [41be1d2d8cf] vfx-clip-ui-update: UI: Tracking: Remove operator options exposed as props

Aaron Carlisle noreply at git.blender.org
Wed Jan 6 05:06:38 CET 2021


Commit: 41be1d2d8cff3f297792211b97e126fae80458a6
Author: Aaron Carlisle
Date:   Tue Jan 5 22:54:09 2021 -0500
Branches: vfx-clip-ui-update
https://developer.blender.org/rB41be1d2d8cff3f297792211b97e126fae80458a6

UI: Tracking: Remove operator options exposed as props

In the movie clip editor, some options of operators are exposed as properties and are shown in the toolbar.
Other areas of Blender do not do this making the movie clip editor break paradigm.
This change is needed to migrate the current toolbar to a new active tool based toolbar

Differential Revision: https://developer.blender.org/D9805

===================================================================

M	release/scripts/startup/bl_ui/space_clip.py
M	source/blender/blenkernel/intern/tracking.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_clip/tracking_ops_orient.c
M	source/blender/makesdna/DNA_tracking_types.h
M	source/blender/makesrna/intern/rna_tracking.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index 35fd7333cf4..f17e09c3234 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -577,14 +577,7 @@ class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        clip = context.space_data.clip
-        settings = clip.tracking.settings
-
         col = layout.column()
-        col.prop(settings, "clean_frames", text="Frames")
-        col.prop(settings, "clean_error", text="Error")
-        col.prop(settings, "clean_action", text="Type")
-        col.separator()
         col.operator("clip.clean_tracks")
         col.operator("clip.filter_tracks")
 
@@ -614,9 +607,6 @@ class CLIP_PT_tools_orientation(CLIP_PT_tracking_panel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        sc = context.space_data
-        settings = sc.clip.tracking.settings
-
         col = layout.column(align=True)
 
         row = col.row(align=True)
@@ -637,8 +627,6 @@ class CLIP_PT_tools_orientation(CLIP_PT_tracking_panel, Panel):
         row.operator("clip.set_scale")
         row.operator("clip.apply_solution_scale", text="Apply Scale")
 
-        col.prop(settings, "distance")
-
 
 class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
@@ -664,7 +652,6 @@ class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
         sc = context.space_data
         clip = sc.clip
         tracking_object = clip.tracking.objects.active
-        settings = sc.clip.tracking.settings
 
         col = layout.column()
 
@@ -673,7 +660,6 @@ class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
         col.separator()
 
         col.operator("clip.set_solution_scale", text="Set Scale")
-        col.prop(settings, "object_distance")
 
 
 class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index e5f9d59270e..5d0e393e1a3 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -336,8 +336,6 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
   tracking->settings.default_search_size = 71;
   tracking->settings.default_algorithm_flag |= TRACK_ALGORITHM_FLAG_USE_BRUTE;
   tracking->settings.default_weight = 1.0f;
-  tracking->settings.dist = 1;
-  tracking->settings.object_distance = 1;
   tracking->settings.refine_camera_intrinsics = REFINE_NO_INTRINSICS;
 
   tracking->stabilization.scaleinf = 1.0f;
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 767f24cf175..ae7bcc9660b 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -948,10 +948,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
 
         clip->proxy.build_tc_flag |= IMB_TC_RECORD_RUN_NO_GAPS;
 
-        if (!tracking->settings.object_distance) {
-          tracking->settings.object_distance = 1.0f;
-        }
-
         if (BLI_listbase_is_empty(&tracking->objects)) {
           BKE_tracking_object_add(tracking, "Camera");
         }
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 49313005c43..4b8ee5fe985 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1818,26 +1818,6 @@ static int clean_tracks_exec(bContext *C, wmOperator *op)
   return OPERATOR_FINISHED;
 }
 
-static int clean_tracks_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
-{
-  SpaceClip *sc = CTX_wm_space_clip(C);
-  MovieClip *clip = ED_space_clip_get_clip(sc);
-
-  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);
-}
-
 void CLIP_OT_clean_tracks(wmOperatorType *ot)
 {
   static const EnumPropertyItem actions_items[] = {
@@ -1858,7 +1838,6 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
 
   /* api callbacks */
   ot->exec = clean_tracks_exec;
-  ot->invoke = clean_tracks_invoke;
   ot->poll = ED_space_clip_tracking_poll;
 
   /* flags */
@@ -1881,7 +1860,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
                 0.0f,
                 FLT_MAX,
                 "Reprojection Error",
-                "Effect on tracks which have got larger reprojection error",
+                "Effect on tracks which have a larger re-projection error",
                 0.0f,
                 100.0f);
   RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Cleanup action to execute");
diff --git a/source/blender/editors/space_clip/tracking_ops_orient.c b/source/blender/editors/space_clip/tracking_ops_orient.c
index 04c335cdf5e..1594f5c0697 100644
--- a/source/blender/editors/space_clip/tracking_ops_orient.c
+++ b/source/blender/editors/space_clip/tracking_ops_orient.c
@@ -700,18 +700,6 @@ static int set_scale_exec(bContext *C, wmOperator *op)
   return do_set_scale(C, op, false, false);
 }
 
-static int set_scale_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
-{
-  SpaceClip *sc = CTX_wm_space_clip(C);
-  MovieClip *clip = ED_space_clip_get_clip(sc);
-
-  if (!RNA_struct_property_is_set(op->ptr, "distance")) {
-    RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist);
-  }
-
-  return set_scale_exec(C, op);
-}
-
 void CLIP_OT_set_scale(wmOperatorType *ot)
 {
   /* identifiers */
@@ -721,7 +709,6 @@ void CLIP_OT_set_scale(wmOperatorType *ot)
 
   /* api callbacks */
   ot->exec = set_scale_exec;
-  ot->invoke = set_scale_invoke;
   ot->poll = set_orientation_poll;
 
   /* flags */
@@ -760,18 +747,6 @@ static int set_solution_scale_exec(bContext *C, wmOperator *op)
   return do_set_scale(C, op, true, false);
 }
 
-static int set_solution_scale_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
-{
-  SpaceClip *sc = CTX_wm_space_clip(C);
-  MovieClip *clip = ED_space_clip_get_clip(sc);
-
-  if (!RNA_struct_property_is_set(op->ptr, "distance")) {
-    RNA_float_set(op->ptr, "distance", clip->tracking.settings.object_distance);
-  }
-
-  return set_solution_scale_exec(C, op);
-}
-
 void CLIP_OT_set_solution_scale(wmOperatorType *ot)
 {
   /* identifiers */
@@ -783,7 +758,6 @@ void CLIP_OT_set_solution_scale(wmOperatorType *ot)
 
   /* api callbacks */
   ot->exec = set_solution_scale_exec;
-  ot->invoke = set_solution_scale_invoke;
   ot->poll = set_solution_scale_poll;
 
   /* flags */
@@ -822,16 +796,6 @@ static int apply_solution_scale_exec(bContext *C, wmOperator *op)
   return do_set_scale(C, op, false, true);
 }
 
-static int apply_solution_scale_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
-{
-  SpaceClip *sc = CTX_wm_space_clip(C);
-  MovieClip *clip = ED_space_clip_get_clip(sc);
-  if (!RNA_struct_property_is_set(op->ptr, "distance")) {
-    RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist);
-  }
-  return apply_solution_scale_exec(C, op);
-}
-
 void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
 {
   /* identifiers */
@@ -843,7 +807,6 @@ void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
 
   /* api callbacks */
   ot->exec = apply_solution_scale_exec;
-  ot->invoke = apply_solution_scale_invoke;
   ot->poll = apply_solution_scale_poll;
 
   /* flags */
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index 5b6b706c83c..45b9ec1d5a3 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -295,22 +295,7 @@ typedef struct MovieTrackingSettings {
 
   /* which camera intrinsics to refine. uses on the REFINE_* flags */
   int refine_camera_intrinsics;
-
-  /* ** tool settings ** */
-
-  /* set scale */
-  /** Distance between two bundles used for scene scaling. */
-  float dist;
-
-  /* cleanup */
-  int clean_frames, clean_action;
-  float clean_error;
-
-  /* set object scale */
-  /** Distance between two bundles used for object scaling. */
-  float object_distance;
-
-  char _pad3[4];
+  char _pad3[16];
 } MovieTrackingSettings;
 
 typedef struct MovieTrackingStabilization {
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 1870c660efd..28a4f74b855 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -878,17 +878,6 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
       {0, NULL, 0, NULL, NULL},
   };
 
-  static const EnumPropertyItem cleanup_items[] = {
-      {TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"},
-      {TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"},
-      {TRACKING_CLEAN_DELETE_SEGMENT,
-       "DELETE_SEGMENTS",
-       0,
-       "Delete Segments",
-       "Delete unclean segments of tracks"},
-      {0, NULL, 0, NULL, NULL},
-  };
-
   srna = RNA_def_struct(brna, "MovieTrackingSettings", NULL);
   RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings");
 
@@ -941,41 +930,6 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
       "Refine Tangential",
       "Refine tangential coefficients of distortion model during camera solving");
 
-  /* tool settings */
-
-  /* distance */
-  prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-  RNA_def_property_float_sdna(prop, NULL, "dist");
-  RNA_def_property_float_default(prop, 1.0f);
-  RNA_def_property_ui_text(
-      prop, "Distance", "Distance between two

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list