diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_tracking.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_tracking.c | 112 |
1 files changed, 74 insertions, 38 deletions
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index b8500264e12..f9597fdd7af 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -889,38 +889,6 @@ static void rna_def_trackingSettings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem refine_items[] = { - {0, "NONE", 0, "Nothing", "Do not refine camera intrinsics"}, - {REFINE_FOCAL_LENGTH, "FOCAL_LENGTH", 0, "Focal Length", "Refine focal length"}, - {REFINE_FOCAL_LENGTH | REFINE_RADIAL_DISTORTION_K1, - "FOCAL_LENGTH_RADIAL_K1", - 0, - "Focal length, K1", - "Refine focal length and radial distortion K1"}, - {REFINE_FOCAL_LENGTH | REFINE_RADIAL_DISTORTION_K1 | REFINE_RADIAL_DISTORTION_K2, - "FOCAL_LENGTH_RADIAL_K1_K2", - 0, - "Focal length, K1, K2", - "Refine focal length and radial distortion K1 and K2"}, - {REFINE_FOCAL_LENGTH | REFINE_PRINCIPAL_POINT | REFINE_RADIAL_DISTORTION_K1 | - REFINE_RADIAL_DISTORTION_K2, - "FOCAL_LENGTH_PRINCIPAL_POINT_RADIAL_K1_K2", - 0, - "Focal Length, Optical Center, K1, K2", - "Refine focal length, optical center and radial distortion K1 and K2"}, - {REFINE_FOCAL_LENGTH | REFINE_PRINCIPAL_POINT, - "FOCAL_LENGTH_PRINCIPAL_POINT", - 0, - "Focal Length, Optical Center", - "Refine focal length and optical center"}, - {REFINE_RADIAL_DISTORTION_K1 | REFINE_RADIAL_DISTORTION_K2, - "RADIAL_K1_K2", - 0, - "K1, K2", - "Refine radial distortion K1 and K2"}, - {0, NULL, 0, NULL, NULL}, - }; - srna = RNA_def_struct(brna, "MovieTrackingSettings", NULL); RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings"); @@ -943,11 +911,35 @@ static void rna_def_trackingSettings(BlenderRNA *brna) "Automatically select keyframes when solving camera/object motion"); /* intrinsics refinement during bundle adjustment */ - prop = RNA_def_property(srna, "refine_intrinsics", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "refine_camera_intrinsics"); + + prop = RNA_def_property(srna, "refine_intrinsics_focal_length", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "refine_camera_intrinsics", REFINE_FOCAL_LENGTH); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text( + prop, "Refine Focal Length", "Refine focal length during camera solving"); + + prop = RNA_def_property(srna, "refine_intrinsics_principal_point", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "refine_camera_intrinsics", REFINE_PRINCIPAL_POINT); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text( + prop, "Refine Principal Point", "Refine principal point during camera solving"); + + prop = RNA_def_property(srna, "refine_intrinsics_radial_distortion", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "refine_camera_intrinsics", REFINE_RADIAL_DISTORTION); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_enum_items(prop, refine_items); - RNA_def_property_ui_text(prop, "Refine", "Refine intrinsics during camera solving"); + RNA_def_property_ui_text(prop, + "Refine Radial", + "Refine radial coefficients of distortion model during camera solving"); + + prop = RNA_def_property( + srna, "refine_intrinsics_tangential_distortion", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna( + prop, NULL, "refine_camera_intrinsics", REFINE_TANGENTIAL_DISTORTION); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text( + prop, + "Refine Tangential", + "Refine tangential coefficients of distortion model during camera solving"); /* tool settings */ @@ -1148,6 +1140,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) "Division distortion model which " "better represents wide-angle cameras"}, {TRACKING_DISTORTION_MODEL_NUKE, "NUKE", 0, "Nuke", "Nuke distortion model"}, + {TRACKING_DISTORTION_MODEL_BROWN, "BROWN", 0, "Brown", "Brown-Conrady distortion model"}, {0, NULL, 0, NULL, NULL}, }; @@ -1193,7 +1186,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "focal"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_ui_range(prop, 0.0f, 5000.f, 1, 2); + RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 2); RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length"); RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL); @@ -1247,7 +1240,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna) prop = RNA_def_property(srna, "division_k2", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); - RNA_def_property_ui_text(prop, "K2", "First coefficient of second order division distortion"); + RNA_def_property_ui_text(prop, "K2", "Second coefficient of second order division distortion"); RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); /* Nuke distortion parameters */ @@ -1263,6 +1256,49 @@ static void rna_def_trackingCamera(BlenderRNA *brna) RNA_def_property_ui_text(prop, "K2", "Second coefficient of second order Nuke distortion"); RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + /* Brown-Conrady distortion parameters */ + prop = RNA_def_property(srna, "brown_k1", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); + RNA_def_property_ui_text( + prop, "K1", "First coefficient of fourth order Brown-Conrady radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + + prop = RNA_def_property(srna, "brown_k2", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); + RNA_def_property_ui_text( + prop, "K2", "Second coefficient of fourth order Brown-Conrady radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + + prop = RNA_def_property(srna, "brown_k3", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); + RNA_def_property_ui_text( + prop, "K3", "Third coefficient of fourth order Brown-Conrady radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + + prop = RNA_def_property(srna, "brown_k4", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); + RNA_def_property_ui_text( + prop, "K4", "Fourth coefficient of fourth order Brown-Conrady radial distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + + prop = RNA_def_property(srna, "brown_p1", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); + RNA_def_property_ui_text( + prop, "P1", "First coefficient of second order Brown-Conrady tangential distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + + prop = RNA_def_property(srna, "brown_p2", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); + RNA_def_property_ui_text( + prop, "P2", "Second coefficient of second order Brown-Conrady tangential distortion"); + RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); + /* pixel aspect */ prop = RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "pixel_aspect"); |