Refactor: Move motion tracking related files to C++
A bulk change, to make things moving as quickly as possible, instead of doing per-modified-file basis. This is pretty much direct translation of C code to C++, is not really "proper" C++ usage. That could happen on a more case-by-cases basis. Pull Request #105376
This commit is contained in:
@@ -286,14 +286,14 @@ set(SRC
|
||||
intern/text.c
|
||||
intern/text_suggestions.c
|
||||
intern/texture.cc
|
||||
intern/tracking.c
|
||||
intern/tracking_auto.c
|
||||
intern/tracking_detect.c
|
||||
intern/tracking_plane_tracker.c
|
||||
intern/tracking_region_tracker.c
|
||||
intern/tracking_solver.c
|
||||
intern/tracking_stabilize.c
|
||||
intern/tracking_util.c
|
||||
intern/tracking.cc
|
||||
intern/tracking_auto.cc
|
||||
intern/tracking_detect.cc
|
||||
intern/tracking_plane_tracker.cc
|
||||
intern/tracking_region_tracker.cc
|
||||
intern/tracking_solver.cc
|
||||
intern/tracking_stabilize.cc
|
||||
intern/tracking_util.cc
|
||||
intern/type_conversions.cc
|
||||
intern/undo_system.cc
|
||||
intern/unit.c
|
||||
|
||||
@@ -65,7 +65,7 @@ static struct {
|
||||
* Common functions.
|
||||
*/
|
||||
|
||||
/* Free the whole list of tracks, list's head and tail are set to NULL. */
|
||||
/* Free the whole list of tracks, list's head and tail are set to nullptr. */
|
||||
static void tracking_tracks_free(ListBase *tracks)
|
||||
{
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, tracks) {
|
||||
@@ -75,7 +75,7 @@ static void tracking_tracks_free(ListBase *tracks)
|
||||
BLI_freelistN(tracks);
|
||||
}
|
||||
|
||||
/* Free the whole list of plane tracks, list's head and tail are set to NULL. */
|
||||
/* Free the whole list of plane tracks, list's head and tail are set to nullptr. */
|
||||
static void tracking_plane_tracks_free(ListBase *plane_tracks)
|
||||
{
|
||||
LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks) {
|
||||
@@ -109,7 +109,7 @@ static void tracking_object_free(MovieTrackingObject *tracking_object)
|
||||
tracking_reconstruction_free(&tracking_object->reconstruction);
|
||||
}
|
||||
|
||||
/* Free list of tracking objects, list's head and tail is set to NULL. */
|
||||
/* Free list of tracking objects, list's head and tail is set to nullptr. */
|
||||
static void tracking_objects_free(ListBase *objects)
|
||||
{
|
||||
/* Free objects contents. */
|
||||
@@ -129,7 +129,7 @@ static void tracking_dopesheet_free(MovieTrackingDopesheet *dopesheet)
|
||||
MovieTrackingDopesheetChannel *channel;
|
||||
|
||||
/* Free channel's segments. */
|
||||
channel = dopesheet->channels.first;
|
||||
channel = static_cast<MovieTrackingDopesheetChannel *>(dopesheet->channels.first);
|
||||
while (channel) {
|
||||
if (channel->segments) {
|
||||
MEM_freeN(channel->segments);
|
||||
@@ -153,7 +153,7 @@ void BKE_tracking_free(MovieTracking *tracking)
|
||||
tracking_objects_free(&tracking->objects);
|
||||
|
||||
if (tracking->camera.intrinsics) {
|
||||
BKE_tracking_distortion_free(tracking->camera.intrinsics);
|
||||
BKE_tracking_distortion_free(static_cast<MovieDistortion *>(tracking->camera.intrinsics));
|
||||
}
|
||||
|
||||
tracking_dopesheet_free(&tracking->dopesheet);
|
||||
@@ -167,17 +167,16 @@ typedef struct TrackingCopyContext {
|
||||
|
||||
static TrackingCopyContext tracking_copy_context_new(void)
|
||||
{
|
||||
TrackingCopyContext ctx = {
|
||||
.old_to_new_track_map = BLI_ghash_ptr_new(__func__),
|
||||
.old_to_new_plane_track_map = BLI_ghash_ptr_new(__func__),
|
||||
};
|
||||
TrackingCopyContext ctx = {};
|
||||
ctx.old_to_new_track_map = BLI_ghash_ptr_new(__func__);
|
||||
ctx.old_to_new_plane_track_map = BLI_ghash_ptr_new(__func__);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
static void tracking_copy_context_delete(TrackingCopyContext *ctx)
|
||||
{
|
||||
BLI_ghash_free(ctx->old_to_new_track_map, NULL, NULL);
|
||||
BLI_ghash_free(ctx->old_to_new_plane_track_map, NULL, NULL);
|
||||
BLI_ghash_free(ctx->old_to_new_track_map, nullptr, nullptr);
|
||||
BLI_ghash_free(ctx->old_to_new_plane_track_map, nullptr, nullptr);
|
||||
}
|
||||
|
||||
/* Copy the whole list of tracks. */
|
||||
@@ -189,9 +188,9 @@ static void tracking_tracks_copy(TrackingCopyContext *ctx,
|
||||
BLI_listbase_clear(tracks_dst);
|
||||
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track_src, tracks_src) {
|
||||
MovieTrackingTrack *track_dst = MEM_dupallocN(track_src);
|
||||
MovieTrackingTrack *track_dst = MEM_cnew<MovieTrackingTrack>(__func__, *track_src);
|
||||
if (track_src->markers) {
|
||||
track_dst->markers = MEM_dupallocN(track_src->markers);
|
||||
track_dst->markers = static_cast<MovieTrackingMarker *>(MEM_dupallocN(track_src->markers));
|
||||
}
|
||||
if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
|
||||
id_us_plus(&track_dst->gpd->id);
|
||||
@@ -213,16 +212,17 @@ static void tracking_plane_tracks_copy(TrackingCopyContext *ctx,
|
||||
BLI_listbase_clear(plane_tracks_list_dst);
|
||||
|
||||
LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track_src, plane_tracks_list_src) {
|
||||
MovieTrackingPlaneTrack *plane_track_dst = MEM_dupallocN(plane_track_src);
|
||||
MovieTrackingPlaneTrack *plane_track_dst = MEM_cnew(__func__, *plane_track_src);
|
||||
if (plane_track_src->markers) {
|
||||
plane_track_dst->markers = MEM_dupallocN(plane_track_src->markers);
|
||||
plane_track_dst->markers = static_cast<MovieTrackingPlaneMarker *>(
|
||||
MEM_dupallocN(plane_track_src->markers));
|
||||
}
|
||||
plane_track_dst->point_tracks = MEM_mallocN(
|
||||
plane_track_dst->point_tracks = MEM_cnew_array<MovieTrackingTrack *>(
|
||||
sizeof(*plane_track_dst->point_tracks) * plane_track_dst->point_tracksnr, __func__);
|
||||
for (int i = 0; i < plane_track_dst->point_tracksnr; i++) {
|
||||
plane_track_dst->point_tracks[i] = BLI_ghash_lookup(ctx->old_to_new_track_map,
|
||||
plane_track_src->point_tracks[i]);
|
||||
BLI_assert(plane_track_dst->point_tracks[i] != NULL);
|
||||
plane_track_dst->point_tracks[i] = static_cast<MovieTrackingTrack *>(
|
||||
BLI_ghash_lookup(ctx->old_to_new_track_map, plane_track_src->point_tracks[i]));
|
||||
BLI_assert(plane_track_dst->point_tracks[i] != nullptr);
|
||||
}
|
||||
if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
|
||||
id_us_plus(&plane_track_dst->image->id);
|
||||
@@ -234,21 +234,22 @@ static void tracking_plane_tracks_copy(TrackingCopyContext *ctx,
|
||||
}
|
||||
|
||||
/* Copy reconstruction structure. */
|
||||
static void tracking_reconstruction_copy(TrackingCopyContext *UNUSED(ctx),
|
||||
static void tracking_reconstruction_copy(TrackingCopyContext * /*ctx*/,
|
||||
MovieTrackingReconstruction *reconstruction_dst,
|
||||
const MovieTrackingReconstruction *reconstruction_src,
|
||||
const int UNUSED(flag))
|
||||
const int /*flag*/)
|
||||
{
|
||||
*reconstruction_dst = *reconstruction_src;
|
||||
if (reconstruction_src->cameras) {
|
||||
reconstruction_dst->cameras = MEM_dupallocN(reconstruction_src->cameras);
|
||||
reconstruction_dst->cameras = static_cast<MovieReconstructedCamera *>(
|
||||
MEM_dupallocN(reconstruction_src->cameras));
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy stabilization structure. */
|
||||
static void tracking_stabilization_copy(MovieTrackingStabilization *stabilization_dst,
|
||||
const MovieTrackingStabilization *stabilization_src,
|
||||
const int UNUSED(flag))
|
||||
const int /*flag*/)
|
||||
{
|
||||
*stabilization_dst = *stabilization_src;
|
||||
}
|
||||
@@ -269,14 +270,14 @@ static void tracking_object_copy(MovieTrackingObject *tracking_object_dst,
|
||||
&ctx, &tracking_object_dst->reconstruction, &tracking_object_src->reconstruction, flag);
|
||||
|
||||
if (tracking_object_src->active_track) {
|
||||
tracking_object_dst->active_track = BLI_ghash_lookup(ctx.old_to_new_track_map,
|
||||
tracking_object_src->active_track);
|
||||
BLI_assert(tracking_object_dst->active_track != NULL);
|
||||
tracking_object_dst->active_track = static_cast<MovieTrackingTrack *>(
|
||||
BLI_ghash_lookup(ctx.old_to_new_track_map, tracking_object_src->active_track));
|
||||
BLI_assert(tracking_object_dst->active_track != nullptr);
|
||||
}
|
||||
if (tracking_object_src->active_plane_track) {
|
||||
tracking_object_dst->active_plane_track = BLI_ghash_lookup(
|
||||
ctx.old_to_new_plane_track_map, tracking_object_src->active_plane_track);
|
||||
BLI_assert(tracking_object_dst->active_plane_track != NULL);
|
||||
tracking_object_dst->active_plane_track = static_cast<MovieTrackingPlaneTrack *>(
|
||||
BLI_ghash_lookup(ctx.old_to_new_plane_track_map, tracking_object_src->active_plane_track));
|
||||
BLI_assert(tracking_object_dst->active_plane_track != nullptr);
|
||||
}
|
||||
|
||||
tracking_copy_context_delete(&ctx);
|
||||
@@ -290,7 +291,7 @@ static void tracking_objects_copy(ListBase *tracking_objects_dst,
|
||||
BLI_listbase_clear(tracking_objects_dst);
|
||||
|
||||
LISTBASE_FOREACH (MovieTrackingObject *, tracking_object_src, tracking_objects_src) {
|
||||
MovieTrackingObject *tracking_object_dst = MEM_mallocN(sizeof(*tracking_object_dst), __func__);
|
||||
MovieTrackingObject *tracking_object_dst = MEM_cnew<MovieTrackingObject>(__func__);
|
||||
tracking_object_copy(tracking_object_dst, tracking_object_src, flag);
|
||||
BLI_addtail(tracking_objects_dst, tracking_object_dst);
|
||||
}
|
||||
@@ -312,8 +313,8 @@ void BKE_tracking_copy(MovieTracking *tracking_dst,
|
||||
BLI_listbase_clear(&tracking_dst->dopesheet.channels);
|
||||
BLI_listbase_clear(&tracking_dst->dopesheet.coverage_segments);
|
||||
|
||||
tracking_dst->camera.intrinsics = NULL;
|
||||
tracking_dst->stats = NULL;
|
||||
tracking_dst->camera.intrinsics = nullptr;
|
||||
tracking_dst->stats = nullptr;
|
||||
}
|
||||
|
||||
void BKE_tracking_settings_init(MovieTracking *tracking)
|
||||
@@ -359,7 +360,7 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
|
||||
|
||||
void BKE_tracking_get_camera_object_matrix(Object *camera_object, float mat[4][4])
|
||||
{
|
||||
BLI_assert(camera_object != NULL);
|
||||
BLI_assert(camera_object != nullptr);
|
||||
/* NOTE: Construct matrix from scratch rather than using obmat because the camera object here
|
||||
* will have camera solver constraint taken into account. But here we do not want or need it:
|
||||
* object is solved in camera space (as in, camera is stationary and object is moving).
|
||||
@@ -432,7 +433,8 @@ void BKE_tracking_get_projection_matrix(MovieTracking *tracking,
|
||||
|
||||
void BKE_tracking_clipboard_free(void)
|
||||
{
|
||||
MovieTrackingTrack *track = tracking_clipboard.tracks.first, *next_track;
|
||||
MovieTrackingTrack *track = static_cast<MovieTrackingTrack *>(tracking_clipboard.tracks.first),
|
||||
*next_track;
|
||||
|
||||
while (track) {
|
||||
next_track = track->next;
|
||||
@@ -446,7 +448,7 @@ void BKE_tracking_clipboard_free(void)
|
||||
BLI_listbase_clear(&tracking_clipboard.tracks);
|
||||
}
|
||||
|
||||
void BKE_tracking_clipboard_copy_tracks(MovieTracking *UNUSED(tracking),
|
||||
void BKE_tracking_clipboard_copy_tracks(MovieTracking * /*tracking*/,
|
||||
MovieTrackingObject *tracking_object)
|
||||
{
|
||||
/* First drop all tracks from current clipboard. */
|
||||
@@ -467,14 +469,14 @@ bool BKE_tracking_clipboard_has_tracks(void)
|
||||
return (BLI_listbase_is_empty(&tracking_clipboard.tracks) == false);
|
||||
}
|
||||
|
||||
void BKE_tracking_clipboard_paste_tracks(MovieTracking *UNUSED(tracking),
|
||||
void BKE_tracking_clipboard_paste_tracks(MovieTracking * /*tracking*/,
|
||||
MovieTrackingObject *tracking_object)
|
||||
{
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_clipboard.tracks) {
|
||||
MovieTrackingTrack *new_track = BKE_tracking_track_duplicate(track);
|
||||
|
||||
/* TODO(sergey): Preserve active track from before the copy. */
|
||||
if (track->prev == NULL) {
|
||||
if (track->prev == nullptr) {
|
||||
tracking_object->active_track = new_track;
|
||||
}
|
||||
|
||||
@@ -491,7 +493,7 @@ MovieTrackingTrack *BKE_tracking_track_add_empty(MovieTracking *tracking, ListBa
|
||||
{
|
||||
const MovieTrackingSettings *settings = &tracking->settings;
|
||||
|
||||
MovieTrackingTrack *track = MEM_callocN(sizeof(MovieTrackingTrack), "add_marker_exec track");
|
||||
MovieTrackingTrack *track = MEM_cnew<MovieTrackingTrack>("add_marker_exec track");
|
||||
strcpy(track->name, "Track");
|
||||
|
||||
/* Fill track's settings from default settings. */
|
||||
@@ -556,12 +558,12 @@ MovieTrackingTrack *BKE_tracking_track_duplicate(MovieTrackingTrack *track)
|
||||
{
|
||||
MovieTrackingTrack *new_track;
|
||||
|
||||
new_track = MEM_callocN(sizeof(MovieTrackingTrack), "tracking_track_duplicate new_track");
|
||||
new_track = MEM_cnew<MovieTrackingTrack>("tracking_track_duplicate new_track");
|
||||
|
||||
*new_track = *track;
|
||||
new_track->next = new_track->prev = NULL;
|
||||
new_track->next = new_track->prev = nullptr;
|
||||
|
||||
new_track->markers = MEM_dupallocN(new_track->markers);
|
||||
new_track->markers = static_cast<MovieTrackingMarker *>(MEM_dupallocN(new_track->markers));
|
||||
|
||||
/* Prevent duplicate from being used for 2D stabilization.
|
||||
* If necessary, it shall be added explicitly.
|
||||
@@ -642,11 +644,11 @@ MovieTrackingTrack **BKE_tracking_selected_tracks_in_active_object(MovieTracking
|
||||
/* Initialize input. */
|
||||
const int num_selected_tracks = BKE_tracking_count_selected_tracks_in_active_object(tracking);
|
||||
if (num_selected_tracks == 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MovieTrackingTrack **source_tracks = MEM_malloc_arrayN(
|
||||
num_selected_tracks, sizeof(MovieTrackingTrack *), "selected tracks array");
|
||||
MovieTrackingTrack **source_tracks = MEM_cnew_array<MovieTrackingTrack *>(
|
||||
num_selected_tracks, "selected tracks array");
|
||||
int source_track_index = 0;
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
if (!TRACK_SELECTED(track)) {
|
||||
@@ -697,7 +699,7 @@ void BKE_tracking_track_flag_clear(MovieTrackingTrack *track, int area, int flag
|
||||
|
||||
bool BKE_tracking_track_has_marker_at_frame(MovieTrackingTrack *track, int framenr)
|
||||
{
|
||||
return BKE_tracking_marker_get_exact(track, framenr) != NULL;
|
||||
return BKE_tracking_marker_get_exact(track, framenr) != nullptr;
|
||||
}
|
||||
|
||||
bool BKE_tracking_track_has_enabled_marker_at_frame(MovieTrackingTrack *track, int framenr)
|
||||
@@ -712,8 +714,8 @@ static void path_clear_remained(MovieTrackingTrack *track, const int ref_frame)
|
||||
for (int a = 1; a < track->markersnr; a++) {
|
||||
if (track->markers[a].framenr > ref_frame) {
|
||||
track->markersnr = a;
|
||||
track->markers = MEM_reallocN(track->markers,
|
||||
sizeof(MovieTrackingMarker) * track->markersnr);
|
||||
track->markers = static_cast<MovieTrackingMarker *>(
|
||||
MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -733,8 +735,8 @@ static void path_clear_up_to(MovieTrackingTrack *track, const int ref_frame)
|
||||
(track->markersnr - a) * sizeof(MovieTrackingMarker));
|
||||
|
||||
track->markersnr = track->markersnr - a;
|
||||
track->markers = MEM_reallocN(track->markers,
|
||||
sizeof(MovieTrackingMarker) * track->markersnr);
|
||||
track->markers = static_cast<MovieTrackingMarker *>(
|
||||
MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -753,7 +755,7 @@ static void path_clear_all(MovieTrackingTrack *track, const int ref_frame)
|
||||
marker_new = *marker;
|
||||
|
||||
MEM_freeN(track->markers);
|
||||
track->markers = NULL;
|
||||
track->markers = nullptr;
|
||||
track->markersnr = 0;
|
||||
|
||||
BKE_tracking_marker_insert(track, &marker_new);
|
||||
@@ -787,7 +789,7 @@ void BKE_tracking_tracks_join(MovieTracking *tracking,
|
||||
MovieTrackingMarker *markers;
|
||||
|
||||
tot = dst_track->markersnr + src_track->markersnr;
|
||||
markers = MEM_callocN(tot * sizeof(MovieTrackingMarker), "tmp tracking joined tracks");
|
||||
markers = MEM_cnew_array<MovieTrackingMarker>(tot, "tmp tracking joined tracks");
|
||||
|
||||
while (a < src_track->markersnr || b < dst_track->markersnr) {
|
||||
if (b >= dst_track->markersnr) {
|
||||
@@ -883,7 +885,7 @@ void BKE_tracking_tracks_join(MovieTracking *tracking,
|
||||
|
||||
MEM_freeN(dst_track->markers);
|
||||
|
||||
dst_track->markers = MEM_mallocN(i * sizeof(MovieTrackingMarker), "tracking joined tracks");
|
||||
dst_track->markers = MEM_cnew_array<MovieTrackingMarker>(i, "tracking joined tracks");
|
||||
memcpy(dst_track->markers, markers, i * sizeof(MovieTrackingMarker));
|
||||
|
||||
dst_track->markersnr = i;
|
||||
@@ -944,9 +946,9 @@ static void tracking_average_markers(MovieTrackingTrack *dst_track,
|
||||
const int num_frames = last_frame - first_frame + 1;
|
||||
|
||||
/* Allocate temporary array where averaging will happen into. */
|
||||
MovieTrackingMarker *accumulator = MEM_calloc_arrayN(
|
||||
num_frames, sizeof(MovieTrackingMarker), "tracks average accumulator");
|
||||
int *counters = MEM_calloc_arrayN(num_frames, sizeof(int), "tracks accumulator counters");
|
||||
MovieTrackingMarker *accumulator = MEM_cnew_array<MovieTrackingMarker>(
|
||||
num_frames, "tracks average accumulator");
|
||||
int *counters = MEM_cnew_array<int>(num_frames, "tracks accumulator counters");
|
||||
for (int frame = first_frame; frame <= last_frame; ++frame) {
|
||||
const int frame_index = frame - first_frame;
|
||||
accumulator[frame_index].framenr = frame;
|
||||
@@ -1030,9 +1032,9 @@ MovieTrackingTrack *BKE_tracking_track_get_for_selection_index(MovieTracking *tr
|
||||
}
|
||||
}
|
||||
|
||||
*r_tracksbase = NULL;
|
||||
*r_tracksbase = nullptr;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static bGPDlayer *track_mask_gpencil_layer_get(const MovieTrackingTrack *track)
|
||||
@@ -1040,14 +1042,14 @@ static bGPDlayer *track_mask_gpencil_layer_get(const MovieTrackingTrack *track)
|
||||
bGPDlayer *layer;
|
||||
|
||||
if (!track->gpd) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
layer = track->gpd->layers.first;
|
||||
layer = static_cast<bGPDlayer *>(track->gpd->layers.first);
|
||||
|
||||
while (layer) {
|
||||
if (layer->flag & GP_LAYER_ACTIVE) {
|
||||
bGPDframe *frame = layer->frames.first;
|
||||
bGPDframe *frame = static_cast<bGPDframe *>(layer->frames.first);
|
||||
bool ok = false;
|
||||
|
||||
while (frame) {
|
||||
@@ -1067,7 +1069,7 @@ static bGPDlayer *track_mask_gpencil_layer_get(const MovieTrackingTrack *track)
|
||||
layer = layer->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
typedef struct TrackMaskSetPixelData {
|
||||
@@ -1094,7 +1096,7 @@ static void track_mask_gpencil_layer_rasterize(const int frame_width,
|
||||
const int mask_width,
|
||||
const int mask_height)
|
||||
{
|
||||
const bGPDframe *frame = layer->frames.first;
|
||||
const bGPDframe *frame = static_cast<const bGPDframe *>(layer->frames.first);
|
||||
TrackMaskSetPixelData data;
|
||||
|
||||
data.mask = mask;
|
||||
@@ -1102,14 +1104,14 @@ static void track_mask_gpencil_layer_rasterize(const int frame_width,
|
||||
data.mask_height = mask_height;
|
||||
|
||||
while (frame) {
|
||||
const bGPDstroke *stroke = frame->strokes.first;
|
||||
const bGPDstroke *stroke = static_cast<const bGPDstroke *>(frame->strokes.first);
|
||||
|
||||
while (stroke) {
|
||||
const bGPDspoint *stroke_points = stroke->points;
|
||||
if (stroke->flag & GP_STROKE_2DSPACE) {
|
||||
int *mask_points, *point;
|
||||
point = mask_points = MEM_callocN(2 * stroke->totpoints * sizeof(int),
|
||||
"track mask rasterization points");
|
||||
point = mask_points = MEM_cnew_array<int>(2 * stroke->totpoints,
|
||||
"track mask rasterization points");
|
||||
for (int i = 0; i < stroke->totpoints; i++, point += 2) {
|
||||
point[0] = stroke_points[i].x * frame_width - region_min[0];
|
||||
point[1] = stroke_points[i].y * frame_height - region_min[1];
|
||||
@@ -1137,12 +1139,12 @@ float *tracking_track_get_mask_for_region(const int frame_width,
|
||||
const float region_max[2],
|
||||
const MovieTrackingTrack *track)
|
||||
{
|
||||
float *mask = NULL;
|
||||
float *mask = nullptr;
|
||||
const bGPDlayer *layer = track_mask_gpencil_layer_get(track);
|
||||
if (layer != NULL) {
|
||||
if (layer != nullptr) {
|
||||
const int mask_width = region_max[0] - region_min[0];
|
||||
const int mask_height = region_max[1] - region_min[1];
|
||||
mask = MEM_callocN(mask_width * mask_height * sizeof(float), "track mask");
|
||||
mask = MEM_cnew_array<float>(mask_width * mask_height, "track mask");
|
||||
track_mask_gpencil_layer_rasterize(
|
||||
frame_width, frame_height, region_min, layer, mask, mask_width, mask_height);
|
||||
}
|
||||
@@ -1175,7 +1177,7 @@ float BKE_tracking_track_get_weight_for_marker(MovieClip *clip,
|
||||
float weight = track->weight;
|
||||
|
||||
weight_fcurve = id_data_find_fcurve(
|
||||
&clip->id, track, &RNA_MovieTrackingTrack, "weight", 0, NULL);
|
||||
&clip->id, track, &RNA_MovieTrackingTrack, "weight", 0, nullptr);
|
||||
|
||||
if (weight_fcurve) {
|
||||
int scene_framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, marker->framenr);
|
||||
@@ -1194,7 +1196,7 @@ void BKE_tracking_track_select(ListBase *tracksbase,
|
||||
BKE_tracking_track_flag_set(track, area, SELECT);
|
||||
}
|
||||
else {
|
||||
MovieTrackingTrack *cur = tracksbase->first;
|
||||
MovieTrackingTrack *cur = static_cast<MovieTrackingTrack *>(tracksbase->first);
|
||||
|
||||
while (cur) {
|
||||
if ((cur->flag & TRACK_HIDDEN) == 0) {
|
||||
@@ -1233,7 +1235,7 @@ void BKE_tracking_tracks_deselect_all(ListBase *tracksbase)
|
||||
MovieTrackingMarker *BKE_tracking_marker_insert(MovieTrackingTrack *track,
|
||||
MovieTrackingMarker *marker)
|
||||
{
|
||||
MovieTrackingMarker *old_marker = NULL;
|
||||
MovieTrackingMarker *old_marker = nullptr;
|
||||
|
||||
if (track->markersnr) {
|
||||
old_marker = BKE_tracking_marker_get_exact(track, marker->framenr);
|
||||
@@ -1258,10 +1260,11 @@ MovieTrackingMarker *BKE_tracking_marker_insert(MovieTrackingTrack *track,
|
||||
track->markersnr++;
|
||||
|
||||
if (track->markers) {
|
||||
track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr);
|
||||
track->markers = static_cast<MovieTrackingMarker *>(
|
||||
MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr));
|
||||
}
|
||||
else {
|
||||
track->markers = MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers");
|
||||
track->markers = MEM_cnew<MovieTrackingMarker>("MovieTracking markers");
|
||||
}
|
||||
|
||||
/* shift array to "free" space for new marker */
|
||||
@@ -1286,12 +1289,12 @@ void BKE_tracking_marker_delete(MovieTrackingTrack *track, int framenr)
|
||||
track->markers + a + 1,
|
||||
(track->markersnr - a - 1) * sizeof(MovieTrackingMarker));
|
||||
track->markersnr--;
|
||||
track->markers = MEM_reallocN(track->markers,
|
||||
sizeof(MovieTrackingMarker) * track->markersnr);
|
||||
track->markers = static_cast<MovieTrackingMarker *>(
|
||||
MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr));
|
||||
}
|
||||
else {
|
||||
MEM_freeN(track->markers);
|
||||
track->markers = NULL;
|
||||
track->markers = nullptr;
|
||||
track->markersnr = 0;
|
||||
}
|
||||
|
||||
@@ -1358,7 +1361,7 @@ MovieTrackingMarker *BKE_tracking_marker_get(MovieTrackingTrack *track, int fram
|
||||
|
||||
if (num_markers == 0) {
|
||||
BLI_assert_msg(0, "Detected degenerated track, should never happen.");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int left_boundary = 0;
|
||||
@@ -1390,7 +1393,7 @@ MovieTrackingMarker *BKE_tracking_marker_get_exact(MovieTrackingTrack *track, in
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
|
||||
|
||||
if (marker->framenr != framenr) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return marker;
|
||||
@@ -1430,7 +1433,7 @@ static const MovieTrackingMarker *get_usable_marker_for_interpolation(
|
||||
current_marker += direction;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool BKE_tracking_marker_get_interpolated(struct MovieTrackingTrack *track,
|
||||
@@ -1438,7 +1441,7 @@ bool BKE_tracking_marker_get_interpolated(struct MovieTrackingTrack *track,
|
||||
struct MovieTrackingMarker *r_marker)
|
||||
{
|
||||
const MovieTrackingMarker *closest_marker = BKE_tracking_marker_get(track, framenr);
|
||||
if (closest_marker == NULL) {
|
||||
if (closest_marker == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (closest_marker->framenr == framenr && (closest_marker->flag & MARKER_DISABLED) == 0) {
|
||||
@@ -1448,13 +1451,13 @@ bool BKE_tracking_marker_get_interpolated(struct MovieTrackingTrack *track,
|
||||
|
||||
const MovieTrackingMarker *left_marker = get_usable_marker_for_interpolation(
|
||||
track, closest_marker, -1);
|
||||
if (left_marker == NULL) {
|
||||
if (left_marker == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const MovieTrackingMarker *right_marker = get_usable_marker_for_interpolation(
|
||||
track, closest_marker + 1, 1);
|
||||
if (right_marker == NULL) {
|
||||
if (right_marker == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1567,11 +1570,11 @@ MovieTrackingPlaneTrack *BKE_tracking_plane_track_add(MovieTracking *tracking,
|
||||
}
|
||||
|
||||
if (num_selected_tracks < 4) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Allocate new plane track. */
|
||||
plane_track = MEM_callocN(sizeof(MovieTrackingPlaneTrack), "new plane track");
|
||||
plane_track = MEM_cnew<MovieTrackingPlaneTrack>("new plane track");
|
||||
|
||||
/* Use some default name. */
|
||||
strcpy(plane_track->name, "Plane Track");
|
||||
@@ -1579,8 +1582,8 @@ MovieTrackingPlaneTrack *BKE_tracking_plane_track_add(MovieTracking *tracking,
|
||||
plane_track->image_opacity = 1.0f;
|
||||
|
||||
/* Use selected tracks from given list as a plane. */
|
||||
plane_track->point_tracks = MEM_mallocN(sizeof(MovieTrackingTrack *) * num_selected_tracks,
|
||||
"new plane tracks array");
|
||||
plane_track->point_tracks = MEM_cnew_array<MovieTrackingTrack *>(num_selected_tracks,
|
||||
"new plane tracks array");
|
||||
int track_index = 0;
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, tracks) {
|
||||
if (TRACK_SELECTED(track)) {
|
||||
@@ -1656,8 +1659,8 @@ bool BKE_tracking_plane_track_remove_point_track(MovieTrackingPlaneTrack *plane_
|
||||
return false;
|
||||
}
|
||||
|
||||
MovieTrackingTrack **new_point_tracks = MEM_mallocN(
|
||||
sizeof(*new_point_tracks) * (plane_track->point_tracksnr - 1), "new point tracks array");
|
||||
MovieTrackingTrack **new_point_tracks = MEM_cnew_array<MovieTrackingTrack *>(
|
||||
plane_track->point_tracksnr - 1, "new point tracks array");
|
||||
|
||||
for (int i = 0, track_index = 0; i < plane_track->point_tracksnr; i++) {
|
||||
if (plane_track->point_tracks[i] != track) {
|
||||
@@ -1719,7 +1722,7 @@ void BKE_tracking_plane_tracks_replace_point_track(MovieTracking *tracking,
|
||||
MovieTrackingPlaneMarker *BKE_tracking_plane_marker_insert(MovieTrackingPlaneTrack *plane_track,
|
||||
MovieTrackingPlaneMarker *plane_marker)
|
||||
{
|
||||
MovieTrackingPlaneMarker *old_plane_marker = NULL;
|
||||
MovieTrackingPlaneMarker *old_plane_marker = nullptr;
|
||||
|
||||
if (plane_track->markersnr) {
|
||||
old_plane_marker = BKE_tracking_plane_marker_get_exact(plane_track, plane_marker->framenr);
|
||||
@@ -1743,8 +1746,8 @@ MovieTrackingPlaneMarker *BKE_tracking_plane_marker_insert(MovieTrackingPlaneTra
|
||||
}
|
||||
|
||||
plane_track->markersnr++;
|
||||
plane_track->markers = MEM_reallocN(plane_track->markers,
|
||||
sizeof(MovieTrackingPlaneMarker) * plane_track->markersnr);
|
||||
plane_track->markers = static_cast<MovieTrackingPlaneMarker *>(MEM_reallocN(
|
||||
plane_track->markers, sizeof(MovieTrackingPlaneMarker) * plane_track->markersnr));
|
||||
|
||||
/* Shift array to "free" space for new marker. */
|
||||
memmove(plane_track->markers + a + 2,
|
||||
@@ -1768,12 +1771,12 @@ void BKE_tracking_plane_marker_delete(MovieTrackingPlaneTrack *plane_track, int
|
||||
plane_track->markers + a + 1,
|
||||
(plane_track->markersnr - a - 1) * sizeof(MovieTrackingPlaneMarker));
|
||||
plane_track->markersnr--;
|
||||
plane_track->markers = MEM_reallocN(plane_track->markers,
|
||||
sizeof(MovieTrackingMarker) * plane_track->markersnr);
|
||||
plane_track->markers = static_cast<MovieTrackingPlaneMarker *>(MEM_reallocN(
|
||||
plane_track->markers, sizeof(MovieTrackingMarker) * plane_track->markersnr));
|
||||
}
|
||||
else {
|
||||
MEM_freeN(plane_track->markers);
|
||||
plane_track->markers = NULL;
|
||||
plane_track->markers = nullptr;
|
||||
plane_track->markersnr = 0;
|
||||
}
|
||||
|
||||
@@ -1794,7 +1797,7 @@ MovieTrackingPlaneMarker *BKE_tracking_plane_marker_get(MovieTrackingPlaneTrack
|
||||
int a = plane_track->markersnr - 1;
|
||||
|
||||
if (!plane_track->markersnr) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Approximate pre-first framenr marker with first marker. */
|
||||
@@ -1833,7 +1836,7 @@ MovieTrackingPlaneMarker *BKE_tracking_plane_marker_get(MovieTrackingPlaneTrack
|
||||
/* If there's no marker for exact position, use nearest marker from left side. */
|
||||
return &plane_track->markers[a];
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MovieTrackingPlaneMarker *BKE_tracking_plane_marker_get_exact(MovieTrackingPlaneTrack *plane_track,
|
||||
@@ -1842,7 +1845,7 @@ MovieTrackingPlaneMarker *BKE_tracking_plane_marker_get_exact(MovieTrackingPlane
|
||||
MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
|
||||
|
||||
if (plane_marker->framenr != framenr) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return plane_marker;
|
||||
@@ -1898,8 +1901,7 @@ void BKE_tracking_plane_marker_get_subframe_corners(MovieTrackingPlaneTrack *pla
|
||||
|
||||
MovieTrackingObject *BKE_tracking_object_add(MovieTracking *tracking, const char *name)
|
||||
{
|
||||
MovieTrackingObject *tracking_object = MEM_callocN(sizeof(MovieTrackingObject),
|
||||
"tracking object");
|
||||
MovieTrackingObject *tracking_object = MEM_cnew<MovieTrackingObject>("tracking object");
|
||||
|
||||
if (tracking->tot_object == 0) {
|
||||
/* first object is always camera */
|
||||
@@ -1974,12 +1976,12 @@ MovieTrackingObject *BKE_tracking_object_get_named(MovieTracking *tracking, cons
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MovieTrackingObject *BKE_tracking_object_get_active(const MovieTracking *tracking)
|
||||
{
|
||||
return BLI_findlink(&tracking->objects, tracking->objectnr);
|
||||
return static_cast<MovieTrackingObject *>(BLI_findlink(&tracking->objects, tracking->objectnr));
|
||||
}
|
||||
|
||||
MovieTrackingObject *BKE_tracking_object_get_camera(const MovieTracking *tracking)
|
||||
@@ -1990,7 +1992,7 @@ MovieTrackingObject *BKE_tracking_object_get_camera(const MovieTracking *trackin
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MovieTrackingTrack *BKE_tracking_object_find_track_with_name(MovieTrackingObject *tracking_object,
|
||||
@@ -2002,7 +2004,7 @@ MovieTrackingTrack *BKE_tracking_object_find_track_with_name(MovieTrackingObject
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MovieTrackingPlaneTrack *BKE_tracking_object_find_plane_track_with_name(
|
||||
@@ -2014,7 +2016,7 @@ MovieTrackingPlaneTrack *BKE_tracking_object_find_plane_track_with_name(
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------
|
||||
@@ -2134,19 +2136,19 @@ void BKE_tracking_camera_to_blender(
|
||||
}
|
||||
|
||||
MovieReconstructedCamera *BKE_tracking_camera_get_reconstructed(
|
||||
MovieTracking *UNUSED(tracking), MovieTrackingObject *tracking_object, int framenr)
|
||||
MovieTracking * /*tracking*/, MovieTrackingObject *tracking_object, int framenr)
|
||||
{
|
||||
MovieTrackingReconstruction *reconstruction = &tracking_object->reconstruction;
|
||||
int a = reconstructed_camera_index_get(reconstruction, framenr, false);
|
||||
|
||||
if (a == -1) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &reconstruction->cameras[a];
|
||||
}
|
||||
|
||||
void BKE_tracking_camera_get_reconstructed_interpolate(MovieTracking *UNUSED(tracking),
|
||||
void BKE_tracking_camera_get_reconstructed_interpolate(MovieTracking * /*tracking*/,
|
||||
MovieTrackingObject *tracking_object,
|
||||
float framenr,
|
||||
float mat[4][4])
|
||||
@@ -2213,7 +2215,7 @@ MovieDistortion *BKE_tracking_distortion_new(MovieTracking *tracking,
|
||||
tracking_cameraIntrinscisOptionsFromTracking(
|
||||
tracking, calibration_width, calibration_height, &camera_intrinsics_options);
|
||||
|
||||
distortion = MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
|
||||
distortion = MEM_cnew<MovieDistortion>("BKE_tracking_distortion_create");
|
||||
distortion->intrinsics = libmv_cameraIntrinsicsNew(&camera_intrinsics_options);
|
||||
|
||||
const MovieTrackingCamera *camera = &tracking->camera;
|
||||
@@ -2257,7 +2259,7 @@ MovieDistortion *BKE_tracking_distortion_copy(MovieDistortion *distortion)
|
||||
{
|
||||
MovieDistortion *new_distortion;
|
||||
|
||||
new_distortion = MEM_callocN(sizeof(MovieDistortion), "BKE_tracking_distortion_create");
|
||||
new_distortion = MEM_cnew<MovieDistortion>("BKE_tracking_distortion_create");
|
||||
*new_distortion = *distortion;
|
||||
new_distortion->intrinsics = libmv_cameraIntrinsicsCopy(distortion->intrinsics);
|
||||
|
||||
@@ -2421,13 +2423,18 @@ ImBuf *BKE_tracking_undistort_frame(MovieTracking *tracking,
|
||||
{
|
||||
MovieTrackingCamera *camera = &tracking->camera;
|
||||
|
||||
if (camera->intrinsics == NULL) {
|
||||
if (camera->intrinsics == nullptr) {
|
||||
camera->intrinsics = BKE_tracking_distortion_new(
|
||||
tracking, calibration_width, calibration_height);
|
||||
}
|
||||
|
||||
return BKE_tracking_distortion_exec(
|
||||
camera->intrinsics, tracking, ibuf, calibration_width, calibration_height, overscan, true);
|
||||
return BKE_tracking_distortion_exec(static_cast<MovieDistortion *>(camera->intrinsics),
|
||||
tracking,
|
||||
ibuf,
|
||||
calibration_width,
|
||||
calibration_height,
|
||||
overscan,
|
||||
true);
|
||||
}
|
||||
|
||||
ImBuf *BKE_tracking_distort_frame(MovieTracking *tracking,
|
||||
@@ -2438,13 +2445,18 @@ ImBuf *BKE_tracking_distort_frame(MovieTracking *tracking,
|
||||
{
|
||||
MovieTrackingCamera *camera = &tracking->camera;
|
||||
|
||||
if (camera->intrinsics == NULL) {
|
||||
if (camera->intrinsics == nullptr) {
|
||||
camera->intrinsics = BKE_tracking_distortion_new(
|
||||
tracking, calibration_width, calibration_height);
|
||||
}
|
||||
|
||||
return BKE_tracking_distortion_exec(
|
||||
camera->intrinsics, tracking, ibuf, calibration_width, calibration_height, overscan, false);
|
||||
return BKE_tracking_distortion_exec(static_cast<MovieDistortion *>(camera->intrinsics),
|
||||
tracking,
|
||||
ibuf,
|
||||
calibration_width,
|
||||
calibration_height,
|
||||
overscan,
|
||||
false);
|
||||
}
|
||||
|
||||
void BKE_tracking_max_distortion_delta_across_bound(MovieTracking *tracking,
|
||||
@@ -2557,10 +2569,10 @@ ImBuf *BKE_tracking_sample_pattern(const int frame_width,
|
||||
ImBuf *pattern_ibuf;
|
||||
double src_pixel_x[5], src_pixel_y[5];
|
||||
double warped_position_x, warped_position_y;
|
||||
float *mask = NULL;
|
||||
float *mask = nullptr;
|
||||
|
||||
if (num_samples_x <= 0 || num_samples_y <= 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
pattern_ibuf = IMB_allocImBuf(
|
||||
@@ -2665,12 +2677,12 @@ ImBuf *BKE_tracking_get_pattern_imbuf(const ImBuf *ibuf,
|
||||
false,
|
||||
num_samples_x,
|
||||
num_samples_y,
|
||||
NULL);
|
||||
nullptr);
|
||||
|
||||
IMB_freeImBuf(search_ibuf);
|
||||
}
|
||||
else {
|
||||
pattern_ibuf = NULL;
|
||||
pattern_ibuf = nullptr;
|
||||
}
|
||||
|
||||
return pattern_ibuf;
|
||||
@@ -2700,7 +2712,7 @@ ImBuf *BKE_tracking_get_search_imbuf(const ImBuf *ibuf,
|
||||
h = (marker->search_max[1] - marker->search_min[1]) * ibuf->y;
|
||||
|
||||
if (w <= 0 || h <= 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
searchibuf = IMB_allocImBuf(w, h, 32, ibuf->rect_float ? IB_rectfloat : IB_rect);
|
||||
@@ -2772,7 +2784,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf,
|
||||
double warped_position_x, warped_position_y;
|
||||
|
||||
/* Actual sampling. */
|
||||
if (frame_ibuf->rect_float != NULL) {
|
||||
if (frame_ibuf->rect_float != nullptr) {
|
||||
libmv_samplePlanarPatchFloat(frame_ibuf->rect_float,
|
||||
frame_ibuf->x,
|
||||
frame_ibuf->y,
|
||||
@@ -2781,7 +2793,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf,
|
||||
src_pixel_y,
|
||||
num_samples_x,
|
||||
num_samples_y,
|
||||
NULL,
|
||||
nullptr,
|
||||
plane_ibuf->rect_float,
|
||||
&warped_position_x,
|
||||
&warped_position_y);
|
||||
@@ -2795,7 +2807,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf,
|
||||
src_pixel_y,
|
||||
num_samples_x,
|
||||
num_samples_y,
|
||||
NULL,
|
||||
nullptr,
|
||||
(uchar *)plane_ibuf->rect,
|
||||
&warped_position_x,
|
||||
&warped_position_y);
|
||||
@@ -2874,8 +2886,10 @@ void BKE_tracking_disable_channels(
|
||||
|
||||
static int channels_alpha_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
if (BLI_strcasecmp(channel_a->track->name, channel_b->track->name) > 0) {
|
||||
return 1;
|
||||
@@ -2886,8 +2900,10 @@ static int channels_alpha_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_total_track_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
if (channel_a->total_frames > channel_b->total_frames) {
|
||||
return 1;
|
||||
@@ -2898,8 +2914,10 @@ static int channels_total_track_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_longest_segment_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
if (channel_a->max_segment > channel_b->max_segment) {
|
||||
return 1;
|
||||
@@ -2910,8 +2928,10 @@ static int channels_longest_segment_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_average_error_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
if (channel_a->track->error > channel_b->track->error) {
|
||||
return 1;
|
||||
@@ -2957,8 +2977,10 @@ static int compare_firstlast_putting_undefined_first(
|
||||
|
||||
static int channels_start_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
return compare_firstlast_putting_undefined_first(false,
|
||||
channel_a->tot_segment == 0,
|
||||
@@ -2969,8 +2991,10 @@ static int channels_start_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_end_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
return compare_firstlast_putting_undefined_first(false,
|
||||
channel_a->tot_segment == 0,
|
||||
@@ -3008,8 +3032,10 @@ static int channels_longest_segment_inverse_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_average_error_inverse_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
if (channel_a->track->error < channel_b->track->error) {
|
||||
return 1;
|
||||
@@ -3020,8 +3046,10 @@ static int channels_average_error_inverse_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_start_inverse_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
return compare_firstlast_putting_undefined_first(true,
|
||||
channel_a->tot_segment == 0,
|
||||
@@ -3032,8 +3060,10 @@ static int channels_start_inverse_sort(const void *a, const void *b)
|
||||
|
||||
static int channels_end_inverse_sort(const void *a, const void *b)
|
||||
{
|
||||
const MovieTrackingDopesheetChannel *channel_a = a;
|
||||
const MovieTrackingDopesheetChannel *channel_b = b;
|
||||
const MovieTrackingDopesheetChannel *channel_a =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(a);
|
||||
const MovieTrackingDopesheetChannel *channel_b =
|
||||
static_cast<const MovieTrackingDopesheetChannel *>(b);
|
||||
|
||||
return compare_firstlast_putting_undefined_first(true,
|
||||
channel_a->tot_segment == 0,
|
||||
@@ -3101,8 +3131,7 @@ static void tracking_dopesheet_channels_segments_calc(MovieTrackingDopesheetChan
|
||||
return;
|
||||
}
|
||||
|
||||
channel->segments = MEM_callocN(sizeof(int[2]) * channel->tot_segment,
|
||||
"tracking channel segments");
|
||||
channel->segments = MEM_cnew_array<int>(2 * channel->tot_segment, "tracking channel segments");
|
||||
|
||||
/* create segments */
|
||||
i = 0;
|
||||
@@ -3161,8 +3190,8 @@ static void tracking_dopesheet_channels_calc(MovieTracking *tracking)
|
||||
continue;
|
||||
}
|
||||
|
||||
MovieTrackingDopesheetChannel *channel = MEM_callocN(sizeof(MovieTrackingDopesheetChannel),
|
||||
"tracking dopesheet channel");
|
||||
MovieTrackingDopesheetChannel *channel = MEM_cnew<MovieTrackingDopesheetChannel>(
|
||||
"tracking dopesheet channel");
|
||||
channel->track = track;
|
||||
|
||||
if (reconstruction->flag & TRACKING_RECONSTRUCTED) {
|
||||
@@ -3268,7 +3297,7 @@ static void tracking_dopesheet_calc_coverage(MovieTracking *tracking)
|
||||
frames = end_frame - start_frame + 1;
|
||||
|
||||
/* this is a per-frame counter of markers (how many markers belongs to the same frame) */
|
||||
per_frame_counter = MEM_callocN(sizeof(int) * frames, "per frame track counter");
|
||||
per_frame_counter = MEM_cnew_array<int>(frames, "per frame track counter");
|
||||
|
||||
/* find per-frame markers count */
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
@@ -3307,8 +3336,8 @@ static void tracking_dopesheet_calc_coverage(MovieTracking *tracking)
|
||||
end_segment_frame++;
|
||||
}
|
||||
|
||||
coverage_segment = MEM_callocN(sizeof(MovieTrackingDopesheetCoverageSegment),
|
||||
"tracking coverage segment");
|
||||
coverage_segment = MEM_cnew<MovieTrackingDopesheetCoverageSegment>(
|
||||
"tracking coverage segment");
|
||||
coverage_segment->coverage = prev_coverage;
|
||||
coverage_segment->start_frame = last_segment_frame;
|
||||
coverage_segment->end_frame = end_segment_frame;
|
||||
@@ -3362,7 +3391,7 @@ MovieTrackingObject *BKE_tracking_find_object_for_track(const MovieTracking *tra
|
||||
return tracking_object;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MovieTrackingObject *BKE_tracking_find_object_for_plane_track(
|
||||
@@ -3373,7 +3402,7 @@ MovieTrackingObject *BKE_tracking_find_object_for_plane_track(
|
||||
return tracking_object;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BKE_tracking_get_rna_path_for_track(const struct MovieTracking *tracking,
|
||||
@@ -3384,7 +3413,7 @@ void BKE_tracking_get_rna_path_for_track(const struct MovieTracking *tracking,
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_find_object_for_track(tracking, track);
|
||||
char track_name_esc[MAX_NAME * 2];
|
||||
BLI_str_escape(track_name_esc, track->name, sizeof(track_name_esc));
|
||||
if (tracking_object == NULL) {
|
||||
if (tracking_object == nullptr) {
|
||||
BLI_snprintf(rna_path, rna_path_len, "tracking.tracks[\"%s\"]", track_name_esc);
|
||||
}
|
||||
else {
|
||||
@@ -3404,7 +3433,7 @@ void BKE_tracking_get_rna_path_prefix_for_track(const struct MovieTracking *trac
|
||||
size_t rna_path_len)
|
||||
{
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_find_object_for_track(tracking, track);
|
||||
if (tracking_object == NULL) {
|
||||
if (tracking_object == nullptr) {
|
||||
BLI_strncpy(rna_path, "tracking.tracks", rna_path_len);
|
||||
}
|
||||
else {
|
||||
@@ -3423,7 +3452,7 @@ void BKE_tracking_get_rna_path_for_plane_track(const struct MovieTracking *track
|
||||
plane_track);
|
||||
char track_name_esc[MAX_NAME * 2];
|
||||
BLI_str_escape(track_name_esc, plane_track->name, sizeof(track_name_esc));
|
||||
if (tracking_object == NULL) {
|
||||
if (tracking_object == nullptr) {
|
||||
BLI_snprintf(rna_path, rna_path_len, "tracking.plane_tracks[\"%s\"]", track_name_esc);
|
||||
}
|
||||
else {
|
||||
@@ -3445,7 +3474,7 @@ void BKE_tracking_get_rna_path_prefix_for_plane_track(
|
||||
{
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_find_object_for_plane_track(tracking,
|
||||
plane_track);
|
||||
if (tracking_object == NULL) {
|
||||
if (tracking_object == nullptr) {
|
||||
BLI_strncpy(rna_path, "tracking.plane_tracks", rna_path_len);
|
||||
}
|
||||
else {
|
||||
@@ -368,9 +368,9 @@ static void autotrack_context_init_tracks_for_clip(AutoTrackContext *context, in
|
||||
return;
|
||||
}
|
||||
|
||||
context->all_autotrack_tracks = MEM_reallocN(context->all_autotrack_tracks,
|
||||
(context->num_all_tracks + num_clip_tracks) *
|
||||
sizeof(AutoTrackTrack));
|
||||
context->all_autotrack_tracks = static_cast<AutoTrackTrack *>(
|
||||
MEM_reallocN(context->all_autotrack_tracks,
|
||||
(context->num_all_tracks + num_clip_tracks) * sizeof(AutoTrackTrack)));
|
||||
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
AutoTrackTrack *autotrack_track = &context->all_autotrack_tracks[context->num_all_tracks++];
|
||||
@@ -379,7 +379,7 @@ static void autotrack_context_init_tracks_for_clip(AutoTrackContext *context, in
|
||||
autotrack_track->is_trackable = autotrack_is_track_trackable(context, autotrack_track);
|
||||
|
||||
tracking_configure_tracker(
|
||||
track, NULL, context->is_backwards, &autotrack_track->track_region_options);
|
||||
track, nullptr, context->is_backwards, &autotrack_track->track_region_options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,8 +410,8 @@ static void autotrack_context_init_image_accessor(AutoTrackContext *context)
|
||||
clips[i] = context->autotrack_clips[i].clip;
|
||||
}
|
||||
|
||||
MovieTrackingTrack **tracks = MEM_malloc_arrayN(
|
||||
context->num_all_tracks, sizeof(MovieTrackingTrack *), "image accessor init tracks");
|
||||
MovieTrackingTrack **tracks = MEM_cnew_array<MovieTrackingTrack *>(context->num_all_tracks,
|
||||
"image accessor init tracks");
|
||||
for (int i = 0; i < context->num_all_tracks; ++i) {
|
||||
tracks[i] = context->all_autotrack_tracks[i].track;
|
||||
}
|
||||
@@ -466,8 +466,8 @@ static void autotrack_context_init_autotrack(AutoTrackContext *context)
|
||||
}
|
||||
|
||||
/* Allocate memory for all the markers. */
|
||||
libmv_Marker *libmv_markers = MEM_malloc_arrayN(
|
||||
num_trackable_markers, sizeof(libmv_Marker), "libmv markers array");
|
||||
libmv_Marker *libmv_markers = MEM_cnew_array<libmv_Marker>(num_trackable_markers,
|
||||
"libmv markers array");
|
||||
|
||||
/* Fill in markers array. */
|
||||
int num_filled_libmv_markers = 0;
|
||||
@@ -507,8 +507,8 @@ static void autotrack_context_init_markers(AutoTrackContext *context)
|
||||
}
|
||||
|
||||
/* Allocate required memory. */
|
||||
context->autotrack_markers = MEM_calloc_arrayN(
|
||||
context->num_autotrack_markers, sizeof(AutoTrackMarker), "auto track options");
|
||||
context->autotrack_markers = MEM_cnew_array<AutoTrackMarker>(context->num_autotrack_markers,
|
||||
"auto track options");
|
||||
|
||||
/* Fill in all the markers. */
|
||||
int autotrack_marker_index = 0;
|
||||
@@ -542,7 +542,7 @@ AutoTrackContext *BKE_autotrack_context_new(MovieClip *clip,
|
||||
MovieClipUser *user,
|
||||
const bool is_backwards)
|
||||
{
|
||||
AutoTrackContext *context = MEM_callocN(sizeof(AutoTrackContext), "autotrack context");
|
||||
AutoTrackContext *context = MEM_cnew<AutoTrackContext>("autotrack context");
|
||||
|
||||
context->start_scene_frame = user->framenr;
|
||||
context->is_backwards = is_backwards;
|
||||
@@ -572,8 +572,8 @@ static void reference_keyframed_image_buffers(AutoTrackContext *context)
|
||||
/* NOTE: This is potentially over-allocating, but it simplifies memory manipulation.
|
||||
* In practice this is unlikely to be noticed in the profiler as the memory footprint of this
|
||||
* data is way less of what the tracking process will use. */
|
||||
context->referenced_image_buffers = MEM_calloc_arrayN(
|
||||
context->num_autotrack_markers, sizeof(ImBuf *), __func__);
|
||||
context->referenced_image_buffers = MEM_cnew_array<ImBuf *>(context->num_autotrack_markers,
|
||||
__func__);
|
||||
|
||||
context->num_referenced_image_buffers = 0;
|
||||
|
||||
@@ -628,7 +628,7 @@ static void autotrack_context_step_cb(void *__restrict userdata,
|
||||
const int marker_index,
|
||||
const TaskParallelTLS *__restrict tls)
|
||||
{
|
||||
AutoTrackContext *context = userdata;
|
||||
AutoTrackContext *context = static_cast<AutoTrackContext *>(userdata);
|
||||
AutoTrackTLS *autotrack_tls = (AutoTrackTLS *)tls->userdata_chunk;
|
||||
|
||||
const AutoTrackMarker *autotrack_marker = &context->autotrack_markers[marker_index];
|
||||
@@ -650,8 +650,8 @@ static void autotrack_context_step_cb(void *__restrict userdata,
|
||||
|
||||
const int new_marker_frame = libmv_current_marker->frame + frame_delta;
|
||||
|
||||
AutoTrackTrackingResult *autotrack_result = MEM_mallocN(sizeof(AutoTrackTrackingResult),
|
||||
"autotrack result");
|
||||
AutoTrackTrackingResult *autotrack_result = MEM_cnew<AutoTrackTrackingResult>(
|
||||
"autotrack result");
|
||||
autotrack_result->libmv_marker = *libmv_current_marker;
|
||||
autotrack_result->libmv_marker.frame = new_marker_frame;
|
||||
|
||||
@@ -688,7 +688,7 @@ static void autotrack_context_step_cb(void *__restrict userdata,
|
||||
BLI_addtail(&autotrack_tls->results, autotrack_result);
|
||||
}
|
||||
|
||||
static void autotrack_context_reduce(const void *__restrict UNUSED(userdata),
|
||||
static void autotrack_context_reduce(const void *__restrict /*userdata*/,
|
||||
void *__restrict chunk_join,
|
||||
void *__restrict chunk)
|
||||
{
|
||||
@@ -794,7 +794,7 @@ void BKE_autotrack_context_sync(AutoTrackContext *context)
|
||||
if (marker.framenr == first_result_frame) {
|
||||
MovieTrackingMarker *prev_marker = BKE_tracking_marker_get_exact(
|
||||
track, marker.framenr - frame_delta);
|
||||
BLI_assert(prev_marker != NULL);
|
||||
BLI_assert(prev_marker != nullptr);
|
||||
|
||||
tracking_marker_insert_disabled(track, prev_marker, !context->is_backwards, false);
|
||||
}
|
||||
@@ -876,11 +876,11 @@ static void release_keyframed_image_buffers(AutoTrackContext *context)
|
||||
|
||||
void BKE_autotrack_context_free(AutoTrackContext *context)
|
||||
{
|
||||
if (context->autotrack != NULL) {
|
||||
if (context->autotrack != nullptr) {
|
||||
libmv_autoTrackDestroy(context->autotrack);
|
||||
}
|
||||
|
||||
if (context->image_accessor != NULL) {
|
||||
if (context->image_accessor != nullptr) {
|
||||
tracking_image_accessor_destroy(context->image_accessor);
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ static bool check_point_in_stroke(bGPDstroke *stroke, float x, float y)
|
||||
/* Check whether point is inside any stroke of grease pencil layer. */
|
||||
static bool check_point_in_layer(bGPDlayer *layer, float x, float y)
|
||||
{
|
||||
bGPDframe *frame = layer->frames.first;
|
||||
bGPDframe *frame = static_cast<bGPDframe *>(layer->frames.first);
|
||||
|
||||
while (frame) {
|
||||
bGPDstroke *stroke = frame->strokes.first;
|
||||
bGPDstroke *stroke = static_cast<bGPDstroke *>(frame->strokes.first);
|
||||
|
||||
while (stroke) {
|
||||
if (check_point_in_stroke(stroke, x, y)) {
|
||||
@@ -115,7 +115,7 @@ static void run_configured_detector(MovieTracking *tracking,
|
||||
bool place_outside_layer,
|
||||
libmv_DetectOptions *options)
|
||||
{
|
||||
struct libmv_Features *features = NULL;
|
||||
struct libmv_Features *features = nullptr;
|
||||
|
||||
if (ibuf->rect_float) {
|
||||
features = libmv_detectFeaturesFloat(ibuf->rect_float, ibuf->x, ibuf->y, 4, options);
|
||||
@@ -124,7 +124,7 @@ static void run_configured_detector(MovieTracking *tracking,
|
||||
features = libmv_detectFeaturesByte((uchar *)ibuf->rect, ibuf->x, ibuf->y, 4, options);
|
||||
}
|
||||
|
||||
if (features != NULL) {
|
||||
if (features != nullptr) {
|
||||
detect_retrieve_libmv_features(
|
||||
tracking, tracksbase, features, framenr, ibuf->x, ibuf->y, layer, place_outside_layer);
|
||||
|
||||
@@ -25,8 +25,8 @@ static int point_markers_correspondences_on_both_image(
|
||||
{
|
||||
Vec2 *x1, *x2;
|
||||
|
||||
*r_x1 = x1 = MEM_mallocN(sizeof(*x1) * plane_track->point_tracksnr, "point correspondences x1");
|
||||
*r_x2 = x2 = MEM_mallocN(sizeof(*x1) * plane_track->point_tracksnr, "point correspondences x2");
|
||||
*r_x1 = x1 = MEM_cnew_array<Vec2>(plane_track->point_tracksnr, "point correspondences x1");
|
||||
*r_x2 = x2 = MEM_cnew_array<Vec2>(plane_track->point_tracksnr, "point correspondences x2");
|
||||
|
||||
int correspondence_index = 0;
|
||||
for (int i = 0; i < plane_track->point_tracksnr; i++) {
|
||||
@@ -36,7 +36,7 @@ static int point_markers_correspondences_on_both_image(
|
||||
point_marker1 = BKE_tracking_marker_get_exact(point_track, frame1);
|
||||
point_marker2 = BKE_tracking_marker_get_exact(point_track, frame2);
|
||||
|
||||
if (point_marker1 != NULL && point_marker2 != NULL) {
|
||||
if (point_marker1 != nullptr && point_marker2 != nullptr) {
|
||||
/* Here conversion from float to double happens. */
|
||||
x1[correspondence_index][0] = point_marker1->pos[0];
|
||||
x1[correspondence_index][1] = point_marker1->pos[1];
|
||||
@@ -59,7 +59,7 @@ static void track_plane_from_existing_motion(MovieTrackingPlaneTrack *plane_trac
|
||||
{
|
||||
MovieTrackingPlaneMarker *start_plane_marker = BKE_tracking_plane_marker_get(plane_track,
|
||||
start_frame);
|
||||
MovieTrackingPlaneMarker *keyframe_plane_marker = NULL;
|
||||
MovieTrackingPlaneMarker *keyframe_plane_marker = nullptr;
|
||||
MovieTrackingPlaneMarker new_plane_marker;
|
||||
int frame_delta = direction > 0 ? 1 : -1;
|
||||
|
||||
@@ -69,7 +69,7 @@ static void track_plane_from_existing_motion(MovieTrackingPlaneTrack *plane_trac
|
||||
MovieTrackingPlaneMarker *next_plane_marker = BKE_tracking_plane_marker_get_exact(
|
||||
plane_track, current_frame + frame_delta);
|
||||
|
||||
if (next_plane_marker == NULL) {
|
||||
if (next_plane_marker == nullptr) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ static MovieTrackingPlaneMarker *find_plane_keyframe(MovieTrackingPlaneTrack *pl
|
||||
plane_marker += frame_delta;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BKE_tracking_retrack_plane_from_existing_motion_at_segment(
|
||||
@@ -184,17 +184,17 @@ void BKE_tracking_retrack_plane_from_existing_motion_at_segment(
|
||||
prev_plane_keyframe = find_plane_keyframe(plane_track, start_frame, -1);
|
||||
next_plane_keyframe = find_plane_keyframe(plane_track, start_frame, 1);
|
||||
|
||||
if (prev_plane_keyframe != NULL && next_plane_keyframe != NULL) {
|
||||
if (prev_plane_keyframe != nullptr && next_plane_keyframe != nullptr) {
|
||||
/* First we track from left keyframe to the right one without any blending. */
|
||||
track_plane_from_existing_motion(plane_track, prev_plane_keyframe->framenr, 1, true);
|
||||
|
||||
/* And then we track from the right keyframe to the left one, so shape blends in nicely */
|
||||
track_plane_from_existing_motion(plane_track, next_plane_keyframe->framenr, -1, false);
|
||||
}
|
||||
else if (prev_plane_keyframe != NULL) {
|
||||
else if (prev_plane_keyframe != nullptr) {
|
||||
track_plane_from_existing_motion(plane_track, prev_plane_keyframe->framenr, 1, true);
|
||||
}
|
||||
else if (next_plane_keyframe != NULL) {
|
||||
else if (next_plane_keyframe != nullptr) {
|
||||
track_plane_from_existing_motion(plane_track, next_plane_keyframe->framenr, -1, true);
|
||||
}
|
||||
}
|
||||
@@ -72,13 +72,13 @@ static float *track_get_search_floatbuf(ImBuf *ibuf,
|
||||
if (!searchibuf) {
|
||||
*r_width = 0;
|
||||
*r_height = 0;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
width = searchibuf->x;
|
||||
height = searchibuf->y;
|
||||
|
||||
gray_pixels = MEM_callocN(width * height * sizeof(float), "tracking floatBuf");
|
||||
gray_pixels = MEM_cnew_array<float>(width * height, "tracking floatBuf");
|
||||
|
||||
if (searchibuf->rect_float) {
|
||||
float_rgba_to_gray(
|
||||
@@ -129,8 +129,8 @@ static ImBuf *tracking_context_get_keyframed_ibuf(MovieClip *clip,
|
||||
int keyed_framenr;
|
||||
|
||||
marker_keyed = tracking_get_keyframed_marker(track, curfra, backwards);
|
||||
if (marker_keyed == NULL) {
|
||||
return NULL;
|
||||
if (marker_keyed == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
keyed_framenr = marker_keyed->framenr;
|
||||
@@ -149,7 +149,7 @@ static ImBuf *tracking_context_get_reference_ibuf(MovieClip *clip,
|
||||
bool backwards,
|
||||
MovieTrackingMarker **reference_marker)
|
||||
{
|
||||
ImBuf *ibuf = NULL;
|
||||
ImBuf *ibuf = nullptr;
|
||||
|
||||
if (track->pattern_match == TRACK_MATCH_KEYFRAME) {
|
||||
ibuf = tracking_context_get_keyframed_ibuf(
|
||||
@@ -189,7 +189,7 @@ void tracking_configure_tracker(const MovieTrackingTrack *track,
|
||||
options->image1_mask = mask;
|
||||
}
|
||||
else {
|
||||
options->image1_mask = NULL;
|
||||
options->image1_mask = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ static bool configure_and_run_tracker(ImBuf *destination_ibuf,
|
||||
double src_pixel_x[5], src_pixel_y[5];
|
||||
|
||||
/* Settings for the tracker */
|
||||
libmv_TrackRegionOptions options = {0};
|
||||
libmv_TrackRegionOptions options = {};
|
||||
libmv_TrackRegionResult result;
|
||||
|
||||
float *patch_new;
|
||||
@@ -245,7 +245,7 @@ static bool configure_and_run_tracker(ImBuf *destination_ibuf,
|
||||
tracking_get_marker_coords_for_tracking(
|
||||
frame_width, frame_height, marker, dst_pixel_x, dst_pixel_y);
|
||||
|
||||
if (patch_new == NULL || reference_search_area == NULL) {
|
||||
if (patch_new == nullptr || reference_search_area == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -300,9 +300,9 @@ void BKE_tracking_refine_marker(MovieClip *clip,
|
||||
MovieTrackingMarker *marker,
|
||||
bool backwards)
|
||||
{
|
||||
MovieTrackingMarker *reference_marker = NULL;
|
||||
MovieTrackingMarker *reference_marker = nullptr;
|
||||
ImBuf *reference_ibuf, *destination_ibuf;
|
||||
float *search_area, *mask = NULL;
|
||||
float *search_area, *mask = nullptr;
|
||||
int frame_width, frame_height;
|
||||
int search_area_height, search_area_width;
|
||||
int clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS;
|
||||
@@ -323,7 +323,7 @@ void BKE_tracking_refine_marker(MovieClip *clip,
|
||||
|
||||
reference_ibuf = tracking_context_get_reference_ibuf(
|
||||
clip, &user, clip_flag, track, reference_framenr, backwards, &reference_marker);
|
||||
if (reference_ibuf == NULL) {
|
||||
if (reference_ibuf == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ void BKE_tracking_refine_marker(MovieClip *clip,
|
||||
|
||||
/* Destination image buffer has got frame number corresponding to refining marker. */
|
||||
destination_ibuf = BKE_movieclip_get_ibuf_flag(clip, &user, clip_flag, MOVIECLIP_CACHE_SKIP);
|
||||
if (destination_ibuf == NULL) {
|
||||
if (destination_ibuf == nullptr) {
|
||||
IMB_freeImBuf(reference_ibuf);
|
||||
return;
|
||||
}
|
||||
@@ -72,10 +72,10 @@ static struct libmv_Tracks *libmv_tracks_new(MovieClip *clip,
|
||||
MovieTrackingTrack *track;
|
||||
struct libmv_Tracks *tracks = libmv_tracksNew();
|
||||
|
||||
track = tracksbase->first;
|
||||
track = static_cast<MovieTrackingTrack *>(tracksbase->first);
|
||||
while (track) {
|
||||
FCurve *weight_fcurve = id_data_find_fcurve(
|
||||
&clip->id, track, &RNA_MovieTrackingTrack, "weight", 0, NULL);
|
||||
&clip->id, track, &RNA_MovieTrackingTrack, "weight", 0, nullptr);
|
||||
|
||||
for (int a = 0; a < track->markersnr; a++) {
|
||||
MovieTrackingMarker *marker = &track->markers[a];
|
||||
@@ -164,10 +164,10 @@ static bool reconstruct_retrieve_libmv_tracks(MovieReconstructContext *context,
|
||||
}
|
||||
|
||||
reconstruction->camnr = 0;
|
||||
reconstruction->cameras = NULL;
|
||||
reconstruction->cameras = nullptr;
|
||||
|
||||
MovieReconstructedCamera *reconstructed_cameras = MEM_callocN(
|
||||
(efra - sfra + 1) * sizeof(MovieReconstructedCamera), "temp reconstructed camera");
|
||||
MovieReconstructedCamera *reconstructed_cameras = MEM_cnew_array<MovieReconstructedCamera>(
|
||||
(efra - sfra + 1), "temp reconstructed camera");
|
||||
|
||||
for (int a = sfra; a <= efra; a++) {
|
||||
double matd[4][4];
|
||||
@@ -217,7 +217,8 @@ static bool reconstruct_retrieve_libmv_tracks(MovieReconstructContext *context,
|
||||
|
||||
if (reconstruction->camnr) {
|
||||
const size_t size = reconstruction->camnr * sizeof(MovieReconstructedCamera);
|
||||
reconstruction->cameras = MEM_mallocN(size, "reconstructed camera");
|
||||
reconstruction->cameras = MEM_cnew_array<MovieReconstructedCamera>(reconstruction->camnr,
|
||||
"reconstructed camera");
|
||||
memcpy(reconstruction->cameras, reconstructed_cameras, size);
|
||||
}
|
||||
|
||||
@@ -327,8 +328,8 @@ MovieReconstructContext *BKE_tracking_reconstruction_context_new(
|
||||
int height)
|
||||
{
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieReconstructContext *context = MEM_callocN(sizeof(MovieReconstructContext),
|
||||
"MovieReconstructContext data");
|
||||
MovieReconstructContext *context = MEM_cnew<MovieReconstructContext>(
|
||||
"MovieReconstructContext data");
|
||||
const float aspy = 1.0f / tracking->camera.pixel_aspect;
|
||||
const int num_tracks = BLI_listbase_count(&tracking_object->tracks);
|
||||
int sfra = INT_MAX, efra = INT_MIN;
|
||||
@@ -416,7 +417,7 @@ void BKE_tracking_reconstruction_context_free(MovieReconstructContext *context)
|
||||
/* Callback which is called from libmv side to update progress in the interface. */
|
||||
static void reconstruct_update_solve_cb(void *customdata, double progress, const char *message)
|
||||
{
|
||||
ReconstructProgressData *progressdata = customdata;
|
||||
ReconstructProgressData *progressdata = static_cast<ReconstructProgressData *>(customdata);
|
||||
|
||||
if (progressdata->progress) {
|
||||
*progressdata->progress = progress;
|
||||
@@ -102,7 +102,7 @@ typedef struct StabContext {
|
||||
static TrackStabilizationBase *access_stabilization_baseline_data(StabContext *ctx,
|
||||
MovieTrackingTrack *track)
|
||||
{
|
||||
return BLI_ghash_lookup(ctx->private_track_data, track);
|
||||
return static_cast<TrackStabilizationBase *>(BLI_ghash_lookup(ctx->private_track_data, track));
|
||||
}
|
||||
|
||||
static void attach_stabilization_baseline_data(StabContext *ctx,
|
||||
@@ -114,7 +114,7 @@ static void attach_stabilization_baseline_data(StabContext *ctx,
|
||||
|
||||
static void discard_stabilization_baseline_data(void *val)
|
||||
{
|
||||
if (val != NULL) {
|
||||
if (val != nullptr) {
|
||||
MEM_freeN(val);
|
||||
}
|
||||
}
|
||||
@@ -128,12 +128,12 @@ static FCurve *retrieve_stab_animation(MovieClip *clip, const char *data_path, i
|
||||
&RNA_MovieTrackingStabilization,
|
||||
data_path,
|
||||
idx,
|
||||
NULL);
|
||||
nullptr);
|
||||
}
|
||||
|
||||
static FCurve *retrieve_track_weight_animation(MovieClip *clip, MovieTrackingTrack *track)
|
||||
{
|
||||
return id_data_find_fcurve(&clip->id, track, &RNA_MovieTrackingTrack, "weight_stab", 0, NULL);
|
||||
return id_data_find_fcurve(&clip->id, track, &RNA_MovieTrackingTrack, "weight_stab", 0, nullptr);
|
||||
}
|
||||
|
||||
static float fetch_from_fcurve(FCurve *animationCurve,
|
||||
@@ -192,7 +192,7 @@ static float get_animated_weight(StabContext *ctx, MovieTrackingTrack *track, in
|
||||
|
||||
static void use_values_from_fcurves(StabContext *ctx, bool toggle)
|
||||
{
|
||||
if (ctx != NULL) {
|
||||
if (ctx != nullptr) {
|
||||
ctx->use_animation = toggle;
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ static void use_values_from_fcurves(StabContext *ctx, bool toggle)
|
||||
*/
|
||||
static StabContext *init_stabilization_working_context(MovieClip *clip)
|
||||
{
|
||||
StabContext *ctx = MEM_callocN(sizeof(StabContext), "2D stabilization animation runtime data");
|
||||
StabContext *ctx = MEM_cnew<StabContext>("2D stabilization animation runtime data");
|
||||
ctx->clip = clip;
|
||||
ctx->tracking = &clip->tracking;
|
||||
ctx->stab = &clip->tracking.stabilization;
|
||||
@@ -228,8 +228,8 @@ static StabContext *init_stabilization_working_context(MovieClip *clip)
|
||||
*/
|
||||
static void discard_stabilization_working_context(StabContext *ctx)
|
||||
{
|
||||
if (ctx != NULL) {
|
||||
BLI_ghash_free(ctx->private_track_data, NULL, discard_stabilization_baseline_data);
|
||||
if (ctx != nullptr) {
|
||||
BLI_ghash_free(ctx->private_track_data, nullptr, discard_stabilization_baseline_data);
|
||||
MEM_freeN(ctx);
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ static void discard_stabilization_working_context(StabContext *ctx)
|
||||
static bool is_init_for_stabilization(StabContext *ctx, MovieTrackingTrack *track)
|
||||
{
|
||||
TrackStabilizationBase *working_data = access_stabilization_baseline_data(ctx, track);
|
||||
return (working_data != NULL && working_data->is_init_for_stabilization);
|
||||
return (working_data != nullptr && working_data->is_init_for_stabilization);
|
||||
}
|
||||
|
||||
static bool is_usable_for_stabilization(StabContext *ctx, MovieTrackingTrack *track)
|
||||
@@ -342,14 +342,14 @@ static MovieTrackingMarker *get_tracking_data_point(StabContext *ctx,
|
||||
float *r_weight)
|
||||
{
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr);
|
||||
if (marker != NULL && !(marker->flag & MARKER_DISABLED)) {
|
||||
if (marker != nullptr && !(marker->flag & MARKER_DISABLED)) {
|
||||
*r_weight = get_animated_weight(ctx, track, framenr);
|
||||
return marker;
|
||||
}
|
||||
|
||||
/* No marker at this frame (=gap) or marker disabled. */
|
||||
*r_weight = 0.0f;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Define the reference point for rotation/scale measurement and compensation.
|
||||
@@ -538,7 +538,7 @@ static bool average_track_contributions(StabContext *ctx,
|
||||
if (marker) {
|
||||
TrackStabilizationBase *stabilization_base = access_stabilization_baseline_data(ctx,
|
||||
track);
|
||||
BLI_assert(stabilization_base != NULL);
|
||||
BLI_assert(stabilization_base != nullptr);
|
||||
float offset[2];
|
||||
weight_sum += weight;
|
||||
translation_contribution(stabilization_base, marker, offset);
|
||||
@@ -576,7 +576,7 @@ static bool average_track_contributions(StabContext *ctx,
|
||||
if (marker) {
|
||||
TrackStabilizationBase *stabilization_base = access_stabilization_baseline_data(ctx,
|
||||
track);
|
||||
BLI_assert(stabilization_base != NULL);
|
||||
BLI_assert(stabilization_base != nullptr);
|
||||
float rotation, scale, quality;
|
||||
quality = rotation_contribution(
|
||||
stabilization_base, marker, aspect, r_pivot, &rotation, &scale);
|
||||
@@ -747,7 +747,7 @@ static int establish_track_initialization_order(StabContext *ctx, TrackInitOrder
|
||||
MovieTrackingMarker *marker;
|
||||
order[tracknr].data = track;
|
||||
marker = get_closest_marker(ctx, track, anchor_frame);
|
||||
if (marker != NULL && (track->flag & (TRACK_USE_2D_STAB | TRACK_USE_2D_STAB_ROT))) {
|
||||
if (marker != nullptr && (track->flag & (TRACK_USE_2D_STAB | TRACK_USE_2D_STAB_ROT))) {
|
||||
order[tracknr].sort_value = abs(marker->framenr - anchor_frame);
|
||||
order[tracknr].reference_frame = marker->framenr;
|
||||
tracknr++;
|
||||
@@ -826,8 +826,8 @@ static void init_track_for_stabilization(StabContext *ctx,
|
||||
/* Logic for initialization order ensures there *is* a marker on that
|
||||
* very frame.
|
||||
*/
|
||||
BLI_assert(marker != NULL);
|
||||
BLI_assert(local_data != NULL);
|
||||
BLI_assert(marker != nullptr);
|
||||
BLI_assert(local_data != nullptr);
|
||||
|
||||
/* Per track baseline value for translation. */
|
||||
sub_v2_v2v2(local_data->stabilization_offset_base, average_translation, marker->pos);
|
||||
@@ -867,11 +867,10 @@ static void init_all_tracks(StabContext *ctx, float aspect)
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_camera_object->tracks) {
|
||||
TrackStabilizationBase *local_data = access_stabilization_baseline_data(ctx, track);
|
||||
if (!local_data) {
|
||||
local_data = MEM_callocN(sizeof(TrackStabilizationBase),
|
||||
"2D stabilization per track baseline data");
|
||||
local_data = MEM_cnew<TrackStabilizationBase>("2D stabilization per track baseline data");
|
||||
attach_stabilization_baseline_data(ctx, track, local_data);
|
||||
}
|
||||
BLI_assert(local_data != NULL);
|
||||
BLI_assert(local_data != nullptr);
|
||||
local_data->track_weight_curve = retrieve_track_weight_animation(clip, track);
|
||||
local_data->is_init_for_stabilization = false;
|
||||
|
||||
@@ -881,7 +880,7 @@ static void init_all_tracks(StabContext *ctx, float aspect)
|
||||
return;
|
||||
}
|
||||
|
||||
order = MEM_mallocN(track_len * sizeof(TrackInitOrder), "stabilization track order");
|
||||
order = MEM_cnew_array<TrackInitOrder>(track_len, "stabilization track order");
|
||||
if (!order) {
|
||||
return;
|
||||
}
|
||||
@@ -1129,7 +1128,8 @@ static float calculate_autoscale_factor(StabContext *ctx, int size, float aspect
|
||||
for (int cfra = sfra; cfra <= efra; cfra++) {
|
||||
float translation[2], pivot[2], angle, tmp_scale;
|
||||
float mat[4][4];
|
||||
const float points[4][2] = {{0.0f, 0.0f}, {0.0f, height}, {width, height}, {width, 0.0f}};
|
||||
const float points[4][2] = {
|
||||
{0.0f, 0.0f}, {0.0f, float(height)}, {float(width), float(height)}, {float(width), 0.0f}};
|
||||
const bool do_compensate = true;
|
||||
/* Calculate stabilization parameters for the current frame. */
|
||||
stabilization_determine_offset_for_frame(
|
||||
@@ -1230,7 +1230,7 @@ static float calculate_autoscale_factor(StabContext *ctx, int size, float aspect
|
||||
static StabContext *init_stabilizer(MovieClip *clip, int size, float aspect)
|
||||
{
|
||||
StabContext *ctx = init_stabilization_working_context(clip);
|
||||
BLI_assert(ctx != NULL);
|
||||
BLI_assert(ctx != nullptr);
|
||||
init_all_tracks(ctx, aspect);
|
||||
if (ctx->stab->flag & TRACKING_AUTOSCALE) {
|
||||
ctx->stab->scale = 1.0;
|
||||
@@ -1251,7 +1251,7 @@ void BKE_tracking_stabilization_data_get(MovieClip *clip,
|
||||
float *scale,
|
||||
float *angle)
|
||||
{
|
||||
StabContext *ctx = NULL;
|
||||
StabContext *ctx = nullptr;
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
bool enabled = (tracking->stabilization.flag & TRACKING_2D_STABILIZATION);
|
||||
/* Might become a parameter of a stabilization compositor node. */
|
||||
@@ -1290,10 +1290,12 @@ typedef struct TrackingStabilizeFrameInterpolationData {
|
||||
interpolation_func interpolation;
|
||||
} TrackingStabilizeFrameInterpolationData;
|
||||
|
||||
static void tracking_stabilize_frame_interpolation_cb(
|
||||
void *__restrict userdata, const int j, const TaskParallelTLS *__restrict UNUSED(tls))
|
||||
static void tracking_stabilize_frame_interpolation_cb(void *__restrict userdata,
|
||||
const int j,
|
||||
const TaskParallelTLS *__restrict /*tls*/)
|
||||
{
|
||||
TrackingStabilizeFrameInterpolationData *data = userdata;
|
||||
TrackingStabilizeFrameInterpolationData *data =
|
||||
static_cast<TrackingStabilizeFrameInterpolationData *>(userdata);
|
||||
ImBuf *ibuf = data->ibuf;
|
||||
ImBuf *tmpibuf = data->tmpibuf;
|
||||
float(*mat)[4] = data->mat;
|
||||
@@ -1301,7 +1303,7 @@ static void tracking_stabilize_frame_interpolation_cb(
|
||||
interpolation_func interpolation = data->interpolation;
|
||||
|
||||
for (int i = 0; i < tmpibuf->x; i++) {
|
||||
float vec[3] = {i, j, 0.0f};
|
||||
float vec[3] = {float(i), float(j), 0.0f};
|
||||
|
||||
mul_v3_m4v3(vec, mat, vec);
|
||||
|
||||
@@ -1320,7 +1322,7 @@ ImBuf *BKE_tracking_stabilize_frame(
|
||||
float pixel_aspect = tracking->camera.pixel_aspect;
|
||||
float mat[4][4];
|
||||
int filter = tracking->stabilization.filter;
|
||||
interpolation_func interpolation = NULL;
|
||||
interpolation_func interpolation = nullptr;
|
||||
int ibuf_flags;
|
||||
|
||||
if (translation) {
|
||||
@@ -1384,12 +1386,11 @@ ImBuf *BKE_tracking_stabilize_frame(
|
||||
interpolation = nearest_interpolation;
|
||||
}
|
||||
|
||||
TrackingStabilizeFrameInterpolationData data = {
|
||||
.ibuf = ibuf,
|
||||
.tmpibuf = tmpibuf,
|
||||
.mat = mat,
|
||||
.interpolation = interpolation,
|
||||
};
|
||||
TrackingStabilizeFrameInterpolationData data = {};
|
||||
data.ibuf = ibuf;
|
||||
data.tmpibuf = tmpibuf;
|
||||
data.mat = mat;
|
||||
data.interpolation = interpolation;
|
||||
|
||||
TaskParallelSettings settings;
|
||||
BLI_parallel_range_settings_defaults(&settings);
|
||||
@@ -50,13 +50,13 @@
|
||||
|
||||
TracksMap *tracks_map_new(const char *object_name, int num_tracks)
|
||||
{
|
||||
TracksMap *map = MEM_callocN(sizeof(TracksMap), "TrackingsMap");
|
||||
TracksMap *map = MEM_cnew<TracksMap>("TrackingsMap");
|
||||
|
||||
BLI_strncpy(map->object_name, object_name, sizeof(map->object_name));
|
||||
|
||||
map->num_tracks = num_tracks;
|
||||
|
||||
map->tracks = MEM_callocN(sizeof(MovieTrackingTrack) * num_tracks, "TrackingsMap tracks");
|
||||
map->tracks = MEM_cnew_array<MovieTrackingTrack>(num_tracks, "TrackingsMap tracks");
|
||||
|
||||
map->hash = BLI_ghash_ptr_new("TracksMap hash");
|
||||
|
||||
@@ -74,7 +74,7 @@ void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track)
|
||||
{
|
||||
MovieTrackingTrack new_track = *track;
|
||||
|
||||
new_track.markers = MEM_dupallocN(new_track.markers);
|
||||
new_track.markers = static_cast<MovieTrackingMarker *>(MEM_dupallocN(new_track.markers));
|
||||
|
||||
map->tracks[map->ptr] = new_track;
|
||||
|
||||
@@ -86,7 +86,7 @@ void tracks_map_insert(TracksMap *map, MovieTrackingTrack *track)
|
||||
void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
|
||||
{
|
||||
MovieTrackingTrack *track;
|
||||
ListBase tracks = {NULL, NULL}, new_tracks = {NULL, NULL};
|
||||
ListBase tracks = {nullptr, nullptr}, new_tracks = {nullptr, nullptr};
|
||||
ListBase *old_tracks;
|
||||
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_named(tracking, map->object_name);
|
||||
@@ -108,7 +108,7 @@ void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
|
||||
track = &map->tracks[a];
|
||||
|
||||
/* find original of operating track in list of previously displayed tracks */
|
||||
old_track = BLI_ghash_lookup(map->hash, track);
|
||||
old_track = static_cast<MovieTrackingTrack *>(BLI_ghash_lookup(map->hash, track));
|
||||
if (old_track) {
|
||||
if (BLI_findindex(old_tracks, old_track) != -1) {
|
||||
BLI_remlink(old_tracks, old_track);
|
||||
@@ -123,7 +123,7 @@ void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
|
||||
/* Copy all the rest settings back from the map to the actual tracks. */
|
||||
MEM_freeN(old_track->markers);
|
||||
*old_track = *track;
|
||||
old_track->markers = MEM_dupallocN(old_track->markers);
|
||||
old_track->markers = static_cast<MovieTrackingMarker *>(MEM_dupallocN(old_track->markers));
|
||||
|
||||
BLI_spin_unlock(&map->spin_lock);
|
||||
|
||||
@@ -137,14 +137,14 @@ void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
|
||||
MovieTrackingTrack *new_track = BKE_tracking_track_duplicate(track);
|
||||
|
||||
/* Update old-new track mapping */
|
||||
BLI_ghash_reinsert(map->hash, track, new_track, NULL, NULL);
|
||||
BLI_ghash_reinsert(map->hash, track, new_track, nullptr, nullptr);
|
||||
|
||||
BLI_addtail(&tracks, new_track);
|
||||
}
|
||||
}
|
||||
|
||||
/* move all tracks, which aren't operating */
|
||||
track = old_tracks->first;
|
||||
track = static_cast<MovieTrackingTrack *>(old_tracks->first);
|
||||
while (track) {
|
||||
MovieTrackingTrack *next = track->next;
|
||||
BLI_addtail(&new_tracks, track);
|
||||
@@ -152,13 +152,13 @@ void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
|
||||
}
|
||||
|
||||
/* now move all tracks which are currently operating and keep their names unique */
|
||||
track = tracks.first;
|
||||
track = static_cast<MovieTrackingTrack *>(tracks.first);
|
||||
while (track) {
|
||||
MovieTrackingTrack *next = track->next;
|
||||
|
||||
BLI_remlink(&tracks, track);
|
||||
|
||||
track->next = track->prev = NULL;
|
||||
track->next = track->prev = nullptr;
|
||||
BLI_addtail(&new_tracks, track);
|
||||
|
||||
BLI_uniquename(&new_tracks,
|
||||
@@ -176,7 +176,7 @@ void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
|
||||
|
||||
void tracks_map_free(TracksMap *map)
|
||||
{
|
||||
BLI_ghash_free(map->hash, NULL, NULL);
|
||||
BLI_ghash_free(map->hash, nullptr, nullptr);
|
||||
|
||||
for (int i = 0; i < map->num_tracks; i++) {
|
||||
BKE_tracking_track_free(&map->tracks[i]);
|
||||
@@ -515,8 +515,8 @@ void tracking_trackingCameraFromIntrinscisOptions(
|
||||
|
||||
/* NOTE: The image size stored in the `camera_intrinsics_options` is aspect-ratio corrected,
|
||||
* so there is no need to "un-apply" it from the principal point. */
|
||||
const float principal_px[2] = {camera_intrinsics_options->principal_point_x,
|
||||
camera_intrinsics_options->principal_point_y};
|
||||
const float principal_px[2] = {float(camera_intrinsics_options->principal_point_x),
|
||||
float(camera_intrinsics_options->principal_point_y)};
|
||||
|
||||
tracking_principal_point_pixel_to_normalized(principal_px,
|
||||
camera_intrinsics_options->image_width,
|
||||
@@ -530,15 +530,15 @@ MovieTrackingMarker *tracking_get_keyframed_marker(MovieTrackingTrack *track,
|
||||
int current_frame,
|
||||
bool backwards)
|
||||
{
|
||||
MovieTrackingMarker *marker_keyed = NULL;
|
||||
MovieTrackingMarker *marker_keyed_fallback = NULL;
|
||||
MovieTrackingMarker *marker_keyed = nullptr;
|
||||
MovieTrackingMarker *marker_keyed_fallback = nullptr;
|
||||
int a = BKE_tracking_marker_get(track, current_frame) - track->markers;
|
||||
|
||||
while (a >= 0 && a < track->markersnr) {
|
||||
int next = backwards ? a + 1 : a - 1;
|
||||
bool is_keyframed = false;
|
||||
MovieTrackingMarker *cur_marker = &track->markers[a];
|
||||
MovieTrackingMarker *next_marker = NULL;
|
||||
MovieTrackingMarker *next_marker = nullptr;
|
||||
|
||||
if (next >= 0 && next < track->markersnr) {
|
||||
next_marker = &track->markers[next];
|
||||
@@ -549,19 +549,19 @@ MovieTrackingMarker *tracking_get_keyframed_marker(MovieTrackingTrack *track,
|
||||
* fallback to the first marker in current tracked segment
|
||||
* as a keyframe.
|
||||
*/
|
||||
if (next_marker == NULL) {
|
||||
if (next_marker == nullptr) {
|
||||
/* Could happen when trying to get reference marker for the fist
|
||||
* one on the segment which isn't surrounded by disabled markers.
|
||||
*
|
||||
* There's no really good choice here, just use the reference
|
||||
* marker which looks correct..
|
||||
*/
|
||||
if (marker_keyed_fallback == NULL) {
|
||||
if (marker_keyed_fallback == nullptr) {
|
||||
marker_keyed_fallback = cur_marker;
|
||||
}
|
||||
}
|
||||
else if (next_marker->flag & MARKER_DISABLED) {
|
||||
if (marker_keyed_fallback == NULL) {
|
||||
if (marker_keyed_fallback == nullptr) {
|
||||
marker_keyed_fallback = cur_marker;
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ MovieTrackingMarker *tracking_get_keyframed_marker(MovieTrackingTrack *track,
|
||||
a = next;
|
||||
}
|
||||
|
||||
if (marker_keyed == NULL) {
|
||||
if (marker_keyed == nullptr) {
|
||||
marker_keyed = marker_keyed_fallback;
|
||||
}
|
||||
|
||||
@@ -623,9 +623,10 @@ static ImBuf *make_grayscale_ibuf_copy(ImBuf *ibuf)
|
||||
*
|
||||
* Will generalize it later.
|
||||
*/
|
||||
const size_t size = (size_t)grayscale->x * (size_t)grayscale->y * sizeof(float);
|
||||
const size_t num_pixels = (size_t)grayscale->x * (size_t)grayscale->y;
|
||||
grayscale->channels = 1;
|
||||
if ((grayscale->rect_float = MEM_callocN(size, "tracking grayscale image")) != NULL) {
|
||||
if ((grayscale->rect_float = MEM_cnew_array<float>(num_pixels, "tracking grayscale image")) !=
|
||||
nullptr) {
|
||||
grayscale->mall |= IB_rectfloat;
|
||||
grayscale->flags |= IB_rectfloat;
|
||||
|
||||
@@ -641,7 +642,7 @@ static ImBuf *make_grayscale_ibuf_copy(ImBuf *ibuf)
|
||||
|
||||
static void ibuf_to_float_image(const ImBuf *ibuf, libmv_FloatImage *float_image)
|
||||
{
|
||||
BLI_assert(ibuf->rect_float != NULL);
|
||||
BLI_assert(ibuf->rect_float != nullptr);
|
||||
float_image->buffer = ibuf->rect_float;
|
||||
float_image->width = ibuf->x;
|
||||
float_image->height = ibuf->y;
|
||||
@@ -651,13 +652,14 @@ static void ibuf_to_float_image(const ImBuf *ibuf, libmv_FloatImage *float_image
|
||||
static ImBuf *float_image_to_ibuf(libmv_FloatImage *float_image)
|
||||
{
|
||||
ImBuf *ibuf = IMB_allocImBuf(float_image->width, float_image->height, 32, 0);
|
||||
size_t size = (size_t)ibuf->x * (size_t)ibuf->y * float_image->channels * sizeof(float);
|
||||
size_t num_total_channels = (size_t)ibuf->x * (size_t)ibuf->y * float_image->channels;
|
||||
ibuf->channels = float_image->channels;
|
||||
if ((ibuf->rect_float = MEM_callocN(size, "tracking grayscale image")) != NULL) {
|
||||
if ((ibuf->rect_float = MEM_cnew_array<float>(num_total_channels, "tracking grayscale image")) !=
|
||||
nullptr) {
|
||||
ibuf->mall |= IB_rectfloat;
|
||||
ibuf->flags |= IB_rectfloat;
|
||||
|
||||
memcpy(ibuf->rect_float, float_image->buffer, size);
|
||||
memcpy(ibuf->rect_float, float_image->buffer, num_total_channels * sizeof(float));
|
||||
}
|
||||
return ibuf;
|
||||
}
|
||||
@@ -674,12 +676,12 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
|
||||
CACHE_PRINTF("Calculate new buffer for frame %d\n", frame);
|
||||
/* And now we do postprocessing of the original frame. */
|
||||
ImBuf *orig_ibuf = accessor_get_preprocessed_ibuf(accessor, clip_index, frame);
|
||||
if (orig_ibuf == NULL) {
|
||||
return NULL;
|
||||
if (orig_ibuf == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
ImBuf *final_ibuf;
|
||||
/* Cut a region if requested. */
|
||||
if (region != NULL) {
|
||||
if (region != nullptr) {
|
||||
int width = region->max[0] - region->min[0], height = region->max[1] - region->min[1];
|
||||
|
||||
/* If the requested region goes outside of the actual frame we still
|
||||
@@ -696,7 +698,7 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
|
||||
|
||||
final_ibuf = IMB_allocImBuf(width, height, 32, IB_rectfloat);
|
||||
|
||||
if (orig_ibuf->rect_float != NULL) {
|
||||
if (orig_ibuf->rect_float != nullptr) {
|
||||
IMB_rectcpy(final_ibuf,
|
||||
orig_ibuf,
|
||||
dst_offset_x,
|
||||
@@ -743,7 +745,7 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
|
||||
IMB_scaleImBuf(final_ibuf, orig_ibuf->x / (1 << downscale), orig_ibuf->y / (1 << downscale));
|
||||
}
|
||||
/* Apply possible transformation. */
|
||||
if (transform != NULL) {
|
||||
if (transform != nullptr) {
|
||||
libmv_FloatImage input_image, output_image;
|
||||
ibuf_to_float_image(final_ibuf, &input_image);
|
||||
libmv_frameAccessorgetTransformRun(transform, &input_image, &output_image);
|
||||
@@ -806,7 +808,7 @@ static libmv_CacheKey accessor_get_image_callback(struct libmv_FrameAccessorUser
|
||||
*channels = ibuf->channels;
|
||||
}
|
||||
else {
|
||||
*destination = NULL;
|
||||
*destination = nullptr;
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
*channels = 0;
|
||||
@@ -837,7 +839,7 @@ static libmv_CacheKey accessor_get_mask_for_track_callback(libmv_FrameAccessorUs
|
||||
MovieTrackingTrack *track = accessor->tracks[track_index];
|
||||
/* Early output, track does not use mask. */
|
||||
if ((track->algorithm_flag & TRACK_ALGORITHM_FLAG_USE_MASK) == 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
MovieClip *clip = accessor->clips[clip_index];
|
||||
/* Construct fake user so we can access movie clip. */
|
||||
@@ -870,7 +872,7 @@ static libmv_CacheKey accessor_get_mask_for_track_callback(libmv_FrameAccessorUs
|
||||
|
||||
static void accessor_release_mask_callback(libmv_CacheKey cache_key)
|
||||
{
|
||||
if (cache_key != NULL) {
|
||||
if (cache_key != nullptr) {
|
||||
float *mask = (float *)cache_key;
|
||||
MEM_freeN(mask);
|
||||
}
|
||||
@@ -881,16 +883,14 @@ TrackingImageAccessor *tracking_image_accessor_new(MovieClip *clips[MAX_ACCESSOR
|
||||
MovieTrackingTrack **tracks,
|
||||
int num_tracks)
|
||||
{
|
||||
TrackingImageAccessor *accessor = MEM_callocN(sizeof(TrackingImageAccessor),
|
||||
"tracking image accessor");
|
||||
TrackingImageAccessor *accessor = MEM_cnew<TrackingImageAccessor>("tracking image accessor");
|
||||
|
||||
BLI_assert(num_clips <= MAX_ACCESSOR_CLIP);
|
||||
|
||||
memcpy(accessor->clips, clips, num_clips * sizeof(MovieClip *));
|
||||
accessor->num_clips = num_clips;
|
||||
|
||||
accessor->tracks = MEM_malloc_arrayN(
|
||||
num_tracks, sizeof(MovieTrackingTrack *), "image accessor tracks");
|
||||
accessor->tracks = MEM_cnew_array<MovieTrackingTrack *>(num_tracks, "image accessor tracks");
|
||||
memcpy(accessor->tracks, tracks, num_tracks * sizeof(MovieTrackingTrack *));
|
||||
accessor->num_tracks = num_tracks;
|
||||
|
||||
@@ -26,26 +26,26 @@ set(INC_SYS
|
||||
)
|
||||
|
||||
set(SRC
|
||||
clip_buttons.c
|
||||
clip_dopesheet_draw.c
|
||||
clip_dopesheet_ops.c
|
||||
clip_draw.c
|
||||
clip_editor.c
|
||||
clip_graph_draw.c
|
||||
clip_graph_ops.c
|
||||
clip_ops.c
|
||||
clip_toolbar.c
|
||||
clip_utils.c
|
||||
space_clip.c
|
||||
tracking_ops.c
|
||||
tracking_ops_detect.c
|
||||
clip_buttons.cc
|
||||
clip_dopesheet_draw.cc
|
||||
clip_dopesheet_ops.cc
|
||||
clip_draw.cc
|
||||
clip_editor.cc
|
||||
clip_graph_draw.cc
|
||||
clip_graph_ops.cc
|
||||
clip_ops.cc
|
||||
clip_toolbar.cc
|
||||
clip_utils.cc
|
||||
space_clip.cc
|
||||
tracking_ops.cc
|
||||
tracking_ops_detect.cc
|
||||
tracking_ops_orient.cc
|
||||
tracking_ops_plane.c
|
||||
tracking_ops_solve.c
|
||||
tracking_ops_stabilize.c
|
||||
tracking_ops_track.c
|
||||
tracking_ops_utils.c
|
||||
tracking_select.c
|
||||
tracking_ops_plane.cc
|
||||
tracking_ops_solve.cc
|
||||
tracking_ops_stabilize.cc
|
||||
tracking_ops_track.cc
|
||||
tracking_ops_utils.cc
|
||||
tracking_select.cc
|
||||
|
||||
clip_intern.h
|
||||
tracking_ops_intern.h
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
/* Panels */
|
||||
|
||||
static bool metadata_panel_context_poll(const bContext *C, PanelType *UNUSED(pt))
|
||||
static bool metadata_panel_context_poll(const bContext *C, PanelType * /*pt*/)
|
||||
{
|
||||
return ED_space_clip_poll((bContext *)C);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ static void metadata_panel_context_draw(const bContext *C, Panel *panel)
|
||||
* Ideally we need to query metadata from an original image or movie without
|
||||
* reading actual pixels to speed up the process. */
|
||||
ImBuf *ibuf = ED_space_clip_get_buffer(space_clip);
|
||||
if (ibuf != NULL) {
|
||||
if (ibuf != nullptr) {
|
||||
ED_region_image_metadata_panel_draw(ibuf, panel->layout);
|
||||
IMB_freeImBuf(ibuf);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ void ED_clip_buttons_register(ARegionType *art)
|
||||
{
|
||||
PanelType *pt;
|
||||
|
||||
pt = MEM_callocN(sizeof(PanelType), "spacetype clip panel metadata");
|
||||
pt = MEM_cnew<PanelType>("spacetype clip panel metadata");
|
||||
strcpy(pt->idname, "CLIP_PT_metadata");
|
||||
strcpy(pt->label, N_("Metadata"));
|
||||
strcpy(pt->category, "Footage");
|
||||
@@ -107,7 +107,7 @@ void uiTemplateMovieClip(
|
||||
}
|
||||
|
||||
PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
|
||||
MovieClip *clip = clipptr.data;
|
||||
MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
|
||||
|
||||
uiLayoutSetContextPointer(layout, "edit_movieclip", &clipptr);
|
||||
|
||||
@@ -116,18 +116,19 @@ void uiTemplateMovieClip(
|
||||
C,
|
||||
ptr,
|
||||
propname,
|
||||
NULL,
|
||||
nullptr,
|
||||
"CLIP_OT_open",
|
||||
NULL,
|
||||
nullptr,
|
||||
UI_TEMPLATE_ID_FILTER_ALL,
|
||||
false,
|
||||
NULL);
|
||||
nullptr);
|
||||
}
|
||||
|
||||
if (clip) {
|
||||
uiLayout *row = uiLayoutRow(layout, false);
|
||||
uiBlock *block = uiLayoutGetBlock(row);
|
||||
uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, NULL, 0, 0, 0, 0, "");
|
||||
uiDefBut(
|
||||
block, UI_BTYPE_LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, nullptr, 0, 0, 0, 0, "");
|
||||
|
||||
row = uiLayoutRow(layout, false);
|
||||
uiLayout *split = uiLayoutSplit(row, 0.0f, false);
|
||||
@@ -249,7 +250,7 @@ static void to_pixel_space(float r[2], const float a[2], int width, int height)
|
||||
r[1] *= height;
|
||||
}
|
||||
|
||||
static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
|
||||
static void marker_update_cb(bContext *C, void *arg_cb, void * /*arg*/)
|
||||
{
|
||||
MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
|
||||
|
||||
@@ -261,7 +262,7 @@ static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
|
||||
marker->flag = cb->marker_flag;
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, nullptr);
|
||||
}
|
||||
|
||||
static void marker_block_handler(bContext *C, void *arg_cb, int event)
|
||||
@@ -281,7 +282,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
|
||||
|
||||
/* to update position of "parented" objects */
|
||||
DEG_id_tag_update(&cb->clip->id, 0);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
|
||||
|
||||
ok = true;
|
||||
}
|
||||
@@ -364,7 +365,7 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
|
||||
|
||||
/* to update position of "parented" objects */
|
||||
DEG_id_tag_update(&cb->clip->id, 0);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
|
||||
|
||||
ok = true;
|
||||
}
|
||||
@@ -402,13 +403,13 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
|
||||
PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
|
||||
MovieClip *clip = (MovieClip *)clipptr.data;
|
||||
MovieClipUser *user = userptr->data;
|
||||
MovieTrackingTrack *track = trackptr->data;
|
||||
MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
|
||||
MovieTrackingTrack *track = static_cast<MovieTrackingTrack *>(trackptr->data);
|
||||
|
||||
int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
|
||||
|
||||
MarkerUpdateCb *cb = MEM_callocN(sizeof(MarkerUpdateCb), "uiTemplateMarker update_cb");
|
||||
MarkerUpdateCb *cb = MEM_cnew<MarkerUpdateCb>("uiTemplateMarker update_cb");
|
||||
cb->compact = compact;
|
||||
cb->clip = clip;
|
||||
cb->user = user;
|
||||
@@ -443,7 +444,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
1,
|
||||
0,
|
||||
tip);
|
||||
UI_but_funcN_set(bt, marker_update_cb, cb, NULL);
|
||||
UI_but_funcN_set(bt, marker_update_cb, cb, nullptr);
|
||||
UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE);
|
||||
}
|
||||
else {
|
||||
@@ -462,7 +463,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
0,
|
||||
UI_UNIT_X * 15.0f,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@@ -493,7 +494,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
|
||||
uiBlock *block = uiLayoutAbsoluteBlock(layout);
|
||||
UI_block_func_handle_set(block, marker_block_handler, cb);
|
||||
UI_block_funcN_set(block, marker_update_cb, cb, NULL);
|
||||
UI_block_funcN_set(block, marker_update_cb, cb, nullptr);
|
||||
|
||||
const char *tip;
|
||||
int step = 100;
|
||||
@@ -536,7 +537,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
10 * UI_UNIT_Y,
|
||||
15 * UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@@ -583,7 +584,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
8 * UI_UNIT_Y,
|
||||
15 * UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@@ -630,7 +631,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
6 * UI_UNIT_Y,
|
||||
15 * UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@@ -677,7 +678,7 @@ void uiTemplateMarker(uiLayout *layout,
|
||||
3 * UI_UNIT_Y,
|
||||
15 * UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
@@ -779,8 +780,8 @@ void uiTemplateMovieclipInformation(uiLayout *layout,
|
||||
}
|
||||
|
||||
PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
|
||||
MovieClip *clip = (MovieClip *)clipptr.data;
|
||||
MovieClipUser *user = userptr->data;
|
||||
MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
|
||||
MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
|
||||
|
||||
uiLayout *col = uiLayoutColumn(layout, false);
|
||||
uiLayoutSetAlignment(col, UI_LAYOUT_ALIGN_RIGHT);
|
||||
@@ -822,7 +823,7 @@ void uiTemplateMovieclipInformation(uiLayout *layout,
|
||||
}
|
||||
}
|
||||
|
||||
if (clip->anim != NULL) {
|
||||
if (clip->anim != nullptr) {
|
||||
short frs_sec;
|
||||
float frs_sec_base;
|
||||
if (IMB_anim_get_fps(clip->anim, &frs_sec, &frs_sec_base, true)) {
|
||||
@@ -71,10 +71,9 @@ static void clip_draw_dopesheet_background(ARegion *region, MovieClip *clip, uin
|
||||
View2D *v2d = ®ion->v2d;
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
||||
MovieTrackingDopesheetCoverageSegment *coverage_segment;
|
||||
|
||||
for (coverage_segment = dopesheet->coverage_segments.first; coverage_segment;
|
||||
coverage_segment = coverage_segment->next) {
|
||||
LISTBASE_FOREACH (
|
||||
MovieTrackingDopesheetCoverageSegment *, coverage_segment, &dopesheet->coverage_segments) {
|
||||
if (coverage_segment->coverage < TRACKING_COVERAGE_OK) {
|
||||
int start_frame = BKE_movieclip_remap_clip_to_scene_frame(clip,
|
||||
coverage_segment->start_frame);
|
||||
@@ -103,7 +102,6 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
|
||||
if (clip) {
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
||||
MovieTrackingDopesheetChannel *channel;
|
||||
float strip[4], selected_strip[4];
|
||||
float height = (dopesheet->tot_channel * CHANNEL_STEP) + CHANNEL_HEIGHT;
|
||||
|
||||
@@ -131,7 +129,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
|
||||
|
||||
clip_draw_dopesheet_background(region, clip, pos_id);
|
||||
|
||||
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||
float yminc = (float)(y - CHANNEL_HEIGHT_HALF);
|
||||
float ymaxc = (float)(y + CHANNEL_HEIGHT_HALF);
|
||||
|
||||
@@ -221,7 +219,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
|
||||
immAttr1u(flags_id, 0);
|
||||
|
||||
y = (float)CHANNEL_FIRST; /* start again at the top */
|
||||
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||
float yminc = (float)(y - CHANNEL_HEIGHT_HALF);
|
||||
float ymaxc = (float)(y + CHANNEL_HEIGHT_HALF);
|
||||
|
||||
@@ -303,7 +301,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
|
||||
/* need to do a view-sync here, so that the keys area doesn't jump around
|
||||
* (it must copy this) */
|
||||
UI_view2d_sync(NULL, area, v2d, V2D_LOCK_COPY);
|
||||
UI_view2d_sync(nullptr, area, v2d, V2D_LOCK_COPY);
|
||||
|
||||
/* loop through channels, and set up drawing depending on their type
|
||||
* first pass: just the standard GL-drawing for backdrop + text
|
||||
@@ -315,8 +313,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
|
||||
MovieTrackingDopesheetChannel *channel;
|
||||
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||
float yminc = (float)(y - CHANNEL_HEIGHT_HALF);
|
||||
float ymaxc = (float)(y + CHANNEL_HEIGHT_HALF);
|
||||
|
||||
@@ -325,7 +322,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax)) {
|
||||
MovieTrackingTrack *track = channel->track;
|
||||
float color[3];
|
||||
track_channel_color(track, NULL, color);
|
||||
track_channel_color(track, nullptr, color);
|
||||
immUniformColor3fv(color);
|
||||
|
||||
immRectf(pos,
|
||||
@@ -345,7 +342,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
|
||||
BLF_size(fontid, 11.0f * U.dpi_fac);
|
||||
|
||||
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||
float yminc = (float)(y - CHANNEL_HEIGHT_HALF);
|
||||
float ymaxc = (float)(y + CHANNEL_HEIGHT_HALF);
|
||||
|
||||
@@ -375,7 +372,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
BLI_assert(chan_prop_lock);
|
||||
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||
float yminc = (float)(y - CHANNEL_HEIGHT_HALF);
|
||||
float ymaxc = (float)(y + CHANNEL_HEIGHT_HALF);
|
||||
|
||||
@@ -404,7 +401,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL);
|
||||
nullptr);
|
||||
UI_block_emboss_set(block, UI_EMBOSS);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *op)
|
||||
current_channel_index++;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
|
||||
RNA_def_float_vector(ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -150,7 +150,7 @@ void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
|
||||
|
||||
/********************** View All operator *********************/
|
||||
|
||||
static int dopesheet_view_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int dopesheet_view_all_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
@@ -158,10 +158,9 @@ static int dopesheet_view_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
|
||||
MovieTrackingDopesheetChannel *channel;
|
||||
int frame_min = INT_MAX, frame_max = INT_MIN;
|
||||
|
||||
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||
frame_min = min_ii(frame_min, channel->segments[0]);
|
||||
frame_max = max_ii(frame_max, channel->segments[channel->tot_segment]);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ static int track_to_path_segment(SpaceClip *sc,
|
||||
const MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, current_frame);
|
||||
/* Check whether there is marker at exact current frame.
|
||||
* If not, we don't have anything to be put to path. */
|
||||
if (marker == NULL || (marker->flag & MARKER_DISABLED)) {
|
||||
if (marker == nullptr || (marker->flag & MARKER_DISABLED)) {
|
||||
return 0;
|
||||
}
|
||||
/* Index inside of path array where we write data to. */
|
||||
@@ -430,7 +430,7 @@ static int track_to_path_segment(SpaceClip *sc,
|
||||
point_index += direction;
|
||||
current_frame += direction;
|
||||
marker = BKE_tracking_marker_get_exact(track, current_frame);
|
||||
if (marker == NULL || (marker->flag & MARKER_DISABLED)) {
|
||||
if (marker == nullptr || (marker->flag & MARKER_DISABLED)) {
|
||||
/* Reached end of tracked segment. */
|
||||
break;
|
||||
}
|
||||
@@ -485,7 +485,7 @@ static void draw_track_path_lines(const TrackPathPoint *path,
|
||||
immEnd();
|
||||
}
|
||||
|
||||
static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackingTrack *track)
|
||||
static void draw_track_path(SpaceClip *sc, MovieClip * /*clip*/, MovieTrackingTrack *track)
|
||||
{
|
||||
#define MAX_STATIC_PATH 64
|
||||
|
||||
@@ -501,8 +501,9 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
|
||||
|
||||
/* Try to use stack allocated memory when possibly, only use heap allocation
|
||||
* for really long paths. */
|
||||
path = (count < MAX_STATIC_PATH) ? path_static :
|
||||
MEM_mallocN(sizeof(*path) * (count + 1) * 2, "path");
|
||||
path = (count < MAX_STATIC_PATH) ?
|
||||
path_static :
|
||||
MEM_cnew_array<TrackPathPoint>(sizeof(*path) * (count + 1) * 2, "path");
|
||||
/* Collect path information. */
|
||||
const int num_points_before = track_to_path_segment(sc, track, -1, path);
|
||||
const int num_points_after = track_to_path_segment(sc, track, 1, path);
|
||||
@@ -1027,7 +1028,7 @@ static void draw_marker_texts(SpaceClip *sc,
|
||||
{
|
||||
char str[128] = {0}, state[64] = {0};
|
||||
float dx = 0.0f, dy = 0.0f, fontsize, pos[3];
|
||||
uiStyle *style = U.uistyles.first;
|
||||
uiStyle *style = static_cast<uiStyle *>(U.uistyles.first);
|
||||
int fontid = style->widget.uifont_id;
|
||||
|
||||
if (!TRACK_VIEW_SELECTED(sc, track)) {
|
||||
@@ -1170,11 +1171,11 @@ static void draw_plane_marker_image(Scene *scene,
|
||||
ImBuf *ibuf;
|
||||
void *lock;
|
||||
|
||||
if (image == NULL) {
|
||||
if (image == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
ibuf = BKE_image_acquire_ibuf(image, NULL, &lock);
|
||||
ibuf = BKE_image_acquire_ibuf(image, nullptr, &lock);
|
||||
|
||||
if (ibuf) {
|
||||
void *cache_handle;
|
||||
@@ -1202,7 +1203,7 @@ static void draw_plane_marker_image(Scene *scene,
|
||||
1,
|
||||
GPU_RGBA8,
|
||||
GPU_TEXTURE_USAGE_SHADER_READ,
|
||||
NULL);
|
||||
nullptr);
|
||||
GPU_texture_update(texture, GPU_DATA_UBYTE, display_buffer);
|
||||
GPU_texture_filter_mode(texture, false);
|
||||
|
||||
@@ -1265,8 +1266,8 @@ static void draw_plane_marker_ex(SpaceClip *sc,
|
||||
{
|
||||
bool tiny = (sc->flag & SC_SHOW_TINY_MARKER) != 0;
|
||||
bool is_selected_track = (plane_track->flag & SELECT) != 0;
|
||||
const bool has_image = plane_track->image != NULL &&
|
||||
BKE_image_has_ibuf(plane_track->image, NULL);
|
||||
const bool has_image = plane_track->image != nullptr &&
|
||||
BKE_image_has_ibuf(plane_track->image, nullptr);
|
||||
const bool draw_plane_quad = !has_image || plane_track->image_opacity == 0.0f;
|
||||
float px[2];
|
||||
float color[3], selected_color[3];
|
||||
@@ -1441,7 +1442,7 @@ static void draw_tracking_tracks(SpaceClip *sc,
|
||||
/*const*/ MovieTrackingPlaneTrack *active_plane_track = tracking_object->active_plane_track;
|
||||
const int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
const int undistort = sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT;
|
||||
float *marker_pos = NULL, *fp, *active_pos = NULL, cur_pos[2];
|
||||
float *marker_pos = nullptr, *fp, *active_pos = nullptr, cur_pos[2];
|
||||
|
||||
/* ** find window pixel coordinates of origin ** */
|
||||
|
||||
@@ -1486,7 +1487,7 @@ static void draw_tracking_tracks(SpaceClip *sc,
|
||||
|
||||
/* undistort */
|
||||
if (count) {
|
||||
marker_pos = MEM_callocN(sizeof(float[2]) * count, "draw_tracking_tracks marker_pos");
|
||||
marker_pos = MEM_cnew_array<float>(2 * count, "draw_tracking_tracks marker_pos");
|
||||
|
||||
fp = marker_pos;
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
@@ -1682,7 +1683,7 @@ static void draw_distortion(SpaceClip *sc,
|
||||
const int n = 10;
|
||||
float tpos[2], grid[11][11][2];
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
bGPdata *gpd = NULL;
|
||||
bGPdata *gpd = nullptr;
|
||||
float aspy = 1.0f / tracking->camera.pixel_aspect;
|
||||
float dx = (float)width / n, dy = (float)height / n * aspy;
|
||||
float offsx = 0.0f, offsy = 0.0f;
|
||||
@@ -1800,10 +1801,10 @@ static void draw_distortion(SpaceClip *sc,
|
||||
}
|
||||
|
||||
if (sc->flag & SC_MANUAL_CALIBRATION && gpd) {
|
||||
bGPDlayer *layer = gpd->layers.first;
|
||||
bGPDlayer *layer = static_cast<bGPDlayer *>(gpd->layers.first);
|
||||
|
||||
while (layer) {
|
||||
bGPDframe *frame = layer->frames.first;
|
||||
bGPDframe *frame = static_cast<bGPDframe *>(layer->frames.first);
|
||||
|
||||
if (layer->flag & GP_LAYER_HIDE) {
|
||||
layer = layer->next;
|
||||
@@ -1816,7 +1817,7 @@ static void draw_distortion(SpaceClip *sc,
|
||||
GPU_point_size((float)(layer->thickness + 2));
|
||||
|
||||
while (frame) {
|
||||
bGPDstroke *stroke = frame->strokes.first;
|
||||
bGPDstroke *stroke = static_cast<bGPDstroke *>(frame->strokes.first);
|
||||
|
||||
while (stroke) {
|
||||
if (stroke->flag & GP_STROKE_2DSPACE) {
|
||||
@@ -1881,7 +1882,7 @@ void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
|
||||
{
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ImBuf *ibuf = NULL;
|
||||
ImBuf *ibuf = nullptr;
|
||||
int width, height;
|
||||
float zoomx, zoomy;
|
||||
|
||||
@@ -1903,7 +1904,7 @@ void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
|
||||
ibuf = ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle);
|
||||
}
|
||||
|
||||
if (ibuf != NULL && width != ibuf->x) {
|
||||
if (ibuf != nullptr && width != ibuf->x) {
|
||||
mul_v2_v2fl(translation, sc->loc, (float)width / ibuf->x);
|
||||
}
|
||||
else {
|
||||
@@ -120,7 +120,7 @@ bool ED_space_clip_maskedit_mask_poll(bContext *C)
|
||||
if (clip) {
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
|
||||
return sc->mask_info.mask != NULL;
|
||||
return sc->mask_info.mask != nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ ImBuf *ED_space_clip_get_buffer(const SpaceClip *sc)
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ImBuf *ED_space_clip_get_stable_buffer(const SpaceClip *sc,
|
||||
@@ -275,7 +275,7 @@ ImBuf *ED_space_clip_get_stable_buffer(const SpaceClip *sc,
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ED_space_clip_get_position(const SpaceClip *sc,
|
||||
@@ -344,13 +344,13 @@ bool ED_space_clip_color_sample(const SpaceClip *sc,
|
||||
void ED_clip_update_frame(const Main *mainp, int cfra)
|
||||
{
|
||||
/* image window, compo node users */
|
||||
for (wmWindowManager *wm = mainp->wm.first; wm; wm = wm->id.next) { /* only 1 wm */
|
||||
LISTBASE_FOREACH (wmWindowManager *, wm, &mainp->wm) {
|
||||
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
|
||||
bScreen *screen = WM_window_get_active_screen(win);
|
||||
|
||||
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
|
||||
if (area->spacetype == SPACE_CLIP) {
|
||||
SpaceClip *sc = area->spacedata.first;
|
||||
SpaceClip *sc = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
|
||||
sc->scopes.ok = false;
|
||||
|
||||
@@ -361,7 +361,7 @@ void ED_clip_update_frame(const Main *mainp, int cfra)
|
||||
}
|
||||
}
|
||||
|
||||
bool ED_clip_view_selection(const bContext *C, const ARegion *UNUSED(region), bool fit)
|
||||
bool ED_clip_view_selection(const bContext *C, const ARegion * /*region*/, bool fit)
|
||||
{
|
||||
float offset_x, offset_y;
|
||||
float zoom;
|
||||
@@ -594,11 +594,8 @@ void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieCl
|
||||
id_us_ensure_real((ID *)sc->clip);
|
||||
|
||||
if (screen && sc->view == SC_VIEW_CLIP) {
|
||||
ScrArea *area;
|
||||
SpaceLink *sl;
|
||||
|
||||
for (area = screen->areabase.first; area; area = area->next) {
|
||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
|
||||
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
|
||||
if (sl->spacetype == SPACE_CLIP) {
|
||||
SpaceClip *cur_sc = (SpaceClip *)sl;
|
||||
|
||||
@@ -609,7 +606,7 @@ void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieCl
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ELEM(cur_sc->clip, old_clip, NULL)) {
|
||||
if (ELEM(cur_sc->clip, old_clip, nullptr)) {
|
||||
cur_sc->clip = clip;
|
||||
}
|
||||
}
|
||||
@@ -708,25 +705,25 @@ static uchar *prefetch_read_file_to_memory(
|
||||
|
||||
int file = BLI_open(filepath, O_BINARY | O_RDONLY, 0);
|
||||
if (file == -1) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const size_t size = BLI_file_descriptor_size(file);
|
||||
if (size < 1) {
|
||||
close(file);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uchar *mem = MEM_mallocN(size, "movieclip prefetch memory file");
|
||||
if (mem == NULL) {
|
||||
uchar *mem = MEM_cnew_array<uchar>(size, "movieclip prefetch memory file");
|
||||
if (mem == nullptr) {
|
||||
close(file);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (read(file, mem, size) != size) {
|
||||
close(file);
|
||||
MEM_freeN(mem);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
*r_size = size;
|
||||
@@ -778,7 +775,7 @@ static uchar *prefetch_thread_next_frame(PrefetchQueue *queue,
|
||||
size_t *r_size,
|
||||
int *r_current_frame)
|
||||
{
|
||||
uchar *mem = NULL;
|
||||
uchar *mem = nullptr;
|
||||
|
||||
BLI_spin_lock(&queue->spin);
|
||||
if (!*queue->stop && !check_prefetch_break() &&
|
||||
@@ -848,7 +845,7 @@ static void prefetch_task_func(TaskPool *__restrict pool, void *task_data)
|
||||
MovieClipUser user = *DNA_struct_default_get(MovieClipUser);
|
||||
int flag = IB_rect | IB_multilayer | IB_alphamode_detect | IB_metadata;
|
||||
int result;
|
||||
char *colorspace_name = NULL;
|
||||
char *colorspace_name = nullptr;
|
||||
const bool use_proxy = (clip->flag & MCLIP_USE_PROXY) &&
|
||||
(queue->render_size != MCLIP_PROXY_RENDER_SIZE_FULL);
|
||||
|
||||
@@ -862,7 +859,7 @@ static void prefetch_task_func(TaskPool *__restrict pool, void *task_data)
|
||||
}
|
||||
|
||||
ibuf = IMB_ibImageFromMemory(mem, size, flag, colorspace_name, "prefetch frame");
|
||||
if (ibuf == NULL) {
|
||||
if (ibuf == nullptr) {
|
||||
continue;
|
||||
}
|
||||
BKE_movieclip_convert_multilayer_ibuf(ibuf);
|
||||
@@ -911,7 +908,7 @@ static void start_prefetch_threads(MovieClip *clip,
|
||||
|
||||
TaskPool *task_pool = BLI_task_pool_create(&queue, TASK_PRIORITY_LOW);
|
||||
for (int i = 0; i < tot_thread; i++) {
|
||||
BLI_task_pool_push(task_pool, prefetch_task_func, clip, false, NULL);
|
||||
BLI_task_pool_push(task_pool, prefetch_task_func, clip, false, nullptr);
|
||||
}
|
||||
BLI_task_pool_work_and_wait(task_pool);
|
||||
BLI_task_pool_free(task_pool);
|
||||
@@ -1002,7 +999,7 @@ static void do_prefetch_movie(MovieClip *clip,
|
||||
|
||||
static void prefetch_startjob(void *pjv, bool *stop, bool *do_update, float *progress)
|
||||
{
|
||||
PrefetchJob *pj = pjv;
|
||||
PrefetchJob *pj = static_cast<PrefetchJob *>(pjv);
|
||||
|
||||
if (pj->clip->source == MCLIP_SRC_SEQUENCE) {
|
||||
/* read sequence files in multiple threads */
|
||||
@@ -1036,10 +1033,10 @@ static void prefetch_startjob(void *pjv, bool *stop, bool *do_update, float *pro
|
||||
|
||||
static void prefetch_freejob(void *pjv)
|
||||
{
|
||||
PrefetchJob *pj = pjv;
|
||||
PrefetchJob *pj = static_cast<PrefetchJob *>(pjv);
|
||||
|
||||
MovieClip *clip_local = pj->clip_local;
|
||||
if (clip_local != NULL) {
|
||||
if (clip_local != nullptr) {
|
||||
BKE_libblock_free_datablock(&clip_local->id, 0);
|
||||
BKE_libblock_free_data(&clip_local->id, false);
|
||||
BLI_assert(!clip_local->id.py_instance); /* Or call #BKE_libblock_free_data_py. */
|
||||
@@ -1081,7 +1078,7 @@ static bool prefetch_check_early_out(const bContext *C)
|
||||
int first_uncached_frame, end_frame;
|
||||
int clip_len;
|
||||
|
||||
if (clip == NULL) {
|
||||
if (clip == nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1125,7 +1122,7 @@ void clip_start_prefetch_job(const bContext *C)
|
||||
WM_JOB_TYPE_CLIP_PREFETCH);
|
||||
|
||||
/* create new job */
|
||||
pj = MEM_callocN(sizeof(PrefetchJob), "prefetch job");
|
||||
pj = MEM_cnew<PrefetchJob>("prefetch job");
|
||||
pj->clip = ED_space_clip_get_clip(sc);
|
||||
pj->start_frame = prefetch_get_start_frame(C);
|
||||
pj->current_frame = sc->user.framenr;
|
||||
@@ -1136,12 +1133,12 @@ void clip_start_prefetch_job(const bContext *C)
|
||||
/* Create a local copy of the clip, so that video file (clip->anim) access can happen without
|
||||
* acquiring the lock which will interfere with the main thread. */
|
||||
if (pj->clip->source == MCLIP_SRC_MOVIE) {
|
||||
BKE_id_copy_ex(NULL, (ID *)&pj->clip->id, (ID **)&pj->clip_local, LIB_ID_COPY_LOCALIZE);
|
||||
BKE_id_copy_ex(nullptr, (ID *)&pj->clip->id, (ID **)&pj->clip_local, LIB_ID_COPY_LOCALIZE);
|
||||
}
|
||||
|
||||
WM_jobs_customdata_set(wm_job, pj, prefetch_freejob);
|
||||
WM_jobs_timer(wm_job, 0.2, NC_MOVIECLIP | ND_DISPLAY, 0);
|
||||
WM_jobs_callbacks(wm_job, prefetch_startjob, NULL, NULL, NULL);
|
||||
WM_jobs_callbacks(wm_job, prefetch_startjob, nullptr, nullptr, nullptr);
|
||||
|
||||
G.is_break = false;
|
||||
|
||||
@@ -1152,7 +1149,7 @@ void clip_start_prefetch_job(const bContext *C)
|
||||
void ED_clip_view_lock_state_store(const bContext *C, ClipViewLockState *state)
|
||||
{
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
BLI_assert(space_clip != NULL);
|
||||
BLI_assert(space_clip != nullptr);
|
||||
|
||||
state->offset_x = space_clip->xof;
|
||||
state->offset_y = space_clip->yof;
|
||||
@@ -1177,7 +1174,7 @@ void ED_clip_view_lock_state_store(const bContext *C, ClipViewLockState *state)
|
||||
void ED_clip_view_lock_state_restore_no_jump(const bContext *C, const ClipViewLockState *state)
|
||||
{
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
BLI_assert(space_clip != NULL);
|
||||
BLI_assert(space_clip != nullptr);
|
||||
|
||||
if ((space_clip->flag & SC_LOCK_SELECTION) == 0) {
|
||||
return;
|
||||
@@ -40,8 +40,8 @@ typedef struct TrackMotionCurveUserData {
|
||||
} TrackMotionCurveUserData;
|
||||
|
||||
static void tracking_segment_point_cb(void *userdata,
|
||||
MovieTrackingTrack *UNUSED(track),
|
||||
MovieTrackingMarker *UNUSED(marker),
|
||||
MovieTrackingTrack * /*track*/,
|
||||
MovieTrackingMarker * /*marker*/,
|
||||
eClipCurveValueSource value_source,
|
||||
int scene_framenr,
|
||||
float val)
|
||||
@@ -171,8 +171,8 @@ static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, uint
|
||||
(sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
|
||||
&userdata,
|
||||
tracking_segment_knot_cb,
|
||||
NULL,
|
||||
NULL);
|
||||
nullptr,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
/* Draw graph lines. */
|
||||
@@ -194,8 +194,8 @@ static void draw_tracks_motion_and_error_curves(View2D *v2d, SpaceClip *sc, uint
|
||||
(sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
|
||||
&userdata,
|
||||
tracking_segment_knot_cb,
|
||||
NULL,
|
||||
NULL);
|
||||
nullptr,
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,13 +92,13 @@ typedef struct {
|
||||
|
||||
static void find_nearest_tracking_segment_cb(void *userdata,
|
||||
MovieTrackingTrack *track,
|
||||
MovieTrackingMarker *UNUSED(marker),
|
||||
MovieTrackingMarker * /*marker*/,
|
||||
eClipCurveValueSource value_source,
|
||||
int scene_framenr,
|
||||
float val)
|
||||
{
|
||||
MouseSelectUserData *data = userdata;
|
||||
const float co[2] = {scene_framenr, val};
|
||||
MouseSelectUserData *data = static_cast<MouseSelectUserData *>(userdata);
|
||||
const float co[2] = {float(scene_framenr), val};
|
||||
|
||||
if (!clip_graph_value_visible(data->sc, value_source)) {
|
||||
return;
|
||||
@@ -107,7 +107,7 @@ static void find_nearest_tracking_segment_cb(void *userdata,
|
||||
if (data->has_prev) {
|
||||
float dist_sq = dist_squared_to_line_segment_v2(data->mouse_co, data->prev_co, co);
|
||||
|
||||
if (data->track == NULL || dist_sq < data->min_dist_sq) {
|
||||
if (data->track == nullptr || dist_sq < data->min_dist_sq) {
|
||||
data->track = track;
|
||||
data->min_dist_sq = dist_sq;
|
||||
data->value_source = value_source;
|
||||
@@ -120,9 +120,9 @@ static void find_nearest_tracking_segment_cb(void *userdata,
|
||||
}
|
||||
|
||||
static void find_nearest_tracking_segment_end_cb(void *userdata,
|
||||
eClipCurveValueSource UNUSED(source_value))
|
||||
eClipCurveValueSource /*source_value*/)
|
||||
{
|
||||
MouseSelectUserData *data = userdata;
|
||||
MouseSelectUserData *data = static_cast<MouseSelectUserData *>(userdata);
|
||||
|
||||
data->has_prev = false;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ static void find_nearest_tracking_knot_cb(void *userdata,
|
||||
int scene_framenr,
|
||||
float val)
|
||||
{
|
||||
MouseSelectUserData *data = userdata;
|
||||
MouseSelectUserData *data = static_cast<MouseSelectUserData *>(userdata);
|
||||
const float mdiff[2] = {scene_framenr - data->mouse_co[0], val - data->mouse_co[1]};
|
||||
float dist_sq = len_squared_v2(mdiff);
|
||||
|
||||
@@ -142,8 +142,8 @@ static void find_nearest_tracking_knot_cb(void *userdata,
|
||||
return;
|
||||
}
|
||||
|
||||
if (data->marker == NULL || dist_sq < data->min_dist_sq) {
|
||||
const float co[2] = {scene_framenr, val};
|
||||
if (data->marker == nullptr || dist_sq < data->min_dist_sq) {
|
||||
const float co[2] = {float(scene_framenr), val};
|
||||
|
||||
data->track = track;
|
||||
data->marker = marker;
|
||||
@@ -177,7 +177,7 @@ static bool mouse_select_knot(bContext *C, const float co[2], bool extend)
|
||||
|
||||
mouse_select_init_data(C, &userdata, co);
|
||||
clip_graph_tracking_values_iterate_track(
|
||||
sc, active_track, &userdata, find_nearest_tracking_knot_cb, NULL, NULL);
|
||||
sc, active_track, &userdata, find_nearest_tracking_knot_cb, nullptr, nullptr);
|
||||
|
||||
if (userdata.marker) {
|
||||
int x1, y1, x2, y2;
|
||||
@@ -234,7 +234,7 @@ static bool mouse_select_curve(bContext *C, const float co[2], bool extend)
|
||||
(sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
|
||||
&userdata,
|
||||
find_nearest_tracking_segment_cb,
|
||||
NULL,
|
||||
nullptr,
|
||||
find_nearest_tracking_segment_end_cb);
|
||||
|
||||
if (userdata.track) {
|
||||
@@ -242,7 +242,7 @@ static bool mouse_select_curve(bContext *C, const float co[2], bool extend)
|
||||
if (active_track == userdata.track) {
|
||||
/* currently only single curve can be selected
|
||||
* (selected curve represents active track) */
|
||||
active_track = NULL;
|
||||
active_track = nullptr;
|
||||
}
|
||||
}
|
||||
else if (active_track != userdata.track) {
|
||||
@@ -280,7 +280,7 @@ static int mouse_select(bContext *C, float co[2], bool extend)
|
||||
}
|
||||
|
||||
if (sel) {
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -328,7 +328,7 @@ void CLIP_OT_graph_select(wmOperatorType *ot)
|
||||
RNA_def_float_vector(ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -351,7 +351,7 @@ typedef struct BoxSelectuserData {
|
||||
} BoxSelectuserData;
|
||||
|
||||
static void box_select_cb(void *userdata,
|
||||
MovieTrackingTrack *UNUSED(track),
|
||||
MovieTrackingTrack * /*track*/,
|
||||
MovieTrackingMarker *marker,
|
||||
eClipCurveValueSource value_source,
|
||||
int scene_framenr,
|
||||
@@ -396,7 +396,7 @@ static int box_select_graph_exec(bContext *C, wmOperator *op)
|
||||
BoxSelectuserData userdata;
|
||||
rctf rect;
|
||||
|
||||
if (active_track == NULL) {
|
||||
if (active_track == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -408,10 +408,11 @@ static int box_select_graph_exec(bContext *C, wmOperator *op)
|
||||
userdata.select = !RNA_boolean_get(op->ptr, "deselect");
|
||||
userdata.extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
clip_graph_tracking_values_iterate_track(sc, active_track, &userdata, box_select_cb, NULL, NULL);
|
||||
clip_graph_tracking_values_iterate_track(
|
||||
sc, active_track, &userdata, box_select_cb, nullptr, nullptr);
|
||||
|
||||
if (userdata.changed) {
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -482,7 +483,7 @@ static int graph_select_all_markers_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -506,7 +507,7 @@ void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
|
||||
|
||||
/******************** delete curve operator ********************/
|
||||
|
||||
static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int delete_curve_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -540,7 +541,7 @@ void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
|
||||
|
||||
/******************** delete knot operator ********************/
|
||||
|
||||
static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int delete_knot_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -587,10 +588,10 @@ typedef struct {
|
||||
} ViewAllUserData;
|
||||
|
||||
static void view_all_cb(void *userdata,
|
||||
MovieTrackingTrack *UNUSED(track),
|
||||
MovieTrackingMarker *UNUSED(marker),
|
||||
eClipCurveValueSource UNUSED(value_source),
|
||||
int UNUSED(scene_framenr),
|
||||
MovieTrackingTrack * /*track*/,
|
||||
MovieTrackingMarker * /*marker*/,
|
||||
eClipCurveValueSource /*value_source*/,
|
||||
int /*scene_framenr*/,
|
||||
float val)
|
||||
{
|
||||
ViewAllUserData *data = (ViewAllUserData *)userdata;
|
||||
@@ -604,7 +605,7 @@ static void view_all_cb(void *userdata,
|
||||
}
|
||||
}
|
||||
|
||||
static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int view_all_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
@@ -621,8 +622,8 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
(sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
|
||||
&userdata,
|
||||
view_all_cb,
|
||||
NULL,
|
||||
NULL);
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
/* set extents of view to start/end frames */
|
||||
v2d->cur.xmin = (float)scene->r.sfra;
|
||||
@@ -675,7 +676,7 @@ void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
|
||||
v2d->cur.xmax = (float)scene->r.cfra + extra;
|
||||
}
|
||||
|
||||
static int center_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int center_current_frame_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
@@ -742,7 +743,7 @@ void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
|
||||
{0, "DISABLE", 0, "Disable", "Disable selected markers"},
|
||||
{1, "ENABLE", 0, "Enable", "Enable selected markers"},
|
||||
{2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -42,21 +42,21 @@ struct wmOperatorType;
|
||||
|
||||
/* internal exports only */
|
||||
|
||||
/* clip_buttons.c */
|
||||
/* clip_buttons.cc */
|
||||
|
||||
void ED_clip_buttons_register(struct ARegionType *art);
|
||||
|
||||
/* clip_dopesheet_draw.c */
|
||||
/* clip_dopesheet_draw.cc */
|
||||
|
||||
void clip_draw_dopesheet_main(struct SpaceClip *sc, struct ARegion *region, struct Scene *scene);
|
||||
void clip_draw_dopesheet_channels(const struct bContext *C, struct ARegion *region);
|
||||
|
||||
/* clip_dopesheet_ops.c */
|
||||
/* clip_dopesheet_ops.cc */
|
||||
|
||||
void CLIP_OT_dopesheet_select_channel(struct wmOperatorType *ot);
|
||||
void CLIP_OT_dopesheet_view_all(struct wmOperatorType *ot);
|
||||
|
||||
/* clip_draw.c */
|
||||
/* clip_draw.cc */
|
||||
|
||||
void clip_draw_main(const struct bContext *C, struct SpaceClip *sc, struct ARegion *region);
|
||||
|
||||
@@ -65,15 +65,15 @@ void clip_draw_main(const struct bContext *C, struct SpaceClip *sc, struct ARegi
|
||||
void clip_draw_grease_pencil(struct bContext *C, int onlyv2d);
|
||||
void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region);
|
||||
|
||||
/* clip_editor.c */
|
||||
/* clip_editor.cc */
|
||||
|
||||
void clip_start_prefetch_job(const struct bContext *C);
|
||||
|
||||
/* clip_graph_draw.c */
|
||||
/* clip_graph_draw.cc */
|
||||
|
||||
void clip_draw_graph(struct SpaceClip *sc, struct ARegion *region, struct Scene *scene);
|
||||
|
||||
/* clip_graph_ops.c */
|
||||
/* clip_graph_ops.cc */
|
||||
|
||||
void ED_clip_graph_center_current_frame(struct Scene *scene, struct ARegion *region);
|
||||
|
||||
@@ -86,7 +86,7 @@ void CLIP_OT_graph_view_all(struct wmOperatorType *ot);
|
||||
void CLIP_OT_graph_center_current_frame(struct wmOperatorType *ot);
|
||||
void CLIP_OT_graph_disable_markers(struct wmOperatorType *ot);
|
||||
|
||||
/* clip_ops.c */
|
||||
/* clip_ops.cc */
|
||||
|
||||
void CLIP_OT_open(struct wmOperatorType *ot);
|
||||
void CLIP_OT_reload(struct wmOperatorType *ot);
|
||||
@@ -114,11 +114,11 @@ void CLIP_OT_cursor_set(struct wmOperatorType *ot);
|
||||
|
||||
void CLIP_OT_lock_selection_toggle(struct wmOperatorType *ot);
|
||||
|
||||
/* clip_toolbar.c */
|
||||
/* clip_toolbar.cc */
|
||||
|
||||
struct ARegion *ED_clip_has_properties_region(struct ScrArea *area);
|
||||
|
||||
/* clip_utils.c */
|
||||
/* clip_utils.cc */
|
||||
|
||||
typedef enum {
|
||||
CLIP_VALUE_SOURCE_SPEED_X,
|
||||
@@ -194,7 +194,7 @@ bool clip_view_has_locked_selection(const struct bContext *C);
|
||||
|
||||
void clip_draw_sfra_efra(struct View2D *v2d, struct Scene *scene);
|
||||
|
||||
/* tracking_ops.c */
|
||||
/* tracking_ops.cc */
|
||||
|
||||
/* Find track which can be slid in a proximity of the given event.
|
||||
* Uses the same distance tolerance rule as the "Slide Marker" operator. */
|
||||
@@ -261,7 +261,7 @@ void CLIP_OT_keyframe_delete(struct wmOperatorType *ot);
|
||||
void CLIP_OT_new_image_from_plane_marker(struct wmOperatorType *ot);
|
||||
void CLIP_OT_update_image_from_plane_marker(struct wmOperatorType *ot);
|
||||
|
||||
/* tracking_select.c */
|
||||
/* tracking_select.cc */
|
||||
|
||||
void CLIP_OT_select(struct wmOperatorType *ot);
|
||||
void CLIP_OT_select_all(struct wmOperatorType *ot);
|
||||
|
||||
@@ -135,7 +135,7 @@ static void sclip_zoom_set_factor_exec(bContext *C, const wmEvent *event, float
|
||||
{
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
|
||||
float location[2], *mpos = NULL;
|
||||
float location[2], *mpos = nullptr;
|
||||
|
||||
if (event) {
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
@@ -166,14 +166,14 @@ static void open_init(bContext *C, wmOperator *op)
|
||||
{
|
||||
PropertyPointerRNA *pprop;
|
||||
|
||||
op->customdata = pprop = MEM_callocN(sizeof(PropertyPointerRNA), "OpenPropertyPointerRNA");
|
||||
op->customdata = pprop = MEM_cnew<PropertyPointerRNA>("OpenPropertyPointerRNA");
|
||||
UI_context_active_but_prop_get_templateID(C, &pprop->ptr, &pprop->prop);
|
||||
}
|
||||
|
||||
static void open_cancel(bContext *UNUSED(C), wmOperator *op)
|
||||
static void open_cancel(bContext * /*C*/, wmOperator *op)
|
||||
{
|
||||
MEM_freeN(op->customdata);
|
||||
op->customdata = NULL;
|
||||
op->customdata = nullptr;
|
||||
}
|
||||
|
||||
static int open_exec(bContext *C, wmOperator *op)
|
||||
@@ -183,7 +183,7 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
Main *bmain = CTX_data_main(C);
|
||||
PropertyPointerRNA *pprop;
|
||||
PointerRNA idptr;
|
||||
MovieClip *clip = NULL;
|
||||
MovieClip *clip = nullptr;
|
||||
char str[FILE_MAX];
|
||||
|
||||
if (!RNA_collection_is_empty(op->ptr, "files")) {
|
||||
@@ -234,7 +234,7 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
/* hook into UI */
|
||||
pprop = op->customdata;
|
||||
pprop = static_cast<PropertyPointerRNA *>(op->customdata);
|
||||
|
||||
if (pprop->prop) {
|
||||
/* when creating new ID blocks, use is already 1, but RNA
|
||||
@@ -242,7 +242,7 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
id_us_min(&clip->id);
|
||||
|
||||
RNA_id_pointer_create(&clip->id, &idptr);
|
||||
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, NULL);
|
||||
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, nullptr);
|
||||
RNA_property_update(C, &pprop->ptr, pprop->prop);
|
||||
}
|
||||
else if (sc) {
|
||||
@@ -257,11 +257,11 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
static int open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
char path[FILE_MAX];
|
||||
MovieClip *clip = NULL;
|
||||
MovieClip *clip = nullptr;
|
||||
|
||||
if (sc) {
|
||||
clip = ED_space_clip_get_clip(sc);
|
||||
@@ -323,7 +323,7 @@ void CLIP_OT_open(wmOperatorType *ot)
|
||||
/** \name Reload Clip Operator
|
||||
* \{ */
|
||||
|
||||
static int reload_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int reload_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
MovieClip *clip = CTX_data_edit_movieclip(C);
|
||||
|
||||
@@ -331,7 +331,7 @@ static int reload_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
WM_jobs_kill_type(CTX_wm_manager(C), NULL, WM_JOB_TYPE_CLIP_PREFETCH);
|
||||
WM_jobs_kill_type(CTX_wm_manager(C), nullptr, WM_JOB_TYPE_CLIP_PREFETCH);
|
||||
BKE_movieclip_reload(CTX_data_main(C), clip);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);
|
||||
@@ -370,7 +370,7 @@ static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ViewPanData *vpd;
|
||||
|
||||
op->customdata = vpd = MEM_callocN(sizeof(ViewPanData), "ClipViewPanData");
|
||||
op->customdata = vpd = MEM_cnew<ViewPanData>("ClipViewPanData");
|
||||
|
||||
/* Grab will be set when running from gizmo. */
|
||||
vpd->own_cursor = (win->grabcursor == 0);
|
||||
@@ -398,7 +398,7 @@ static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
||||
static void view_pan_exit(bContext *C, wmOperator *op, bool cancel)
|
||||
{
|
||||
ViewPanData *vpd = op->customdata;
|
||||
ViewPanData *vpd = static_cast<ViewPanData *>(op->customdata);
|
||||
|
||||
if (cancel) {
|
||||
copy_v2_v2(vpd->vec, &vpd->xorig);
|
||||
@@ -457,7 +457,7 @@ static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ViewPanData *vpd = op->customdata;
|
||||
ViewPanData *vpd = static_cast<ViewPanData *>(op->customdata);
|
||||
float offset[2];
|
||||
|
||||
switch (event->type) {
|
||||
@@ -514,7 +514,7 @@ void CLIP_OT_view_pan(wmOperatorType *ot)
|
||||
RNA_def_float_vector(ot->srna,
|
||||
"offset",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Offset",
|
||||
@@ -546,7 +546,7 @@ static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
ViewZoomData *vpd;
|
||||
|
||||
op->customdata = vpd = MEM_callocN(sizeof(ViewZoomData), "ClipViewZoomData");
|
||||
op->customdata = vpd = MEM_cnew<ViewZoomData>("ClipViewZoomData");
|
||||
|
||||
/* Grab will be set when running from gizmo. */
|
||||
vpd->own_cursor = (win->grabcursor == 0);
|
||||
@@ -573,7 +573,7 @@ static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
static void view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ViewZoomData *vpd = op->customdata;
|
||||
ViewZoomData *vpd = static_cast<ViewZoomData *>(op->customdata);
|
||||
|
||||
if (cancel) {
|
||||
sc->zoom = vpd->zoom;
|
||||
@@ -592,7 +592,7 @@ static void view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
|
||||
|
||||
static int view_zoom_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
sclip_zoom_set_factor(C, RNA_float_get(op->ptr, "factor"), NULL, false);
|
||||
sclip_zoom_set_factor(C, RNA_float_get(op->ptr, "factor"), nullptr, false);
|
||||
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
|
||||
@@ -668,7 +668,7 @@ static void view_zoom_apply(
|
||||
|
||||
static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
ViewZoomData *vpd = op->customdata;
|
||||
ViewZoomData *vpd = static_cast<ViewZoomData *>(op->customdata);
|
||||
const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init");
|
||||
switch (event->type) {
|
||||
case TIMER:
|
||||
@@ -783,7 +783,7 @@ void CLIP_OT_view_zoom_in(wmOperatorType *ot)
|
||||
prop = RNA_def_float_vector(ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -840,7 +840,7 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot)
|
||||
prop = RNA_def_float_vector(ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -860,7 +860,7 @@ static int view_zoom_ratio_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
|
||||
sclip_zoom_set(C, RNA_float_get(op->ptr, "ratio"), NULL, false);
|
||||
sclip_zoom_set(C, RNA_float_get(op->ptr, "ratio"), nullptr, false);
|
||||
|
||||
/* ensure pixel exact locations for draw */
|
||||
sc->xof = (int)sc->xof;
|
||||
@@ -932,7 +932,7 @@ static int view_all_exec(bContext *C, wmOperator *op)
|
||||
zoomx = (float)width / (w + 2 * margin);
|
||||
zoomy = (float)height / (h + 2 * margin);
|
||||
|
||||
sclip_zoom_set(C, min_ff(zoomx, zoomy), NULL, false);
|
||||
sclip_zoom_set(C, min_ff(zoomx, zoomy), nullptr, false);
|
||||
}
|
||||
else {
|
||||
if ((w >= width || h >= height) && (width > 0 && height > 0)) {
|
||||
@@ -940,10 +940,10 @@ static int view_all_exec(bContext *C, wmOperator *op)
|
||||
zoomy = (float)height / h;
|
||||
|
||||
/* find the zoom value that will fit the image in the image space */
|
||||
sclip_zoom_set(C, 1.0f / power_of_2(1.0f / min_ff(zoomx, zoomy)), NULL, false);
|
||||
sclip_zoom_set(C, 1.0f / power_of_2(1.0f / min_ff(zoomx, zoomy)), nullptr, false);
|
||||
}
|
||||
else {
|
||||
sclip_zoom_set(C, 1.0f, NULL, false);
|
||||
sclip_zoom_set(C, 1.0f, nullptr, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,7 +981,7 @@ void CLIP_OT_view_all(wmOperatorType *ot)
|
||||
/** \name Center View To Cursor Operator
|
||||
* \{ */
|
||||
|
||||
static int view_center_cursor_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int view_center_cursor_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
@@ -1011,7 +1011,7 @@ void CLIP_OT_view_center_cursor(wmOperatorType *ot)
|
||||
/** \name Frame Selected Operator
|
||||
* \{ */
|
||||
|
||||
static int view_selected_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int view_selected_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
@@ -1053,7 +1053,7 @@ static bool change_frame_poll(bContext *C)
|
||||
return false;
|
||||
}
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
return space_clip != NULL;
|
||||
return space_clip != nullptr;
|
||||
}
|
||||
|
||||
static void change_frame_apply(bContext *C, wmOperator *op)
|
||||
@@ -1178,7 +1178,7 @@ typedef struct ProxyBuildJob {
|
||||
|
||||
static void proxy_freejob(void *pjv)
|
||||
{
|
||||
ProxyJob *pj = pjv;
|
||||
ProxyJob *pj = static_cast<ProxyJob *>(pjv);
|
||||
|
||||
MEM_freeN(pj);
|
||||
}
|
||||
@@ -1215,17 +1215,17 @@ static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undisto
|
||||
|
||||
/* simple case for movies -- handle frame-by-frame, do threading within single frame */
|
||||
static void do_movie_proxy(void *pjv,
|
||||
int *UNUSED(build_sizes),
|
||||
int UNUSED(build_count),
|
||||
int * /*build_sizes*/,
|
||||
int /*build_count*/,
|
||||
int *build_undistort_sizes,
|
||||
int build_undistort_count,
|
||||
bool *stop,
|
||||
bool *do_update,
|
||||
float *progress)
|
||||
{
|
||||
ProxyJob *pj = pjv;
|
||||
ProxyJob *pj = static_cast<ProxyJob *>(pjv);
|
||||
MovieClip *clip = pj->clip;
|
||||
struct MovieDistortion *distortion = NULL;
|
||||
struct MovieDistortion *distortion = nullptr;
|
||||
|
||||
if (pj->index_context) {
|
||||
IMB_anim_index_rebuild(pj->index_context, stop, do_update, progress);
|
||||
@@ -1246,7 +1246,7 @@ static void do_movie_proxy(void *pjv,
|
||||
int threads = BLI_system_thread_count();
|
||||
int width, height;
|
||||
|
||||
BKE_movieclip_get_size(clip, NULL, &width, &height);
|
||||
BKE_movieclip_get_size(clip, nullptr, &width, &height);
|
||||
|
||||
distortion = BKE_tracking_distortion_new(&clip->tracking, width, height);
|
||||
BKE_tracking_distortion_set_threads(distortion, threads);
|
||||
@@ -1302,7 +1302,7 @@ static uchar *proxy_thread_next_frame(ProxyQueue *queue,
|
||||
size_t *r_size,
|
||||
int *r_cfra)
|
||||
{
|
||||
uchar *mem = NULL;
|
||||
uchar *mem = nullptr;
|
||||
|
||||
BLI_spin_lock(&queue->spin);
|
||||
if (!*queue->stop && queue->cfra <= queue->efra) {
|
||||
@@ -1318,23 +1318,23 @@ static uchar *proxy_thread_next_frame(ProxyQueue *queue,
|
||||
file = BLI_open(filepath, O_BINARY | O_RDONLY, 0);
|
||||
if (file < 0) {
|
||||
BLI_spin_unlock(&queue->spin);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
size = BLI_file_descriptor_size(file);
|
||||
if (size < 1) {
|
||||
close(file);
|
||||
BLI_spin_unlock(&queue->spin);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mem = MEM_mallocN(size, "movieclip proxy memory file");
|
||||
mem = MEM_cnew_array<uchar>(size, "movieclip proxy memory file");
|
||||
|
||||
if (read(file, mem, size) != size) {
|
||||
close(file);
|
||||
BLI_spin_unlock(&queue->spin);
|
||||
MEM_freeN(mem);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
*r_size = size;
|
||||
@@ -1369,7 +1369,7 @@ static void proxy_task_func(TaskPool *__restrict pool, void *task_data)
|
||||
"proxy frame");
|
||||
|
||||
BKE_movieclip_build_proxy_frame_for_ibuf(
|
||||
data->clip, ibuf, NULL, cfra, data->build_sizes, data->build_count, false);
|
||||
data->clip, ibuf, nullptr, cfra, data->build_sizes, data->build_count, false);
|
||||
|
||||
BKE_movieclip_build_proxy_frame_for_ibuf(data->clip,
|
||||
ibuf,
|
||||
@@ -1396,7 +1396,7 @@ static void do_sequence_proxy(void *pjv,
|
||||
bool *do_update,
|
||||
float *progress)
|
||||
{
|
||||
ProxyJob *pj = pjv;
|
||||
ProxyJob *pj = static_cast<ProxyJob *>(pjv);
|
||||
MovieClip *clip = pj->clip;
|
||||
Scene *scene = pj->scene;
|
||||
int sfra = scene->r.sfra, efra = scene->r.efra;
|
||||
@@ -1405,7 +1405,7 @@ static void do_sequence_proxy(void *pjv,
|
||||
int width, height;
|
||||
|
||||
if (build_undistort_count) {
|
||||
BKE_movieclip_get_size(clip, NULL, &width, &height);
|
||||
BKE_movieclip_get_size(clip, nullptr, &width, &height);
|
||||
}
|
||||
|
||||
ProxyQueue queue;
|
||||
@@ -1419,7 +1419,7 @@ static void do_sequence_proxy(void *pjv,
|
||||
queue.progress = progress;
|
||||
|
||||
TaskPool *task_pool = BLI_task_pool_create(&queue, TASK_PRIORITY_LOW);
|
||||
handles = MEM_callocN(sizeof(ProxyThread) * tot_thread, "proxy threaded handles");
|
||||
handles = MEM_cnew_array<ProxyThread>(tot_thread, "proxy threaded handles");
|
||||
for (int i = 0; i < tot_thread; i++) {
|
||||
ProxyThread *handle = &handles[i];
|
||||
|
||||
@@ -1435,7 +1435,7 @@ static void do_sequence_proxy(void *pjv,
|
||||
handle->distortion = BKE_tracking_distortion_new(&clip->tracking, width, height);
|
||||
}
|
||||
|
||||
BLI_task_pool_push(task_pool, proxy_task_func, handle, false, NULL);
|
||||
BLI_task_pool_push(task_pool, proxy_task_func, handle, false, nullptr);
|
||||
}
|
||||
|
||||
BLI_task_pool_work_and_wait(task_pool);
|
||||
@@ -1454,7 +1454,7 @@ static void do_sequence_proxy(void *pjv,
|
||||
|
||||
static void proxy_startjob(void *pjv, bool *stop, bool *do_update, float *progress)
|
||||
{
|
||||
ProxyJob *pj = pjv;
|
||||
ProxyJob *pj = static_cast<ProxyJob *>(pjv);
|
||||
MovieClip *clip = pj->clip;
|
||||
|
||||
short size_flag;
|
||||
@@ -1490,7 +1490,7 @@ static void proxy_startjob(void *pjv, bool *stop, bool *do_update, float *progre
|
||||
|
||||
static void proxy_endjob(void *pjv)
|
||||
{
|
||||
ProxyJob *pj = pjv;
|
||||
ProxyJob *pj = static_cast<ProxyJob *>(pjv);
|
||||
|
||||
if (pj->clip->anim) {
|
||||
IMB_close_anim_proxies(pj->clip->anim);
|
||||
@@ -1512,7 +1512,7 @@ static void proxy_endjob(void *pjv)
|
||||
WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, pj->clip);
|
||||
}
|
||||
|
||||
static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int clip_rebuild_proxy_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
wmJob *wm_job;
|
||||
ProxyJob *pj;
|
||||
@@ -1532,25 +1532,26 @@ static int clip_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
WM_JOB_PROGRESS,
|
||||
WM_JOB_TYPE_CLIP_BUILD_PROXY);
|
||||
|
||||
pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job");
|
||||
pj = MEM_cnew<ProxyJob>("proxy rebuild job");
|
||||
pj->scene = scene;
|
||||
pj->main = CTX_data_main(C);
|
||||
pj->clip = clip;
|
||||
pj->clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS;
|
||||
|
||||
if (clip->anim) {
|
||||
pj->index_context = IMB_anim_index_rebuild_context(clip->anim,
|
||||
clip->proxy.build_tc_flag,
|
||||
clip->proxy.build_size_flag,
|
||||
clip->proxy.quality,
|
||||
true,
|
||||
NULL,
|
||||
false);
|
||||
pj->index_context = IMB_anim_index_rebuild_context(
|
||||
clip->anim,
|
||||
IMB_Timecode_Type(clip->proxy.build_tc_flag),
|
||||
IMB_Proxy_Size(clip->proxy.build_size_flag),
|
||||
clip->proxy.quality,
|
||||
true,
|
||||
nullptr,
|
||||
false);
|
||||
}
|
||||
|
||||
WM_jobs_customdata_set(wm_job, pj, proxy_freejob);
|
||||
WM_jobs_timer(wm_job, 0.2, NC_MOVIECLIP | ND_DISPLAY, 0);
|
||||
WM_jobs_callbacks(wm_job, proxy_startjob, NULL, NULL, proxy_endjob);
|
||||
WM_jobs_callbacks(wm_job, proxy_startjob, nullptr, nullptr, proxy_endjob);
|
||||
|
||||
G.is_break = false;
|
||||
WM_jobs_start(CTX_wm_manager(C), wm_job);
|
||||
@@ -1593,7 +1594,7 @@ static int mode_set_exec(bContext *C, wmOperator *op)
|
||||
sc->view = SC_VIEW_CLIP;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -1630,7 +1631,7 @@ void CLIP_OT_mode_set(wmOperatorType *ot)
|
||||
* that explains the negative signs in the code below
|
||||
*/
|
||||
|
||||
static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
|
||||
static int clip_view_ndof_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event)
|
||||
{
|
||||
if (event->type != NDOF_MOTION) {
|
||||
return OPERATOR_CANCELLED;
|
||||
@@ -1640,7 +1641,7 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
float pan_vec[3];
|
||||
|
||||
const wmNDOFMotionData *ndof = event->customdata;
|
||||
const wmNDOFMotionData *ndof = static_cast<wmNDOFMotionData *>(event->customdata);
|
||||
const float pan_speed = NDOF_PIXELS_PER_SECOND;
|
||||
|
||||
WM_event_ndof_pan_get(ndof, pan_vec, true);
|
||||
@@ -1648,7 +1649,7 @@ static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
|
||||
mul_v3_fl(pan_vec, ndof->dt);
|
||||
mul_v2_fl(pan_vec, pan_speed / sc->zoom);
|
||||
|
||||
sclip_zoom_set_factor(C, max_ff(0.0f, 1.0f - pan_vec[2]), NULL, false);
|
||||
sclip_zoom_set_factor(C, max_ff(0.0f, 1.0f - pan_vec[2]), nullptr, false);
|
||||
sc->xof += pan_vec[0];
|
||||
sc->yof += pan_vec[1];
|
||||
|
||||
@@ -1680,7 +1681,7 @@ void CLIP_OT_view_ndof(wmOperatorType *ot)
|
||||
/** \name Prefetch Operator
|
||||
* \{ */
|
||||
|
||||
static int clip_prefetch_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
|
||||
static int clip_prefetch_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event)
|
||||
{
|
||||
/* no running blender, remove handler and pass through */
|
||||
if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_CLIP_PREFETCH)) {
|
||||
@@ -1696,7 +1697,7 @@ static int clip_prefetch_modal(bContext *C, wmOperator *UNUSED(op), const wmEven
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
|
||||
static int clip_prefetch_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(_event))
|
||||
static int clip_prefetch_invoke(bContext *C, wmOperator *op, const wmEvent * /*_event*/)
|
||||
{
|
||||
clip_start_prefetch_job(C);
|
||||
|
||||
@@ -1725,13 +1726,13 @@ void CLIP_OT_prefetch(wmOperatorType *ot)
|
||||
/** \name Set Scene Frames Operator
|
||||
* \{ */
|
||||
|
||||
static int clip_set_scene_frames_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int clip_set_scene_frames_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
MovieClip *clip = CTX_data_edit_movieclip(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
int clip_length;
|
||||
|
||||
if (ELEM(NULL, scene, clip)) {
|
||||
if (ELEM(nullptr, scene, clip)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -1779,7 +1780,7 @@ static int clip_set_2d_cursor_exec(bContext *C, wmOperator *op)
|
||||
|
||||
RNA_float_get_array(op->ptr, "location", sclip->cursor);
|
||||
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, nullptr);
|
||||
|
||||
/* Use pass-through to allow click-drag to transform the cursor. */
|
||||
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
|
||||
@@ -1816,7 +1817,7 @@ void CLIP_OT_cursor_set(wmOperatorType *ot)
|
||||
RNA_def_float_vector(ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -1831,7 +1832,7 @@ void CLIP_OT_cursor_set(wmOperatorType *ot)
|
||||
/** \name Toggle Lock To Selection Operator
|
||||
* \{ */
|
||||
|
||||
static int lock_selection_toggle_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int lock_selection_toggle_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
|
||||
@@ -1842,7 +1843,7 @@ static int lock_selection_toggle_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
|
||||
ED_clip_view_lock_state_restore_no_jump(C, &lock_state);
|
||||
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CLIP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -38,11 +38,11 @@ ARegion *ED_clip_has_properties_region(ScrArea *area)
|
||||
region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
|
||||
|
||||
/* is error! */
|
||||
if (region == NULL) {
|
||||
return NULL;
|
||||
if (region == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
arnew = MEM_callocN(sizeof(ARegion), "clip properties region");
|
||||
arnew = MEM_cnew<ARegion>("clip properties region");
|
||||
|
||||
BLI_insertlinkafter(&area->regionbase, region, arnew);
|
||||
arnew->regiontype = RGN_TYPE_UI;
|
||||
@@ -192,7 +192,7 @@ static void clip_graph_tracking_values_iterate_track_reprojection_error_values(
|
||||
* 2D position is not known. */
|
||||
if (marker->flag & MARKER_DISABLED) {
|
||||
if (is_segment_open) {
|
||||
if (segment_end != NULL) {
|
||||
if (segment_end != nullptr) {
|
||||
segment_end(userdata, CLIP_VALUE_SOURCE_REPROJECTION_ERROR);
|
||||
}
|
||||
is_segment_open = false;
|
||||
@@ -202,7 +202,7 @@ static void clip_graph_tracking_values_iterate_track_reprojection_error_values(
|
||||
|
||||
/* Begin new segment if it is not open yet. */
|
||||
if (!is_segment_open) {
|
||||
if (segment_start != NULL) {
|
||||
if (segment_start != nullptr) {
|
||||
if ((marker_index + 1) == track->markersnr) {
|
||||
segment_start(userdata, track, CLIP_VALUE_SOURCE_REPROJECTION_ERROR, true);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ static void clip_graph_tracking_values_iterate_track_reprojection_error_values(
|
||||
is_segment_open = true;
|
||||
}
|
||||
|
||||
if (func != NULL) {
|
||||
if (func != nullptr) {
|
||||
const int scene_framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, marker->framenr);
|
||||
const float reprojection_error = calculate_reprojection_error_at_marker(
|
||||
clip, tracking, tracking_object, track, marker, clip_width, clip_height, scene_framenr);
|
||||
@@ -229,7 +229,7 @@ static void clip_graph_tracking_values_iterate_track_reprojection_error_values(
|
||||
}
|
||||
}
|
||||
|
||||
if (is_segment_open && segment_end != NULL) {
|
||||
if (is_segment_open && segment_end != nullptr) {
|
||||
segment_end(userdata, CLIP_VALUE_SOURCE_REPROJECTION_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -313,7 +313,7 @@ void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
|
||||
const bool used_for_stabilization = (track->flag &
|
||||
(TRACK_USE_2D_STAB | TRACK_USE_2D_STAB_ROT)) != 0;
|
||||
if (track == tracking_object->active_track) {
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
}
|
||||
/* Handle reconstruction display in 3d viewport. */
|
||||
if (track->flag & TRACK_HAS_BUNDLE) {
|
||||
@@ -339,7 +339,7 @@ void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
|
||||
/* Inform dependency graph. */
|
||||
DEG_id_tag_update(&clip->id, 0);
|
||||
if (has_bundle) {
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ void clip_delete_plane_track(bContext *C, MovieClip *clip, MovieTrackingPlaneTra
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(&clip->tracking);
|
||||
|
||||
if (plane_track == tracking_object->active_plane_track) {
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
}
|
||||
|
||||
/* Delete f-curves associated with the track (such as weight, i.e.) */
|
||||
@@ -456,7 +456,7 @@ static bool tracking_has_selection(SpaceClip *space_clip)
|
||||
continue;
|
||||
}
|
||||
const MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
|
||||
if (marker != NULL) {
|
||||
if (marker != nullptr) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -467,7 +467,7 @@ static bool tracking_has_selection(SpaceClip *space_clip)
|
||||
static bool mask_has_selection(const bContext *C)
|
||||
{
|
||||
Mask *mask = CTX_data_edit_mask(C);
|
||||
if (mask == NULL) {
|
||||
if (mask == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -536,7 +536,7 @@ bool clip_view_calculate_view_selection(
|
||||
int frame_width, frame_height;
|
||||
ED_space_clip_get_size(sc, &frame_width, &frame_height);
|
||||
|
||||
if ((frame_width == 0) || (frame_height == 0) || (sc->clip == NULL)) {
|
||||
if ((frame_width == 0) || (frame_height == 0) || (sc->clip == nullptr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -146,11 +146,11 @@ static ARegion *ED_clip_has_preview_region(const bContext *C, ScrArea *area)
|
||||
region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
||||
|
||||
/* is error! */
|
||||
if (region == NULL) {
|
||||
return NULL;
|
||||
if (region == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
arnew = MEM_callocN(sizeof(ARegion), "clip preview region");
|
||||
arnew = MEM_cnew<ARegion>("clip preview region");
|
||||
|
||||
BLI_insertlinkbefore(&area->regionbase, region, arnew);
|
||||
init_preview_region(CTX_data_scene(C), area, CTX_wm_space_clip(C), arnew);
|
||||
@@ -171,11 +171,11 @@ static ARegion *ED_clip_has_channels_region(ScrArea *area)
|
||||
region = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
|
||||
|
||||
/* is error! */
|
||||
if (region == NULL) {
|
||||
return NULL;
|
||||
if (region == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
arnew = MEM_callocN(sizeof(ARegion), "clip channels region");
|
||||
arnew = MEM_cnew<ARegion>("clip channels region");
|
||||
|
||||
BLI_insertlinkbefore(&area->regionbase, region, arnew);
|
||||
arnew->regiontype = RGN_TYPE_CHANNELS;
|
||||
@@ -190,14 +190,13 @@ static ARegion *ED_clip_has_channels_region(ScrArea *area)
|
||||
static void clip_scopes_tag_refresh(ScrArea *area)
|
||||
{
|
||||
SpaceClip *sc = (SpaceClip *)area->spacedata.first;
|
||||
ARegion *region;
|
||||
|
||||
if (sc->mode != SC_MODE_TRACKING) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* only while properties are visible */
|
||||
for (region = area->regionbase.first; region; region = region->next) {
|
||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||
if (region->regiontype == RGN_TYPE_UI && region->flag & RGN_FLAG_HIDDEN) {
|
||||
return;
|
||||
}
|
||||
@@ -231,28 +230,28 @@ static SpaceLink *clip_create(const ScrArea *area, const Scene *scene)
|
||||
sc = DNA_struct_default_alloc(SpaceClip);
|
||||
|
||||
/* header */
|
||||
region = MEM_callocN(sizeof(ARegion), "header for clip");
|
||||
region = MEM_cnew<ARegion>("header for clip");
|
||||
|
||||
BLI_addtail(&sc->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_HEADER;
|
||||
region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
|
||||
|
||||
/* tools view */
|
||||
region = MEM_callocN(sizeof(ARegion), "tools for clip");
|
||||
region = MEM_cnew<ARegion>("tools for clip");
|
||||
|
||||
BLI_addtail(&sc->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_TOOLS;
|
||||
region->alignment = RGN_ALIGN_LEFT;
|
||||
|
||||
/* properties view */
|
||||
region = MEM_callocN(sizeof(ARegion), "properties for clip");
|
||||
region = MEM_cnew<ARegion>("properties for clip");
|
||||
|
||||
BLI_addtail(&sc->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_UI;
|
||||
region->alignment = RGN_ALIGN_RIGHT;
|
||||
|
||||
/* channels view */
|
||||
region = MEM_callocN(sizeof(ARegion), "channels for clip");
|
||||
region = MEM_cnew<ARegion>("channels for clip");
|
||||
|
||||
BLI_addtail(&sc->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_CHANNELS;
|
||||
@@ -262,13 +261,13 @@ static SpaceLink *clip_create(const ScrArea *area, const Scene *scene)
|
||||
region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
||||
|
||||
/* preview view */
|
||||
region = MEM_callocN(sizeof(ARegion), "preview for clip");
|
||||
region = MEM_cnew<ARegion>("preview for clip");
|
||||
|
||||
BLI_addtail(&sc->regionbase, region);
|
||||
init_preview_region(scene, area, sc, region);
|
||||
|
||||
/* main region */
|
||||
region = MEM_callocN(sizeof(ARegion), "main region for clip");
|
||||
region = MEM_cnew<ARegion>("main region for clip");
|
||||
|
||||
BLI_addtail(&sc->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_WINDOW;
|
||||
@@ -281,7 +280,7 @@ static void clip_free(SpaceLink *sl)
|
||||
{
|
||||
SpaceClip *sc = (SpaceClip *)sl;
|
||||
|
||||
sc->clip = NULL;
|
||||
sc->clip = nullptr;
|
||||
|
||||
if (sc->scopes.track_preview) {
|
||||
IMB_freeImBuf(sc->scopes.track_preview);
|
||||
@@ -293,7 +292,7 @@ static void clip_free(SpaceLink *sl)
|
||||
}
|
||||
|
||||
/* spacetype; init callback */
|
||||
static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
|
||||
static void clip_init(struct wmWindowManager * /*wm*/, ScrArea *area)
|
||||
{
|
||||
ListBase *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, 0);
|
||||
|
||||
@@ -303,11 +302,11 @@ static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
|
||||
|
||||
static SpaceLink *clip_duplicate(SpaceLink *sl)
|
||||
{
|
||||
SpaceClip *scn = MEM_dupallocN(sl);
|
||||
SpaceClip *scn = MEM_cnew("clip_duplicate", *reinterpret_cast<SpaceClip *>(sl));
|
||||
|
||||
/* clear or remove stuff from old */
|
||||
scn->scopes.track_search = NULL;
|
||||
scn->scopes.track_preview = NULL;
|
||||
scn->scopes.track_search = nullptr;
|
||||
scn->scopes.track_preview = nullptr;
|
||||
scn->scopes.ok = false;
|
||||
|
||||
return (SpaceLink *)scn;
|
||||
@@ -556,8 +555,8 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
|
||||
}
|
||||
|
||||
/* DO NOT make this static, this hides the symbol and breaks API generation script. */
|
||||
extern const char *clip_context_dir[]; /* quiet warning. */
|
||||
const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", NULL};
|
||||
extern "C" const char *clip_context_dir[]; /* quiet warning. */
|
||||
const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", nullptr};
|
||||
|
||||
static int /*eContextResult*/ clip_context(const bContext *C,
|
||||
const char *member,
|
||||
@@ -587,10 +586,10 @@ static int /*eContextResult*/ clip_context(const bContext *C,
|
||||
}
|
||||
|
||||
/* dropboxes */
|
||||
static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
|
||||
static bool clip_drop_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
|
||||
{
|
||||
if (drag->type == WM_DRAG_PATH) {
|
||||
const eFileSel_File_Types file_type = WM_drag_get_path_file_type(drag);
|
||||
const eFileSel_File_Types file_type = eFileSel_File_Types(WM_drag_get_path_file_type(drag));
|
||||
if (ELEM(file_type, 0, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE)) {
|
||||
return true;
|
||||
}
|
||||
@@ -599,7 +598,7 @@ static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNU
|
||||
return false;
|
||||
}
|
||||
|
||||
static void clip_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
|
||||
static void clip_drop_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
|
||||
{
|
||||
PointerRNA itemptr;
|
||||
char dir[FILE_MAX], file[FILE_MAX];
|
||||
@@ -618,7 +617,7 @@ static void clip_dropboxes(void)
|
||||
{
|
||||
ListBase *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, 0);
|
||||
|
||||
WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, NULL, NULL);
|
||||
WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
|
||||
}
|
||||
|
||||
static bool clip_set_region_visible(const bContext *C,
|
||||
@@ -726,8 +725,8 @@ static void CLIP_GGT_navigate(wmGizmoGroupType *gzgt)
|
||||
|
||||
static void clip_gizmos(void)
|
||||
{
|
||||
wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(
|
||||
&(const struct wmGizmoMapType_Params){SPACE_CLIP, RGN_TYPE_WINDOW});
|
||||
const wmGizmoMapType_Params gizmo_params{SPACE_CLIP, RGN_TYPE_WINDOW};
|
||||
wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gizmo_params);
|
||||
|
||||
WM_gizmogrouptype_append_and_link(gzmap_type, CLIP_GGT_navigate);
|
||||
}
|
||||
@@ -813,14 +812,15 @@ static void clip_main_region_draw(const bContext *C, ARegion *region)
|
||||
/* If tracking is in progress, we should synchronize the frame from the clip-user
|
||||
* (#MovieClipUser.framenr) so latest tracked frame would be shown. */
|
||||
if (clip && clip->tracking_context) {
|
||||
BKE_autotrack_context_sync_user(clip->tracking_context, &sc->user);
|
||||
BKE_autotrack_context_sync_user(static_cast<AutoTrackContext *>(clip->tracking_context),
|
||||
&sc->user);
|
||||
}
|
||||
|
||||
if (sc->flag & SC_LOCK_SELECTION) {
|
||||
ImBuf *tmpibuf = NULL;
|
||||
ImBuf *tmpibuf = nullptr;
|
||||
|
||||
if (clip && clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
|
||||
tmpibuf = ED_space_clip_get_stable_buffer(sc, NULL, NULL, NULL);
|
||||
tmpibuf = ED_space_clip_get_stable_buffer(sc, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
if (ED_clip_view_selection(C, region, 0)) {
|
||||
@@ -861,7 +861,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *region)
|
||||
region,
|
||||
sc->mask_info.draw_flag,
|
||||
sc->mask_info.draw_type,
|
||||
sc->mask_info.overlay_mode,
|
||||
eMaskOverlayMode(sc->mask_info.overlay_mode),
|
||||
sc->mask_info.blend_factor,
|
||||
mask_width,
|
||||
mask_height,
|
||||
@@ -991,7 +991,7 @@ static void graph_region_draw(const bContext *C, ARegion *region)
|
||||
ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS);
|
||||
|
||||
/* scrollers */
|
||||
UI_view2d_scrollers_draw(v2d, NULL);
|
||||
UI_view2d_scrollers_draw(v2d, nullptr);
|
||||
|
||||
/* scale indicators */
|
||||
{
|
||||
@@ -1041,7 +1041,7 @@ static void dopesheet_region_draw(const bContext *C, ARegion *region)
|
||||
ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS);
|
||||
|
||||
/* scrollers */
|
||||
UI_view2d_scrollers_draw(v2d, NULL);
|
||||
UI_view2d_scrollers_draw(v2d, nullptr);
|
||||
}
|
||||
|
||||
static void clip_preview_region_draw(const bContext *C, ARegion *region)
|
||||
@@ -1056,7 +1056,7 @@ static void clip_preview_region_draw(const bContext *C, ARegion *region)
|
||||
}
|
||||
}
|
||||
|
||||
static void clip_preview_region_listener(const wmRegionListenerParams *UNUSED(params))
|
||||
static void clip_preview_region_listener(const wmRegionListenerParams * /*params*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1097,14 +1097,14 @@ static void clip_channels_region_draw(const bContext *C, ARegion *region)
|
||||
UI_view2d_view_restore(C);
|
||||
}
|
||||
|
||||
static void clip_channels_region_listener(const wmRegionListenerParams *UNUSED(params))
|
||||
static void clip_channels_region_listener(const wmRegionListenerParams * /*params*/)
|
||||
{
|
||||
}
|
||||
|
||||
/****************** header region ******************/
|
||||
|
||||
/* add handlers, stuff you only do once or on area/region changes */
|
||||
static void clip_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
|
||||
static void clip_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
|
||||
{
|
||||
ED_region_header_init(region);
|
||||
}
|
||||
@@ -1230,9 +1230,7 @@ static void clip_properties_region_listener(const wmRegionListenerParams *params
|
||||
|
||||
/********************* registration ********************/
|
||||
|
||||
static void clip_id_remap(ScrArea *UNUSED(area),
|
||||
SpaceLink *slink,
|
||||
const struct IDRemapper *mappings)
|
||||
static void clip_id_remap(ScrArea * /*area*/, SpaceLink *slink, const struct IDRemapper *mappings)
|
||||
{
|
||||
SpaceClip *sclip = (SpaceClip *)slink;
|
||||
|
||||
@@ -1244,12 +1242,12 @@ static void clip_id_remap(ScrArea *UNUSED(area),
|
||||
BKE_id_remapper_apply(mappings, (ID **)&sclip->mask_info.mask, ID_REMAP_APPLY_ENSURE_REAL);
|
||||
}
|
||||
|
||||
static void clip_blend_read_data(BlendDataReader *UNUSED(reader), SpaceLink *sl)
|
||||
static void clip_blend_read_data(BlendDataReader * /*reader*/, SpaceLink *sl)
|
||||
{
|
||||
SpaceClip *sclip = (SpaceClip *)sl;
|
||||
|
||||
sclip->scopes.track_search = NULL;
|
||||
sclip->scopes.track_preview = NULL;
|
||||
sclip->scopes.track_search = nullptr;
|
||||
sclip->scopes.track_preview = nullptr;
|
||||
sclip->scopes.ok = 0;
|
||||
}
|
||||
|
||||
@@ -1267,7 +1265,7 @@ static void clip_blend_write(BlendWriter *writer, SpaceLink *sl)
|
||||
|
||||
void ED_spacetype_clip(void)
|
||||
{
|
||||
SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype clip");
|
||||
SpaceType *st = MEM_cnew<SpaceType>("spacetype clip");
|
||||
ARegionType *art;
|
||||
|
||||
st->spaceid = SPACE_CLIP;
|
||||
@@ -1290,7 +1288,7 @@ void ED_spacetype_clip(void)
|
||||
st->blend_write = clip_blend_write;
|
||||
|
||||
/* regions: main window */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");
|
||||
art = MEM_cnew<ARegionType>("spacetype clip region");
|
||||
art->regionid = RGN_TYPE_WINDOW;
|
||||
art->init = clip_main_region_init;
|
||||
art->draw = clip_main_region_draw;
|
||||
@@ -1300,7 +1298,7 @@ void ED_spacetype_clip(void)
|
||||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
/* preview */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype clip region preview");
|
||||
art = MEM_cnew<ARegionType>("spacetype clip region preview");
|
||||
art->regionid = RGN_TYPE_PREVIEW;
|
||||
art->prefsizey = 240;
|
||||
art->init = clip_preview_region_init;
|
||||
@@ -1311,7 +1309,7 @@ void ED_spacetype_clip(void)
|
||||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
/* regions: properties */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype clip region properties");
|
||||
art = MEM_cnew<ARegionType>("spacetype clip region properties");
|
||||
art->regionid = RGN_TYPE_UI;
|
||||
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
||||
@@ -1322,7 +1320,7 @@ void ED_spacetype_clip(void)
|
||||
ED_clip_buttons_register(art);
|
||||
|
||||
/* regions: tools */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype clip region tools");
|
||||
art = MEM_cnew<ARegionType>("spacetype clip region tools");
|
||||
art->regionid = RGN_TYPE_TOOLS;
|
||||
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
||||
@@ -1333,7 +1331,7 @@ void ED_spacetype_clip(void)
|
||||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
/* regions: header */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");
|
||||
art = MEM_cnew<ARegionType>("spacetype clip region");
|
||||
art->regionid = RGN_TYPE_HEADER;
|
||||
art->prefsizey = HEADERY;
|
||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER;
|
||||
@@ -1347,7 +1345,7 @@ void ED_spacetype_clip(void)
|
||||
BKE_spacetype_register(st);
|
||||
|
||||
/* channels */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype clip channels region");
|
||||
art = MEM_cnew<ARegionType>("spacetype clip channels region");
|
||||
art->regionid = RGN_TYPE_CHANNELS;
|
||||
art->prefsizex = UI_COMPACT_PANEL_WIDTH;
|
||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
||||
@@ -66,7 +66,7 @@ static bool add_marker(const bContext *C, float x, float y)
|
||||
BKE_tracking_plane_tracks_deselect_all(&tracking_object->plane_tracks);
|
||||
|
||||
tracking_object->active_track = track;
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ void CLIP_OT_add_marker(wmOperatorType *ot)
|
||||
RNA_def_float_vector(ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -142,7 +142,7 @@ void CLIP_OT_add_marker(wmOperatorType *ot)
|
||||
/** \name Add Marker Operator
|
||||
* \{ */
|
||||
|
||||
static int add_marker_at_click_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
static int add_marker_at_click_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
ED_workspace_status_text(C, TIP_("Use LMB click to define location where place the marker"));
|
||||
|
||||
@@ -152,7 +152,7 @@ static int add_marker_at_click_invoke(bContext *C, wmOperator *op, const wmEvent
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
|
||||
static int add_marker_at_click_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
|
||||
static int add_marker_at_click_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event)
|
||||
{
|
||||
switch (event->type) {
|
||||
case MOUSEMOVE:
|
||||
@@ -164,7 +164,7 @@ static int add_marker_at_click_modal(bContext *C, wmOperator *UNUSED(op), const
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
float pos[2];
|
||||
|
||||
ED_workspace_status_text(C, NULL);
|
||||
ED_workspace_status_text(C, nullptr);
|
||||
|
||||
ED_clip_point_stable_pos(sc,
|
||||
region,
|
||||
@@ -182,7 +182,7 @@ static int add_marker_at_click_modal(bContext *C, wmOperator *UNUSED(op), const
|
||||
}
|
||||
|
||||
case EVT_ESCKEY:
|
||||
ED_workspace_status_text(C, NULL);
|
||||
ED_workspace_status_text(C, nullptr);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ void CLIP_OT_add_marker_at_click(wmOperatorType *ot)
|
||||
/** \name Delete Track Operator
|
||||
* \{ */
|
||||
|
||||
static int delete_track_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int delete_track_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -264,7 +264,7 @@ void CLIP_OT_delete_track(wmOperatorType *ot)
|
||||
/** \name Delete Marker Operator
|
||||
* \{ */
|
||||
|
||||
static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int delete_marker_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -275,7 +275,7 @@ static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
LISTBASE_FOREACH_MUTABLE (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
if (TRACK_VIEW_SELECTED(sc, track)) {
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr);
|
||||
if (marker != NULL) {
|
||||
if (marker != nullptr) {
|
||||
clip_delete_marker(C, clip, track, marker);
|
||||
changed = true;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
if (PLANE_TRACK_VIEW_SELECTED(plane_track)) {
|
||||
MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get_exact(plane_track,
|
||||
framenr);
|
||||
if (plane_marker != NULL) {
|
||||
if (plane_marker != nullptr) {
|
||||
if (plane_track->markersnr == 1) {
|
||||
BKE_tracking_plane_track_free(plane_track);
|
||||
BLI_freelinkN(&tracking_object->plane_tracks, plane_track);
|
||||
@@ -371,7 +371,7 @@ static SlideMarkerData *create_slide_marker_data(SpaceClip *sc,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
SlideMarkerData *data = MEM_callocN(sizeof(SlideMarkerData), "slide marker data");
|
||||
SlideMarkerData *data = MEM_cnew<SlideMarkerData>("slide marker data");
|
||||
int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
|
||||
marker = BKE_tracking_marker_ensure(track, framenr);
|
||||
@@ -463,7 +463,7 @@ static MovieTrackingTrack *tracking_marker_check_slide(
|
||||
|
||||
if (ed_tracking_point_track_pick_empty(&track_pick) ||
|
||||
!ed_tracking_point_track_pick_can_slide(space_clip, &track_pick)) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const eTrackArea area = track_pick.area;
|
||||
@@ -474,7 +474,7 @@ static MovieTrackingTrack *tracking_marker_check_slide(
|
||||
case TRACK_AREA_NONE:
|
||||
case TRACK_AREA_ALL:
|
||||
BLI_assert_msg(0, "Expected single track area");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
case TRACK_AREA_POINT:
|
||||
action = SLIDE_ACTION_POS;
|
||||
@@ -490,7 +490,7 @@ static MovieTrackingTrack *tracking_marker_check_slide(
|
||||
}
|
||||
else {
|
||||
BLI_assert_msg(0, "Unhandled pattern area");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -503,7 +503,7 @@ static MovieTrackingTrack *tracking_marker_check_slide(
|
||||
}
|
||||
else {
|
||||
BLI_assert_msg(0, "Unhandled search area");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -524,10 +524,10 @@ static MovieTrackingTrack *tracking_marker_check_slide(
|
||||
struct MovieTrackingTrack *tracking_find_slidable_track_in_proximity(struct bContext *C,
|
||||
const float co[2])
|
||||
{
|
||||
return tracking_marker_check_slide(C, co, NULL, NULL, NULL);
|
||||
return tracking_marker_check_slide(C, co, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
static void *slide_marker_customdata(bContext *C, const wmEvent *event)
|
||||
static SlideMarkerData *slide_marker_customdata(bContext *C, const wmEvent *event)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
@@ -535,7 +535,7 @@ static void *slide_marker_customdata(bContext *C, const wmEvent *event)
|
||||
MovieTrackingTrack *track;
|
||||
int width, height;
|
||||
float co[2];
|
||||
void *customdata = NULL;
|
||||
SlideMarkerData *customdata = nullptr;
|
||||
int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
eSlideAction action;
|
||||
int area, corner;
|
||||
@@ -543,13 +543,13 @@ static void *slide_marker_customdata(bContext *C, const wmEvent *event)
|
||||
ED_space_clip_get_size(sc, &width, &height);
|
||||
|
||||
if (width == 0 || height == 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ED_clip_mouse_pos(sc, region, event->mval, co);
|
||||
|
||||
track = tracking_marker_check_slide(C, co, &area, &action, &corner);
|
||||
if (track != NULL) {
|
||||
if (track != nullptr) {
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
|
||||
customdata = create_slide_marker_data(
|
||||
sc, track, marker, event, area, corner, action, width, height);
|
||||
@@ -561,21 +561,21 @@ static void *slide_marker_customdata(bContext *C, const wmEvent *event)
|
||||
static int slide_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
SlideMarkerData *slidedata = slide_marker_customdata(C, event);
|
||||
if (slidedata != NULL) {
|
||||
if (slidedata != nullptr) {
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
|
||||
tracking_object->active_track = slidedata->track;
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
|
||||
op->customdata = slidedata;
|
||||
|
||||
clip_tracking_hide_cursor(C);
|
||||
WM_event_add_modal_handler(C, op);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
@@ -592,7 +592,7 @@ static void cancel_mouse_slide(SlideMarkerData *data)
|
||||
copy_v2_v2(marker->search_max, data->old_search_max);
|
||||
copy_v2_v2(marker->pos, data->old_pos);
|
||||
|
||||
if (data->old_markers != NULL) {
|
||||
if (data->old_markers != nullptr) {
|
||||
for (int a = 0; a < data->track->markersnr; a++) {
|
||||
copy_v2_v2(data->track->markers[a].pos, data->old_markers[a]);
|
||||
}
|
||||
@@ -619,7 +619,7 @@ static void apply_mouse_slide(bContext *C, SlideMarkerData *data)
|
||||
|
||||
static void free_slide_data(SlideMarkerData *data)
|
||||
{
|
||||
if (data->old_markers != NULL) {
|
||||
if (data->old_markers != nullptr) {
|
||||
MEM_freeN(data->old_markers);
|
||||
}
|
||||
MEM_freeN(data);
|
||||
@@ -669,7 +669,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
data->pos[0] += dx;
|
||||
data->pos[1] += dy;
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
DEG_id_tag_update(&sc->clip->id, 0);
|
||||
}
|
||||
else if (data->area == TRACK_AREA_PAT) {
|
||||
@@ -761,14 +761,14 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
||||
copy_v2_v2_int(data->mval, event->mval);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, nullptr);
|
||||
|
||||
break;
|
||||
|
||||
case LEFTMOUSE:
|
||||
if (event->val == KM_RELEASE) {
|
||||
apply_mouse_slide(C, op->customdata);
|
||||
free_slide_data(op->customdata);
|
||||
apply_mouse_slide(C, data);
|
||||
free_slide_data(data);
|
||||
|
||||
clip_tracking_show_cursor(C);
|
||||
|
||||
@@ -778,13 +778,13 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
break;
|
||||
|
||||
case EVT_ESCKEY:
|
||||
cancel_mouse_slide(op->customdata);
|
||||
cancel_mouse_slide(data);
|
||||
|
||||
free_slide_data(op->customdata);
|
||||
free_slide_data(data);
|
||||
|
||||
clip_tracking_show_cursor(C);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
@@ -811,7 +811,7 @@ void CLIP_OT_slide_marker(wmOperatorType *ot)
|
||||
RNA_def_float_vector(ot->srna,
|
||||
"offset",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Offset",
|
||||
@@ -831,12 +831,12 @@ static int clear_track_path_exec(bContext *C, wmOperator *op)
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
const MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(&clip->tracking);
|
||||
const eTrackClearAction action = RNA_enum_get(op->ptr, "action");
|
||||
const eTrackClearAction action = eTrackClearAction(RNA_enum_get(op->ptr, "action"));
|
||||
const bool clear_active = RNA_boolean_get(op->ptr, "clear_active");
|
||||
const int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
|
||||
if (clear_active) {
|
||||
if (tracking_object->active_track != NULL) {
|
||||
if (tracking_object->active_track != nullptr) {
|
||||
BKE_tracking_track_path_clear(tracking_object->active_track, framenr, action);
|
||||
}
|
||||
}
|
||||
@@ -864,7 +864,7 @@ void CLIP_OT_clear_track_path(wmOperatorType *ot)
|
||||
"Clear Remained",
|
||||
"Clear path at remaining frames (after current)"},
|
||||
{TRACK_CLEAR_ALL, "ALL", 0, "Clear All", "Clear the whole path"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -943,7 +943,7 @@ void CLIP_OT_disable_markers(wmOperatorType *ot)
|
||||
{MARKER_OP_DISABLE, "DISABLE", 0, "Disable", "Disable selected markers"},
|
||||
{MARKER_OP_ENABLE, "ENABLE", 0, "Enable", "Enable selected markers"},
|
||||
{MARKER_OP_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -987,8 +987,8 @@ static int hide_tracks_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
const MovieTrackingTrack *active_track = tracking_object->active_track;
|
||||
if (active_track != NULL && active_track->flag & TRACK_HIDDEN) {
|
||||
tracking_object->active_track = NULL;
|
||||
if (active_track != nullptr && active_track->flag & TRACK_HIDDEN) {
|
||||
tracking_object->active_track = nullptr;
|
||||
}
|
||||
|
||||
/* Hide place tracks. */
|
||||
@@ -1002,12 +1002,12 @@ static int hide_tracks_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
const MovieTrackingPlaneTrack *active_plane_track = tracking_object->active_plane_track;
|
||||
if (active_plane_track != NULL && active_plane_track->flag & TRACK_HIDDEN) {
|
||||
tracking_object->active_plane_track = NULL;
|
||||
if (active_plane_track != nullptr && active_plane_track->flag & TRACK_HIDDEN) {
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
}
|
||||
|
||||
BKE_tracking_dopesheet_tag_update(tracking);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -1036,7 +1036,7 @@ void CLIP_OT_hide_tracks(wmOperatorType *ot)
|
||||
/** \name Hide Tracks Clear Operator
|
||||
* \{ */
|
||||
|
||||
static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int hide_tracks_clear_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -1054,7 +1054,7 @@ static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
|
||||
BKE_tracking_dopesheet_tag_update(&clip->tracking);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@ void CLIP_OT_hide_tracks_clear(wmOperatorType *ot)
|
||||
static bool frame_jump_poll(bContext *C)
|
||||
{
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
return space_clip != NULL;
|
||||
return space_clip != nullptr;
|
||||
}
|
||||
|
||||
static int frame_jump_exec(bContext *C, wmOperator *op)
|
||||
@@ -1098,7 +1098,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
|
||||
|
||||
if (pos <= 1) { /* jump to path */
|
||||
MovieTrackingTrack *active_track = tracking_object->active_track;
|
||||
if (active_track == NULL) {
|
||||
if (active_track == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -1108,7 +1108,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
|
||||
int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr + delta);
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(active_track, framenr);
|
||||
|
||||
if (marker == NULL || marker->flag & MARKER_DISABLED) {
|
||||
if (marker == nullptr || marker->flag & MARKER_DISABLED) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
|
||||
MovieReconstructedCamera *cam = BKE_tracking_camera_get_reconstructed(
|
||||
tracking, tracking_object, framenr);
|
||||
|
||||
if (cam == NULL) {
|
||||
if (cam == nullptr) {
|
||||
sc->user.framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, framenr);
|
||||
break;
|
||||
}
|
||||
@@ -1143,7 +1143,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -1155,7 +1155,7 @@ void CLIP_OT_frame_jump(wmOperatorType *ot)
|
||||
{1, "PATHEND", 0, "Path End", "Jump to end of current path"},
|
||||
{2, "FAILEDPREV", 0, "Previous Failed", "Jump to previous failed frame"},
|
||||
{2, "FAILNEXT", 0, "Next Failed", "Jump to next failed frame"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -1190,7 +1190,7 @@ static int join_tracks_exec(bContext *C, wmOperator *op)
|
||||
bool update_stabilization = false;
|
||||
|
||||
MovieTrackingTrack *active_track = tracking_object->active_track;
|
||||
if (active_track == NULL) {
|
||||
if (active_track == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "No active track to join to");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
@@ -1243,11 +1243,12 @@ static int join_tracks_exec(bContext *C, wmOperator *op)
|
||||
GSetIterator gs_iter;
|
||||
int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
GSET_ITER (gs_iter, point_tracks) {
|
||||
MovieTrackingPlaneTrack *plane_track = BLI_gsetIterator_getKey(&gs_iter);
|
||||
MovieTrackingPlaneTrack *plane_track = static_cast<MovieTrackingPlaneTrack *>(
|
||||
BLI_gsetIterator_getKey(&gs_iter));
|
||||
BKE_tracking_track_plane_from_existing_motion(plane_track, framenr);
|
||||
}
|
||||
|
||||
BLI_gset_free(point_tracks, NULL);
|
||||
BLI_gset_free(point_tracks, nullptr);
|
||||
DEG_id_tag_update(&clip->id, 0);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);
|
||||
@@ -1313,7 +1314,7 @@ static int average_tracks_exec(bContext *C, wmOperator *op)
|
||||
BKE_tracking_plane_tracks_deselect_all(&tracking_object->plane_tracks);
|
||||
|
||||
tracking_object->active_track = result_track;
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
|
||||
/* Inform the dependency graph and interface about changes. */
|
||||
DEG_id_tag_update(&clip->id, 0);
|
||||
@@ -1325,7 +1326,7 @@ static int average_tracks_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int average_tracks_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
static int average_tracks_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
PropertyRNA *prop_keep_original = RNA_struct_find_property(op->ptr, "keep_original");
|
||||
if (!RNA_property_is_set(op->ptr, prop_keep_original)) {
|
||||
@@ -1412,7 +1413,7 @@ void CLIP_OT_lock_tracks(wmOperatorType *ot)
|
||||
{TRACK_ACTION_LOCK, "LOCK", 0, "Lock", "Lock selected tracks"},
|
||||
{TRACK_ACTION_UNLOCK, "UNLOCK", 0, "Unlock", "Unlock selected tracks"},
|
||||
{TRACK_ACTION_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle locked flag for selected tracks"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -1468,7 +1469,7 @@ void CLIP_OT_set_solver_keyframe(wmOperatorType *ot)
|
||||
static const EnumPropertyItem keyframe_items[] = {
|
||||
{SOLVER_KEYFRAME_A, "KEYFRAME_A", 0, "Keyframe A", ""},
|
||||
{SOLVER_KEYFRAME_B, "KEYFRAME_B", 0, "Keyframe B", ""},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -1493,14 +1494,14 @@ void CLIP_OT_set_solver_keyframe(wmOperatorType *ot)
|
||||
/** \name Track Copy Color Operator
|
||||
* \{ */
|
||||
|
||||
static int track_copy_color_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int track_copy_color_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
const MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(&clip->tracking);
|
||||
|
||||
MovieTrackingTrack *active_track = tracking_object->active_track;
|
||||
if (active_track == NULL) {
|
||||
if (active_track == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -1545,12 +1546,12 @@ static bool is_track_clean(MovieTrackingTrack *track, int frames, int del)
|
||||
{
|
||||
bool ok = true;
|
||||
int prev = -1, count = 0;
|
||||
MovieTrackingMarker *markers = track->markers, *new_markers = NULL;
|
||||
MovieTrackingMarker *markers = track->markers, *new_markers = nullptr;
|
||||
int start_disabled = 0;
|
||||
int markersnr = track->markersnr;
|
||||
|
||||
if (del) {
|
||||
new_markers = MEM_callocN(markersnr * sizeof(MovieTrackingMarker), "track cleaned markers");
|
||||
new_markers = MEM_cnew_array<MovieTrackingMarker>(markersnr, "track cleaned markers");
|
||||
}
|
||||
|
||||
for (int a = 0; a < markersnr; a++) {
|
||||
@@ -1640,7 +1641,7 @@ static bool is_track_clean(MovieTrackingTrack *track, int frames, int del)
|
||||
track->markers = new_markers;
|
||||
}
|
||||
else {
|
||||
track->markers = NULL;
|
||||
track->markers = nullptr;
|
||||
MEM_freeN(new_markers);
|
||||
}
|
||||
|
||||
@@ -1677,17 +1678,17 @@ static int clean_tracks_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
else if (action == TRACKING_CLEAN_DELETE_TRACK) {
|
||||
if (track == tracking_object->active_track) {
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
}
|
||||
BKE_tracking_track_free(track);
|
||||
BLI_freelinkN(&tracking_object->tracks, track);
|
||||
track = NULL;
|
||||
track = nullptr;
|
||||
}
|
||||
|
||||
/* Happens when all tracking segments are not long enough. */
|
||||
if (track && track->markersnr == 0) {
|
||||
if (track == tracking_object->active_track) {
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
}
|
||||
BKE_tracking_track_free(track);
|
||||
BLI_freelinkN(&tracking_object->tracks, track);
|
||||
@@ -1704,7 +1705,7 @@ 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))
|
||||
static int clean_tracks_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -1734,7 +1735,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
|
||||
0,
|
||||
"Delete Segments",
|
||||
"Delete unclean segments of tracks"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -1779,7 +1780,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
|
||||
/** \name Add Tracking Object
|
||||
* \{ */
|
||||
|
||||
static int tracking_object_new_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int tracking_object_new_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -1855,7 +1856,7 @@ void CLIP_OT_tracking_object_remove(wmOperatorType *ot)
|
||||
/** \name Copy Tracks to Clipboard Operator
|
||||
* \{ */
|
||||
|
||||
static int copy_tracks_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int copy_tracks_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -1899,7 +1900,7 @@ static bool paste_tracks_poll(bContext *C)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int paste_tracks_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int paste_tracks_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -1950,7 +1951,7 @@ static void keyframe_set_flag(bContext *C, bool set)
|
||||
}
|
||||
else {
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr);
|
||||
if (marker != NULL) {
|
||||
if (marker != nullptr) {
|
||||
marker->flag |= MARKER_TRACKED;
|
||||
}
|
||||
}
|
||||
@@ -1984,7 +1985,7 @@ static void keyframe_set_flag(bContext *C, bool set)
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);
|
||||
}
|
||||
|
||||
static int keyframe_insert_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int keyframe_insert_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
keyframe_set_flag(C, true);
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -2011,7 +2012,7 @@ void CLIP_OT_keyframe_insert(wmOperatorType *ot)
|
||||
/** \name Delete Track Keyframe Operator
|
||||
* \{ */
|
||||
|
||||
static int keyframe_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int keyframe_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
keyframe_set_flag(C, false);
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -2051,8 +2052,8 @@ static ImBuf *sample_plane_marker_image_for_operator(bContext *C)
|
||||
tracking_object->active_plane_track, clip_frame_number);
|
||||
|
||||
ImBuf *frame_ibuf = ED_space_clip_get_buffer(space_clip);
|
||||
if (frame_ibuf == NULL) {
|
||||
return NULL;
|
||||
if (frame_ibuf == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ImBuf *plane_ibuf = BKE_tracking_get_plane_imbuf(frame_ibuf, plane_marker);
|
||||
@@ -2073,14 +2074,14 @@ static bool new_image_from_plane_marker_poll(bContext *C)
|
||||
const MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
|
||||
if (tracking_object->active_plane_track == NULL) {
|
||||
if (tracking_object->active_plane_track == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int new_image_from_plane_marker_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int new_image_from_plane_marker_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(space_clip);
|
||||
@@ -2089,7 +2090,7 @@ static int new_image_from_plane_marker_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
MovieTrackingPlaneTrack *plane_track = tracking_object->active_plane_track;
|
||||
|
||||
ImBuf *plane_ibuf = sample_plane_marker_image_for_operator(C);
|
||||
if (plane_ibuf == NULL) {
|
||||
if (plane_ibuf == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -2128,8 +2129,8 @@ static bool update_image_from_plane_marker_poll(bContext *C)
|
||||
const MovieTracking *tracking = &clip->tracking;
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
|
||||
if (tracking_object->active_plane_track == NULL ||
|
||||
tracking_object->active_plane_track->image == NULL) {
|
||||
if (tracking_object->active_plane_track == nullptr ||
|
||||
tracking_object->active_plane_track->image == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2137,7 +2138,7 @@ static bool update_image_from_plane_marker_poll(bContext *C)
|
||||
return image->type == IMA_TYPE_IMAGE && ELEM(image->source, IMA_SRC_FILE, IMA_SRC_GENERATED);
|
||||
}
|
||||
|
||||
static int update_image_from_plane_marker_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int update_image_from_plane_marker_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *space_clip = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(space_clip);
|
||||
@@ -2146,7 +2147,7 @@ static int update_image_from_plane_marker_exec(bContext *C, wmOperator *UNUSED(o
|
||||
MovieTrackingPlaneTrack *plane_track = tracking_object->active_plane_track;
|
||||
|
||||
ImBuf *plane_ibuf = sample_plane_marker_image_for_operator(C);
|
||||
if (plane_ibuf == NULL) {
|
||||
if (plane_ibuf == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
@@ -32,15 +32,16 @@
|
||||
|
||||
static bGPDlayer *detect_get_layer(MovieClip *clip)
|
||||
{
|
||||
if (clip->gpd == NULL) {
|
||||
return NULL;
|
||||
if (clip->gpd == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
for (bGPDlayer *layer = clip->gpd->layers.first; layer != NULL; layer = layer->next) {
|
||||
|
||||
LISTBASE_FOREACH (bGPDlayer *, layer, &clip->gpd->layers) {
|
||||
if (layer->flag & GP_LAYER_ACTIVE) {
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static int detect_features_exec(bContext *C, wmOperator *op)
|
||||
@@ -56,7 +57,7 @@ static int detect_features_exec(bContext *C, wmOperator *op)
|
||||
const int min_distance = RNA_int_get(op->ptr, "min_distance");
|
||||
const float threshold = RNA_float_get(op->ptr, "threshold");
|
||||
const int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
bGPDlayer *layer = NULL;
|
||||
bGPDlayer *layer = nullptr;
|
||||
int place_outside_layer = 0;
|
||||
|
||||
if (!ibuf) {
|
||||
@@ -86,7 +87,7 @@ static int detect_features_exec(bContext *C, wmOperator *op)
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
||||
BKE_tracking_dopesheet_tag_update(tracking);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -105,7 +106,7 @@ void CLIP_OT_detect_features(wmOperatorType *ot)
|
||||
0,
|
||||
"Outside Annotated Area",
|
||||
"Place markers only outside areas outlined with the Annotation tool"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
@@ -41,7 +41,7 @@ static int create_plane_track_tracks_exec(bContext *C, wmOperator *op)
|
||||
plane_track = BKE_tracking_plane_track_add(
|
||||
tracking, &tracking_object->plane_tracks, &tracking_object->tracks, framenr);
|
||||
|
||||
if (plane_track == NULL) {
|
||||
if (plane_track == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Need at least 4 selected point tracks to create a plane");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ static int create_plane_track_tracks_exec(bContext *C, wmOperator *op)
|
||||
BKE_tracking_tracks_deselect_all(&tracking_object->tracks);
|
||||
|
||||
plane_track->flag |= SELECT;
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
tracking_object->active_plane_track = plane_track;
|
||||
|
||||
/* Compute homoraphies and apply them on marker's corner, so we've got
|
||||
@@ -111,30 +111,30 @@ static MovieTrackingPlaneTrack *tracking_plane_marker_check_slide(bContext *C,
|
||||
|
||||
if (ed_tracking_plane_track_pick_empty(&track_pick) ||
|
||||
!ed_tracking_plane_track_pick_can_slide(&track_pick)) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (r_corner != NULL) {
|
||||
if (r_corner != nullptr) {
|
||||
*r_corner = track_pick.corner_index;
|
||||
}
|
||||
|
||||
return track_pick.plane_track;
|
||||
}
|
||||
|
||||
static void *slide_plane_marker_customdata(bContext *C, const wmEvent *event)
|
||||
static SlidePlaneMarkerData *slide_plane_marker_customdata(bContext *C, const wmEvent *event)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
MovieTrackingPlaneTrack *plane_track;
|
||||
int width, height;
|
||||
float co[2];
|
||||
SlidePlaneMarkerData *customdata = NULL;
|
||||
SlidePlaneMarkerData *customdata = nullptr;
|
||||
int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
int corner;
|
||||
|
||||
ED_space_clip_get_size(sc, &width, &height);
|
||||
if (width == 0 || height == 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ED_clip_mouse_pos(sc, region, event->mval, co);
|
||||
@@ -143,7 +143,7 @@ static void *slide_plane_marker_customdata(bContext *C, const wmEvent *event)
|
||||
if (plane_track) {
|
||||
MovieTrackingPlaneMarker *plane_marker;
|
||||
|
||||
customdata = MEM_callocN(sizeof(SlidePlaneMarkerData), "slide plane marker data");
|
||||
customdata = MEM_cnew<SlidePlaneMarkerData>("slide plane marker data");
|
||||
|
||||
customdata->launch_event = WM_userdef_event_type_from_keymap_type(event->type);
|
||||
|
||||
@@ -178,14 +178,14 @@ static int slide_plane_marker_invoke(bContext *C, wmOperator *op, const wmEvent
|
||||
MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
|
||||
|
||||
tracking_object->active_plane_track = slidedata->plane_track;
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
|
||||
op->customdata = slidedata;
|
||||
|
||||
clip_tracking_hide_cursor(C);
|
||||
WM_event_add_modal_handler(C, op);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
@@ -290,7 +290,7 @@ static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *
|
||||
copy_v2_v2(data->previous_corner, data->corner);
|
||||
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_COPY_ON_WRITE);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, nullptr);
|
||||
|
||||
break;
|
||||
|
||||
@@ -302,7 +302,7 @@ static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *
|
||||
|
||||
slide_plane_marker_update_homographies(sc, data);
|
||||
|
||||
free_slide_plane_marker_data(op->customdata);
|
||||
free_slide_plane_marker_data(data);
|
||||
|
||||
clip_tracking_show_cursor(C);
|
||||
|
||||
@@ -315,9 +315,9 @@ static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *
|
||||
break;
|
||||
|
||||
case EVT_ESCKEY:
|
||||
cancel_mouse_slide_plane_marker(op->customdata);
|
||||
cancel_mouse_slide_plane_marker(data);
|
||||
|
||||
free_slide_plane_marker_data(op->customdata);
|
||||
free_slide_plane_marker_data(data);
|
||||
|
||||
clip_tracking_show_cursor(C);
|
||||
|
||||
@@ -76,7 +76,7 @@ static bool solve_camera_initjob(
|
||||
width,
|
||||
height);
|
||||
|
||||
tracking->stats = MEM_callocN(sizeof(MovieTrackingStats), "solve camera stats");
|
||||
tracking->stats = MEM_cnew<MovieTrackingStats>("solve camera stats");
|
||||
|
||||
WM_set_locked_interface(scj->wm, true);
|
||||
|
||||
@@ -108,7 +108,7 @@ static void solve_camera_freejob(void *scv)
|
||||
|
||||
/* WindowManager is missing in the job when initialization is incomplete.
|
||||
* In this case the interface is not locked either. */
|
||||
if (scj->wm != NULL) {
|
||||
if (scj->wm != nullptr) {
|
||||
WM_set_locked_interface(scj->wm, false);
|
||||
}
|
||||
|
||||
@@ -138,14 +138,14 @@ static void solve_camera_freejob(void *scv)
|
||||
}
|
||||
|
||||
/* Set currently solved clip as active for scene. */
|
||||
if (scene->clip != NULL) {
|
||||
if (scene->clip != nullptr) {
|
||||
id_us_min(&clip->id);
|
||||
}
|
||||
scene->clip = clip;
|
||||
id_us_plus(&clip->id);
|
||||
|
||||
/* Set blender camera focal length so result would look fine there. */
|
||||
if (scene->camera != NULL && scene->camera->data &&
|
||||
if (scene->camera != nullptr && scene->camera->data &&
|
||||
GS(((ID *)scene->camera->data)->name) == ID_CA) {
|
||||
Camera *camera = (Camera *)scene->camera->data;
|
||||
int width, height;
|
||||
@@ -156,12 +156,12 @@ static void solve_camera_freejob(void *scv)
|
||||
}
|
||||
|
||||
MEM_freeN(tracking->stats);
|
||||
tracking->stats = NULL;
|
||||
tracking->stats = nullptr;
|
||||
|
||||
DEG_id_tag_update(&clip->id, 0);
|
||||
|
||||
WM_main_add_notifier(NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_main_add_notifier(NC_OBJECT | ND_TRANSFORM, NULL);
|
||||
WM_main_add_notifier(NC_OBJECT | ND_TRANSFORM, nullptr);
|
||||
|
||||
/* Update active clip displayed in scene buttons. */
|
||||
WM_main_add_notifier(NC_SCENE, scene);
|
||||
@@ -174,7 +174,7 @@ static int solve_camera_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SolveCameraJob *scj;
|
||||
char error_msg[256] = "\0";
|
||||
scj = MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data");
|
||||
scj = MEM_cnew<SolveCameraJob>("SolveCameraJob data");
|
||||
if (!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) {
|
||||
if (error_msg[0]) {
|
||||
BKE_report(op->reports, RPT_ERROR, error_msg);
|
||||
@@ -182,12 +182,12 @@ static int solve_camera_exec(bContext *C, wmOperator *op)
|
||||
solve_camera_freejob(scj);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
solve_camera_startjob(scj, NULL, NULL, NULL);
|
||||
solve_camera_startjob(scj, nullptr, nullptr, nullptr);
|
||||
solve_camera_freejob(scj);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
SolveCameraJob *scj;
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
@@ -203,7 +203,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
scj = MEM_callocN(sizeof(SolveCameraJob), "SolveCameraJob data");
|
||||
scj = MEM_cnew<SolveCameraJob>("SolveCameraJob data");
|
||||
if (!solve_camera_initjob(C, scj, op, error_msg, sizeof(error_msg))) {
|
||||
if (error_msg[0]) {
|
||||
BKE_report(op->reports, RPT_ERROR, error_msg);
|
||||
@@ -229,7 +229,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
|
||||
WM_JOB_TYPE_CLIP_SOLVE_CAMERA);
|
||||
WM_jobs_customdata_set(wm_job, scj, solve_camera_freejob);
|
||||
WM_jobs_timer(wm_job, 0.1, NC_MOVIECLIP | NA_EVALUATED, 0);
|
||||
WM_jobs_callbacks(wm_job, solve_camera_startjob, NULL, solve_camera_updatejob, NULL);
|
||||
WM_jobs_callbacks(wm_job, solve_camera_startjob, nullptr, solve_camera_updatejob, nullptr);
|
||||
|
||||
G.is_break = false;
|
||||
|
||||
@@ -242,7 +242,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
|
||||
static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
|
||||
static int solve_camera_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event)
|
||||
{
|
||||
/* No running solver, remove handler and pass through. */
|
||||
if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_CLIP_SOLVE_CAMERA)) {
|
||||
@@ -277,7 +277,7 @@ void CLIP_OT_solve_camera(wmOperatorType *ot)
|
||||
|
||||
/********************** clear solution operator *********************/
|
||||
|
||||
static int clear_solution_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int clear_solution_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -296,7 +296,7 @@ static int clear_solution_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
DEG_id_tag_update(&clip->id, 0);
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EVALUATED, clip);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ static bool stabilize_2d_poll(bContext *C)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stabilize_2d_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int stabilize_2d_add_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -77,7 +77,7 @@ void CLIP_OT_stabilize_2d_add(wmOperatorType *ot)
|
||||
|
||||
/******************* remove 2d stabilization tracks operator ******************/
|
||||
|
||||
static int stabilize_2d_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int stabilize_2d_remove_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -128,7 +128,7 @@ void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot)
|
||||
|
||||
/******************* select 2d stabilization tracks operator ******************/
|
||||
|
||||
static int stabilize_2d_select_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int stabilize_2d_select_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -166,7 +166,7 @@ void CLIP_OT_stabilize_2d_select(wmOperatorType *ot)
|
||||
|
||||
/********************** add 2d stabilization tracks for rotation operator ****************/
|
||||
|
||||
static int stabilize_2d_rotation_add_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int stabilize_2d_rotation_add_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -208,7 +208,7 @@ void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot)
|
||||
|
||||
/********************** remove 2d stabilization tracks for rotation operator *************/
|
||||
|
||||
static int stabilize_2d_rotation_remove_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int stabilize_2d_rotation_remove_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -259,7 +259,7 @@ void CLIP_OT_stabilize_2d_rotation_remove(wmOperatorType *ot)
|
||||
|
||||
/********************** select 2d stabilization rotation tracks operator *****************/
|
||||
|
||||
static int stabilize_2d_rotation_select_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int stabilize_2d_rotation_select_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||
@@ -61,7 +61,7 @@ static int track_count_markers(SpaceClip *sc, MovieClip *clip, const int framenr
|
||||
int tot = 0;
|
||||
const MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(&clip->tracking);
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
bool selected = (sc != NULL) ? TRACK_VIEW_SELECTED(sc, track) : TRACK_SELECTED(track);
|
||||
bool selected = (sc != nullptr) ? TRACK_VIEW_SELECTED(sc, track) : TRACK_SELECTED(track);
|
||||
if (selected && (track->flag & TRACK_LOCKED) == 0) {
|
||||
MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
|
||||
if (!marker || (marker->flag & MARKER_DISABLED) == 0) {
|
||||
@@ -79,11 +79,11 @@ static void track_init_markers(SpaceClip *sc,
|
||||
{
|
||||
const MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(&clip->tracking);
|
||||
int frames_limit = 0;
|
||||
if (sc != NULL) {
|
||||
if (sc != nullptr) {
|
||||
clip_tracking_clear_invisible_track_selection(sc, clip);
|
||||
}
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_object->tracks) {
|
||||
bool selected = (sc != NULL) ? TRACK_VIEW_SELECTED(sc, track) : TRACK_SELECTED(track);
|
||||
bool selected = (sc != nullptr) ? TRACK_VIEW_SELECTED(sc, track) : TRACK_SELECTED(track);
|
||||
if (selected) {
|
||||
if ((track->flag & TRACK_HIDDEN) == 0 && (track->flag & TRACK_LOCKED) == 0) {
|
||||
BKE_tracking_marker_ensure(track, framenr);
|
||||
@@ -267,11 +267,11 @@ static void track_markers_updatejob(void *tmv)
|
||||
static void track_markers_endjob(void *tmv)
|
||||
{
|
||||
TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
|
||||
wmWindowManager *wm = tmj->main->wm.first;
|
||||
wmWindowManager *wm = static_cast<wmWindowManager *>(tmj->main->wm.first);
|
||||
|
||||
tmj->clip->tracking_context = NULL;
|
||||
tmj->clip->tracking_context = nullptr;
|
||||
tmj->scene->r.cfra = BKE_movieclip_remap_clip_to_scene_frame(tmj->clip, tmj->lastfra);
|
||||
if (wm != NULL) {
|
||||
if (wm != nullptr) {
|
||||
/* XXX */
|
||||
// ED_update_for_newframe(tmj->main, tmj->scene);
|
||||
}
|
||||
@@ -286,7 +286,7 @@ static void track_markers_endjob(void *tmv)
|
||||
static void track_markers_freejob(void *tmv)
|
||||
{
|
||||
TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
|
||||
tmj->clip->tracking_context = NULL;
|
||||
tmj->clip->tracking_context = nullptr;
|
||||
WM_set_locked_interface(tmj->wm, false);
|
||||
BKE_autotrack_context_free(tmj->context);
|
||||
MEM_freeN(tmj);
|
||||
@@ -315,7 +315,7 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
tmj = MEM_callocN(sizeof(TrackMarkersJob), "TrackMarkersJob data");
|
||||
tmj = MEM_cnew<TrackMarkersJob>("TrackMarkersJob data");
|
||||
if (!track_markers_initjob(C, tmj, backwards, sequence)) {
|
||||
track_markers_freejob(tmj);
|
||||
return OPERATOR_CANCELLED;
|
||||
@@ -343,7 +343,7 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job)
|
||||
}
|
||||
|
||||
WM_jobs_callbacks(
|
||||
wm_job, track_markers_startjob, NULL, track_markers_updatejob, track_markers_endjob);
|
||||
wm_job, track_markers_startjob, nullptr, track_markers_updatejob, track_markers_endjob);
|
||||
|
||||
G.is_break = false;
|
||||
|
||||
@@ -369,12 +369,12 @@ static int track_markers_exec(bContext *C, wmOperator *op)
|
||||
return track_markers(C, op, false);
|
||||
}
|
||||
|
||||
static int track_markers_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
static int track_markers_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
return track_markers(C, op, true);
|
||||
}
|
||||
|
||||
static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
|
||||
static int track_markers_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event)
|
||||
{
|
||||
/* No running tracking, remove handler and pass through. */
|
||||
if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY)) {
|
||||
@@ -390,7 +390,7 @@ static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEven
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
|
||||
static char *track_markers_desc(bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr)
|
||||
static char *track_markers_desc(bContext * /*C*/, wmOperatorType * /*op*/, PointerRNA *ptr)
|
||||
{
|
||||
const bool backwards = RNA_boolean_get(ptr, "backwards");
|
||||
const bool sequence = RNA_boolean_get(ptr, "sequence");
|
||||
@@ -409,7 +409,7 @@ static char *track_markers_desc(bContext *UNUSED(C), wmOperatorType *UNUSED(op),
|
||||
}
|
||||
|
||||
/* Use default description. */
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CLIP_OT_track_markers(wmOperatorType *ot)
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
BLI_INLINE PointTrackPick point_track_pick_make_null(void)
|
||||
{
|
||||
PointTrackPick pick = {NULL};
|
||||
PointTrackPick pick = {nullptr};
|
||||
|
||||
pick.area = TRACK_AREA_NONE;
|
||||
pick.area_detail = TRACK_PICK_AREA_DETAIL_NONE;
|
||||
@@ -328,11 +328,11 @@ PointTrackPick ed_tracking_pick_point_track(const TrackPickOptions *options,
|
||||
bool ed_tracking_point_track_pick_can_slide(const SpaceClip *space_clip,
|
||||
const PointTrackPick *pick)
|
||||
{
|
||||
if (pick->track == NULL) {
|
||||
if (pick->track == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BLI_assert(pick->marker != NULL);
|
||||
BLI_assert(pick->marker != nullptr);
|
||||
|
||||
if (!TRACK_VIEW_SELECTED(space_clip, pick->track)) {
|
||||
return false;
|
||||
@@ -356,7 +356,7 @@ bool ed_tracking_point_track_pick_can_slide(const SpaceClip *space_clip,
|
||||
|
||||
BLI_INLINE PlaneTrackPick plane_track_pick_make_null(void)
|
||||
{
|
||||
PlaneTrackPick result = {NULL};
|
||||
PlaneTrackPick result = {nullptr};
|
||||
|
||||
result.corner_index = -1;
|
||||
result.distance_px_squared = FLT_MAX;
|
||||
@@ -438,11 +438,11 @@ PlaneTrackPick ed_tracking_pick_plane_track(const TrackPickOptions *options,
|
||||
|
||||
bool ed_tracking_plane_track_pick_can_slide(const PlaneTrackPick *pick)
|
||||
{
|
||||
if (pick->plane_track == NULL) {
|
||||
if (pick->plane_track == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BLI_assert(pick->plane_marker != NULL);
|
||||
BLI_assert(pick->plane_marker != nullptr);
|
||||
|
||||
if (!PLANE_TRACK_VIEW_SELECTED(pick->plane_track)) {
|
||||
return false;
|
||||
@@ -472,10 +472,10 @@ static bool tracking_should_prefer_point_track(bContext *C,
|
||||
const PlaneTrackPick *plane_track_pick)
|
||||
{
|
||||
/* Simple case: one of the pick results is empty, so prefer the other one. */
|
||||
if (point_track_pick->track == NULL) {
|
||||
if (point_track_pick->track == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (plane_track_pick->plane_track == NULL) {
|
||||
if (plane_track_pick->plane_track == nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -524,17 +524,14 @@ TrackingPick ed_tracking_pick_closest(const TrackPickOptions *options,
|
||||
|
||||
void ed_tracking_deselect_all_tracks(ListBase *tracks_base)
|
||||
{
|
||||
MovieTrackingTrack *track;
|
||||
for (track = tracks_base->first; track != NULL; track = track->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingTrack *, track, tracks_base) {
|
||||
BKE_tracking_track_flag_clear(track, TRACK_AREA_ALL, SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
void ed_tracking_deselect_all_plane_tracks(ListBase *plane_tracks_base)
|
||||
{
|
||||
MovieTrackingPlaneTrack *plane_track;
|
||||
for (plane_track = plane_tracks_base->first; plane_track != NULL;
|
||||
plane_track = plane_track->next) {
|
||||
LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
|
||||
plane_track->flag &= ~SELECT;
|
||||
}
|
||||
}
|
||||
@@ -572,16 +569,16 @@ static int select_exec(bContext *C, wmOperator *op)
|
||||
* selection will be lost which causes inconvenience for the VFX artist. */
|
||||
const bool activate_selected = !extend;
|
||||
if (activate_selected && ed_tracking_pick_can_slide(sc, &pick)) {
|
||||
if (pick.point_track_pick.track != NULL) {
|
||||
if (pick.point_track_pick.track != nullptr) {
|
||||
tracking_object->active_track = pick.point_track_pick.track;
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
}
|
||||
else {
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
tracking_object->active_plane_track = pick.plane_track_pick.plane_track;
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_SELECT);
|
||||
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
@@ -590,7 +587,7 @@ static int select_exec(bContext *C, wmOperator *op)
|
||||
ClipViewLockState lock_state;
|
||||
ED_clip_view_lock_state_store(C, &lock_state);
|
||||
|
||||
if (pick.point_track_pick.track != NULL) {
|
||||
if (pick.point_track_pick.track != nullptr) {
|
||||
if (!extend) {
|
||||
ed_tracking_deselect_all_plane_tracks(&tracking_object->plane_tracks);
|
||||
}
|
||||
@@ -608,7 +605,7 @@ static int select_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
else {
|
||||
tracking_object->active_track = track;
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -618,10 +615,10 @@ static int select_exec(bContext *C, wmOperator *op)
|
||||
|
||||
BKE_tracking_track_select(&tracking_object->tracks, track, area, extend);
|
||||
tracking_object->active_track = track;
|
||||
tracking_object->active_plane_track = NULL;
|
||||
tracking_object->active_plane_track = nullptr;
|
||||
}
|
||||
}
|
||||
else if (pick.plane_track_pick.plane_track != NULL) {
|
||||
else if (pick.plane_track_pick.plane_track != nullptr) {
|
||||
if (!extend) {
|
||||
ed_tracking_deselect_all_tracks(&tracking_object->tracks);
|
||||
}
|
||||
@@ -637,7 +634,7 @@ static int select_exec(bContext *C, wmOperator *op)
|
||||
plane_track->flag |= SELECT;
|
||||
}
|
||||
|
||||
tracking_object->active_track = NULL;
|
||||
tracking_object->active_track = nullptr;
|
||||
tracking_object->active_plane_track = plane_track;
|
||||
}
|
||||
else if (deselect_all) {
|
||||
@@ -649,7 +646,7 @@ static int select_exec(bContext *C, wmOperator *op)
|
||||
|
||||
BKE_tracking_dopesheet_tag_update(tracking);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_SELECT);
|
||||
|
||||
/* This is a bit implicit, but when the selection operator is used from a LMB Add Marker and
|
||||
@@ -719,7 +716,7 @@ void CLIP_OT_select(wmOperatorType *ot)
|
||||
ot->srna,
|
||||
"location",
|
||||
2,
|
||||
NULL,
|
||||
nullptr,
|
||||
-FLT_MAX,
|
||||
FLT_MAX,
|
||||
"Location",
|
||||
@@ -754,10 +751,10 @@ static int box_select_exec(bContext *C, wmOperator *op)
|
||||
ED_clip_point_stable_pos(sc, region, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
ED_clip_point_stable_pos(sc, region, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||
|
||||
const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
|
||||
const eSelectOp sel_op = eSelectOp(RNA_enum_get(op->ptr, "mode"));
|
||||
const bool select = (sel_op != SEL_OP_SUB);
|
||||
if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
|
||||
ED_clip_select_all(sc, SEL_DESELECT, NULL);
|
||||
ED_clip_select_all(sc, SEL_DESELECT, nullptr);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -806,7 +803,7 @@ static int box_select_exec(bContext *C, wmOperator *op)
|
||||
if (changed) {
|
||||
BKE_tracking_dopesheet_tag_update(&clip->tracking);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_SELECT);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -916,7 +913,7 @@ static int do_lasso_select_marker(bContext *C,
|
||||
if (changed) {
|
||||
BKE_tracking_dopesheet_tag_update(&clip->tracking);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_SELECT);
|
||||
}
|
||||
|
||||
@@ -929,11 +926,11 @@ static int clip_lasso_select_exec(bContext *C, wmOperator *op)
|
||||
const int(*mcoords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcoords_len);
|
||||
|
||||
if (mcoords) {
|
||||
const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
|
||||
const eSelectOp sel_op = eSelectOp(RNA_enum_get(op->ptr, "mode"));
|
||||
const bool select = (sel_op != SEL_OP_SUB);
|
||||
if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
|
||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
||||
ED_clip_select_all(sc, SEL_DESELECT, NULL);
|
||||
ED_clip_select_all(sc, SEL_DESELECT, nullptr);
|
||||
}
|
||||
|
||||
do_lasso_select_marker(C, mcoords, mcoords_len, select);
|
||||
@@ -1006,11 +1003,12 @@ static int circle_select_exec(bContext *C, wmOperator *op)
|
||||
const int y = RNA_int_get(op->ptr, "y");
|
||||
const int radius = RNA_int_get(op->ptr, "radius");
|
||||
|
||||
const eSelectOp sel_op = ED_select_op_modal(RNA_enum_get(op->ptr, "mode"),
|
||||
WM_gesture_is_modal_first(op->customdata));
|
||||
const eSelectOp sel_op = ED_select_op_modal(
|
||||
eSelectOp(RNA_enum_get(op->ptr, "mode")),
|
||||
WM_gesture_is_modal_first(static_cast<wmGesture *>(op->customdata)));
|
||||
const bool select = (sel_op != SEL_OP_SUB);
|
||||
if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
|
||||
ED_clip_select_all(sc, SEL_DESELECT, NULL);
|
||||
ED_clip_select_all(sc, SEL_DESELECT, nullptr);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -1068,7 +1066,7 @@ static int circle_select_exec(bContext *C, wmOperator *op)
|
||||
if (changed) {
|
||||
BKE_tracking_dopesheet_tag_update(&clip->tracking);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_SELECT);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -1121,7 +1119,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
|
||||
|
||||
BKE_tracking_dopesheet_tag_update(tracking);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, NULL);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, nullptr);
|
||||
DEG_id_tag_update(&clip->id, ID_RECALC_SELECT);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -1222,7 +1220,7 @@ void CLIP_OT_select_grouped(wmOperatorType *ot)
|
||||
"Tracks with Same Color",
|
||||
"Select all tracks with same color as active track"},
|
||||
{6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* identifiers */
|
||||
Reference in New Issue
Block a user