Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_tracking.c
| Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | if (clip->lastsize[0]) { | ||||
| value = clip->lastsize[0] * value / camera->sensor_width; | value = clip->lastsize[0] * value / camera->sensor_width; | ||||
| } | } | ||||
| if (value >= 0.0001f) { | if (value >= 0.0001f) { | ||||
| camera->focal = value; | camera->focal = value; | ||||
| } | } | ||||
| } | } | ||||
| static void rna_trackingCamera_principal_point_pixels_get(PointerRNA *ptr, | |||||
| float *r_principal_point_pixels) | |||||
| { | |||||
| MovieClip *clip = (MovieClip *)ptr->owner_id; | |||||
| BKE_tracking_camera_principal_point_pixel_get(clip, r_principal_point_pixels); | |||||
| } | |||||
| static void rna_trackingCamera_principal_point_pixels_set(PointerRNA *ptr, | |||||
| const float *principal_point_pixels) | |||||
| { | |||||
| MovieClip *clip = (MovieClip *)ptr->owner_id; | |||||
| BKE_tracking_camera_principal_point_pixel_set(clip, principal_point_pixels); | |||||
| } | |||||
| static char *rna_trackingStabilization_path(const PointerRNA *UNUSED(ptr)) | static char *rna_trackingStabilization_path(const PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| return BLI_strdup("tracking.stabilization"); | return BLI_strdup("tracking.stabilization"); | ||||
| } | } | ||||
| static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data) | static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data) | ||||
| { | { | ||||
| MovieTrackingTrack *track = (MovieTrackingTrack *)data; | MovieTrackingTrack *track = (MovieTrackingTrack *)data; | ||||
| ▲ Show 20 Lines • Show All 795 Lines • ▼ Show 20 Lines | static void rna_def_trackingCamera(BlenderRNA *brna) | ||||
| /* Units */ | /* Units */ | ||||
| prop = RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "units"); | RNA_def_property_enum_sdna(prop, NULL, "units"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_enum_items(prop, camera_units_items); | RNA_def_property_enum_items(prop, camera_units_items); | ||||
| RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length"); | RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length"); | ||||
| /* Principal Point */ | /* Principal Point */ | ||||
| prop = RNA_def_property(srna, "principal", PROP_FLOAT, PROP_PIXEL); | prop = RNA_def_property(srna, "principal_point", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_array(prop, 2); | RNA_def_property_array(prop, 2); | ||||
| RNA_def_property_float_sdna(prop, NULL, "principal"); | RNA_def_property_float_sdna(prop, NULL, "principal_point"); | ||||
| RNA_def_property_range(prop, -1, 1); | |||||
| RNA_def_property_ui_range(prop, -1, 1, 0.1, 3); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens"); | RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens"); | ||||
| RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL); | RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL); | ||||
| /* Principal Point, in pixels */ | |||||
| prop = RNA_def_property(srna, "principal_point_pixels", PROP_FLOAT, PROP_PIXEL); | |||||
| RNA_def_property_array(prop, 2); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| RNA_def_property_float_funcs(prop, | |||||
| "rna_trackingCamera_principal_point_pixels_get", | |||||
| "rna_trackingCamera_principal_point_pixels_set", | |||||
| NULL); | |||||
| RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens in pixels"); | |||||
| RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL); | |||||
| /* Radial distortion parameters */ | /* Radial distortion parameters */ | ||||
| prop = RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "k1"); | RNA_def_property_float_sdna(prop, NULL, "k1"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); | RNA_def_property_ui_range(prop, -10, 10, 0.1, 3); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "K1", "First coefficient of third order polynomial radial distortion"); | prop, "K1", "First coefficient of third order polynomial radial distortion"); | ||||
| RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); | RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate"); | ||||
| ▲ Show 20 Lines • Show All 1,408 Lines • Show Last 20 Lines | |||||