forked from bartvdbraak/blender
Style cleanup of own modules using style checker from Campbell.
This commit is contained in:
parent
3ef11693f5
commit
c79892c5cd
File diff suppressed because it is too large
Load Diff
@ -484,7 +484,8 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, int flipnormal)
|
|||||||
dl = dl->next;
|
dl = dl->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totvert && (tot = BLI_scanfill_calc(&sf_ctx, FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
|
/* XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { */
|
||||||
|
if (totvert && (tot = BLI_scanfill_calc(&sf_ctx, FALSE))) {
|
||||||
if (tot) {
|
if (tot) {
|
||||||
dlnew = MEM_callocN(sizeof(DispList), "filldisplist");
|
dlnew = MEM_callocN(sizeof(DispList), "filldisplist");
|
||||||
dlnew->type = DL_INDEX3;
|
dlnew->type = DL_INDEX3;
|
||||||
@ -743,7 +744,8 @@ static ModifierData *curve_get_tessellate_point(Scene *scene, Object *ob, int fo
|
|||||||
return pretessellatePoint;
|
return pretessellatePoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, float (**originalVerts_r)[3], float (**deformedVerts_r)[3], int *numVerts_r)
|
static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, float (**originalVerts_r)[3],
|
||||||
|
float (**deformedVerts_r)[3], int *numVerts_r)
|
||||||
{
|
{
|
||||||
ModifierData *md = modifiers_getVirtualModifierList(ob);
|
ModifierData *md = modifiers_getVirtualModifierList(ob);
|
||||||
ModifierData *pretessellatePoint;
|
ModifierData *pretessellatePoint;
|
||||||
@ -1412,7 +1414,8 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
|
|||||||
/* CU_2D conflicts with R_NOPUNOFLIP */
|
/* CU_2D conflicts with R_NOPUNOFLIP */
|
||||||
dl->rt = nu->flag & ~CU_2D;
|
dl->rt = nu->flag & ~CU_2D;
|
||||||
|
|
||||||
dl->bevelSplitFlag = MEM_callocN(sizeof(*dl->col2) * ((steps + 0x1F) >> 5), "bevelSplitFlag");
|
dl->bevelSplitFlag = MEM_callocN(sizeof(*dl->col2) * ((steps + 0x1F) >> 5),
|
||||||
|
"bevelSplitFlag");
|
||||||
|
|
||||||
/* for each point of poly make a bevel piece */
|
/* for each point of poly make a bevel piece */
|
||||||
bevp = (BevPoint *)(bl + 1) + start;
|
bevp = (BevPoint *)(bl + 1) + start;
|
||||||
|
@ -635,7 +635,8 @@ static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *use
|
|||||||
return cache->postprocessed.ibuf;
|
return cache->postprocessed.ibuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int flag, int postprocess_flag)
|
static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf,
|
||||||
|
int flag, int postprocess_flag)
|
||||||
{
|
{
|
||||||
MovieClipCache *cache = clip->cache;
|
MovieClipCache *cache = clip->cache;
|
||||||
MovieTrackingCamera *camera = &clip->tracking.camera;
|
MovieTrackingCamera *camera = &clip->tracking.camera;
|
||||||
@ -851,7 +852,8 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user
|
|||||||
return stableibuf;
|
return stableibuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag)
|
ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float loc[2], float *scale, float *angle,
|
||||||
|
int postprocess_flag)
|
||||||
{
|
{
|
||||||
ImBuf *ibuf, *stableibuf = NULL;
|
ImBuf *ibuf, *stableibuf = NULL;
|
||||||
int framenr = user->framenr;
|
int framenr = user->framenr;
|
||||||
|
@ -302,7 +302,8 @@ MovieTrackingMarker *BKE_tracking_insert_marker(MovieTrackingTrack *track, Movie
|
|||||||
else
|
else
|
||||||
track->markers = MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers");
|
track->markers = MEM_callocN(sizeof(MovieTrackingMarker), "MovieTracking markers");
|
||||||
|
|
||||||
memmove(track->markers+a+2, track->markers+a+1, (track->markersnr-a-2)*sizeof(MovieTrackingMarker));
|
memmove(track->markers + a + 2, track->markers + a + 1,
|
||||||
|
(track->markersnr - a - 2) * sizeof(MovieTrackingMarker));
|
||||||
track->markers[a + 1] = *marker;
|
track->markers[a + 1] = *marker;
|
||||||
|
|
||||||
track->last_marker = a + 1;
|
track->last_marker = a + 1;
|
||||||
@ -318,7 +319,8 @@ void BKE_tracking_delete_marker(MovieTrackingTrack *track, int framenr)
|
|||||||
while (a < track->markersnr) {
|
while (a < track->markersnr) {
|
||||||
if (track->markers[a].framenr == framenr) {
|
if (track->markers[a].framenr == framenr) {
|
||||||
if (track->markersnr > 1) {
|
if (track->markersnr > 1) {
|
||||||
memmove(track->markers+a, track->markers+a+1, (track->markersnr-a-1)*sizeof(MovieTrackingMarker));
|
memmove(track->markers + a, track->markers + a + 1,
|
||||||
|
(track->markersnr - a - 1) * sizeof(MovieTrackingMarker));
|
||||||
track->markersnr--;
|
track->markersnr--;
|
||||||
track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr);
|
track->markers = MEM_reallocN(track->markers, sizeof(MovieTrackingMarker) * track->markersnr);
|
||||||
}
|
}
|
||||||
@ -1021,17 +1023,20 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
|
|||||||
* than the search size */
|
* than the search size */
|
||||||
int level = MIN2(track->pyramid_levels, max_pyramid_levels);
|
int level = MIN2(track->pyramid_levels, max_pyramid_levels);
|
||||||
|
|
||||||
|
struct libmv_RegionTracker *region_tracker;
|
||||||
|
|
||||||
if (track->tracker == TRACKER_KLT) {
|
if (track->tracker == TRACKER_KLT) {
|
||||||
track_context.region_tracker =
|
region_tracker = libmv_pyramidRegionTrackerNew(100, level, half_wnd,
|
||||||
libmv_pyramidRegionTrackerNew(100, level, half_wnd, track->minimum_correlation);
|
track->minimum_correlation);
|
||||||
}
|
}
|
||||||
else if (track->tracker == TRACKER_HYBRID) {
|
else if (track->tracker == TRACKER_HYBRID) {
|
||||||
track_context.region_tracker =
|
region_tracker = libmv_hybridRegionTrackerNew(100, half_wnd, track->minimum_correlation);
|
||||||
libmv_hybridRegionTrackerNew(100, half_wnd, track->minimum_correlation);
|
|
||||||
}
|
}
|
||||||
else if (track->tracker == TRACKER_SAD) {
|
else if (track->tracker == TRACKER_SAD) {
|
||||||
track_context.region_tracker = libmv_bruteRegionTrackerNew(MAX2(wndx, wndy), track->minimum_correlation);
|
region_tracker = libmv_bruteRegionTrackerNew(MAX2(wndx, wndy), track->minimum_correlation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
track_context.region_tracker = region_tracker;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1094,7 +1099,8 @@ void BKE_tracking_context_free(MovieTrackingContext *context)
|
|||||||
/* zap channels from the imbuf that are disabled by the user. this can lead to
|
/* zap channels from the imbuf that are disabled by the user. this can lead to
|
||||||
* better tracks sometimes. however, instead of simply zeroing the channels
|
* better tracks sometimes. however, instead of simply zeroing the channels
|
||||||
* out, do a partial grayscale conversion so the display is better. */
|
* out, do a partial grayscale conversion so the display is better. */
|
||||||
void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale)
|
void BKE_tracking_disable_imbuf_channels(ImBuf *ibuf, int disable_red, int disable_green, int disable_blue,
|
||||||
|
int grayscale)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
float scale;
|
float scale;
|
||||||
@ -1669,7 +1675,8 @@ static int retrieve_libmv_reconstruct_tracks(MovieReconstructContext *context, M
|
|||||||
|
|
||||||
reconstruction->camnr = 0;
|
reconstruction->camnr = 0;
|
||||||
reconstruction->cameras = NULL;
|
reconstruction->cameras = NULL;
|
||||||
reconstructed = MEM_callocN((efra-sfra+1)*sizeof(MovieReconstructedCamera), "temp reconstructed camera");
|
reconstructed = MEM_callocN((efra - sfra + 1) * sizeof(MovieReconstructedCamera),
|
||||||
|
"temp reconstructed camera");
|
||||||
|
|
||||||
for (a = sfra; a <= efra; a++) {
|
for (a = sfra; a <= efra; a++) {
|
||||||
double matd[4][4];
|
double matd[4][4];
|
||||||
@ -1704,8 +1711,9 @@ static int retrieve_libmv_reconstruct_tracks(MovieReconstructContext *context, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (reconstruction->camnr) {
|
if (reconstruction->camnr) {
|
||||||
reconstruction->cameras = MEM_callocN(reconstruction->camnr * sizeof(MovieReconstructedCamera), "reconstructed camera");
|
int size = reconstruction->camnr * sizeof(MovieReconstructedCamera);
|
||||||
memcpy(reconstruction->cameras, reconstructed, reconstruction->camnr * sizeof(MovieReconstructedCamera));
|
reconstruction->cameras = MEM_callocN(size, "reconstructed camera");
|
||||||
|
memcpy(reconstruction->cameras, reconstructed, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (origin_set) {
|
if (origin_set) {
|
||||||
@ -1783,7 +1791,8 @@ int BKE_tracking_can_reconstruct(MovieTracking *tracking, MovieTrackingObject *o
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (count_tracks_on_both_keyframes(tracking, tracksbase) < 8) {
|
else if (count_tracks_on_both_keyframes(tracking, tracksbase) < 8) {
|
||||||
BLI_strncpy(error_msg, "At least 8 common tracks on both of keyframes are needed for reconstruction", error_size);
|
BLI_strncpy(error_msg, "At least 8 common tracks on both of keyframes are needed for reconstruction",
|
||||||
|
error_size);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -2663,7 +2672,8 @@ static ImBuf* stabilize_alloc_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill)
|
|||||||
return cacheibuf;
|
return cacheibuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_tracking_stabilization_data(MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle)
|
void BKE_tracking_stabilization_data(MovieTracking *tracking, int framenr, int width, int height,
|
||||||
|
float loc[2], float *scale, float *angle)
|
||||||
{
|
{
|
||||||
float firstmedian[2], median[2];
|
float firstmedian[2], median[2];
|
||||||
MovieTrackingStabilization *stab = &tracking->stabilization;
|
MovieTrackingStabilization *stab = &tracking->stabilization;
|
||||||
@ -2701,7 +2711,8 @@ void BKE_tracking_stabilization_data(MovieTracking *tracking, int framenr, int w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf, float loc[2], float *scale, float *angle)
|
ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
|
||||||
|
float loc[2], float *scale, float *angle)
|
||||||
{
|
{
|
||||||
float tloc[2], tscale, tangle;
|
float tloc[2], tscale, tangle;
|
||||||
MovieTrackingStabilization *stab = &tracking->stabilization;
|
MovieTrackingStabilization *stab = &tracking->stabilization;
|
||||||
@ -2798,7 +2809,8 @@ ImBuf *BKE_tracking_stabilize(MovieTracking *tracking, int framenr, ImBuf *ibuf,
|
|||||||
return tmpibuf;
|
return tmpibuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect, float loc[2], float scale, float angle, float mat[4][4])
|
void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect,
|
||||||
|
float loc[2], float scale, float angle, float mat[4][4])
|
||||||
{
|
{
|
||||||
float lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4], amat[4][4], iamat[4][4];
|
float lmat[4][4], rmat[4][4], smat[4][4], cmat[4][4], icmat[4][4], amat[4][4], iamat[4][4];
|
||||||
float svec[3] = {scale, scale, scale};
|
float svec[3] = {scale, scale, scale};
|
||||||
@ -3042,7 +3054,8 @@ void BKE_tracking_remove_object(MovieTracking *tracking, MovieTrackingObject *ob
|
|||||||
|
|
||||||
void BKE_tracking_object_unique_name(MovieTracking *tracking, MovieTrackingObject *object)
|
void BKE_tracking_object_unique_name(MovieTracking *tracking, MovieTrackingObject *object)
|
||||||
{
|
{
|
||||||
BLI_uniquename(&tracking->objects, object, "Object", '.', offsetof(MovieTrackingObject, name), sizeof(object->name));
|
BLI_uniquename(&tracking->objects, object, "Object", '.',
|
||||||
|
offsetof(MovieTrackingObject, name), sizeof(object->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
MovieTrackingObject *BKE_tracking_named_object(MovieTracking *tracking, const char *name)
|
MovieTrackingObject *BKE_tracking_named_object(MovieTracking *tracking, const char *name)
|
||||||
|
@ -167,7 +167,8 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
|||||||
|
|
||||||
scopes->track_preview_height = (scopes->track_preview_height <= UI_UNIT_Y)?UI_UNIT_Y : scopes->track_preview_height;
|
scopes->track_preview_height = (scopes->track_preview_height <= UI_UNIT_Y)?UI_UNIT_Y : scopes->track_preview_height;
|
||||||
|
|
||||||
uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
|
uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, rect.xmax - rect.xmin,
|
||||||
|
scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************* Marker Template ************************/
|
/********************* Marker Template ************************/
|
||||||
@ -323,7 +324,8 @@ static void marker_block_handler(bContext *C, void *arg_cb, int event)
|
|||||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, cb->clip);
|
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, cb->clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, int compact)
|
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr,
|
||||||
|
PointerRNA *trackptr, int compact)
|
||||||
{
|
{
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
@ -375,7 +377,8 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
|
|||||||
else
|
else
|
||||||
tip = "Marker is enabled at current frame";
|
tip = "Marker is enabled at current frame";
|
||||||
|
|
||||||
bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20, &cb->marker_flag, 0, 0, 1, 0, tip);
|
bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20,
|
||||||
|
&cb->marker_flag, 0, 0, 1, 0, tip);
|
||||||
uiButSetNFunc(bt, marker_update_cb, cb, NULL);
|
uiButSetNFunc(bt, marker_update_cb, cb, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -414,7 +414,8 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
|
|||||||
glPointSize(1.0f);
|
glPointSize(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int width, int height)
|
static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
|
||||||
|
float marker_pos[2], int width, int height)
|
||||||
{
|
{
|
||||||
int tiny = sc->flag & SC_SHOW_TINY_MARKER;
|
int tiny = sc->flag & SC_SHOW_TINY_MARKER;
|
||||||
int show_search = FALSE;
|
int show_search = FALSE;
|
||||||
@ -513,7 +514,8 @@ static void track_colors(MovieTrackingTrack *track, int act, float col[3], float
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int width, int height, int act, int sel)
|
static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
|
||||||
|
float marker_pos[2], int width, int height, int act, int sel)
|
||||||
{
|
{
|
||||||
int tiny = sc->flag & SC_SHOW_TINY_MARKER;
|
int tiny = sc->flag & SC_SHOW_TINY_MARKER;
|
||||||
int show_search = 0;
|
int show_search = 0;
|
||||||
@ -845,8 +847,8 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
|
|||||||
glLineWidth(1.0f);
|
glLineWidth(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, float marker_pos[2], int act,
|
static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
|
||||||
int width, int height, float zoomx, float zoomy)
|
float marker_pos[2], int act, int width, int height, float zoomx, float zoomy)
|
||||||
{
|
{
|
||||||
char str[128] = {0}, state[64] = {0};
|
char str[128] = {0}, state[64] = {0};
|
||||||
float dx = 0.0f, dy = 0.0f, fontsize, pos[3];
|
float dx = 0.0f, dy = 0.0f, fontsize, pos[3];
|
||||||
@ -1165,7 +1167,8 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
|
|||||||
MEM_freeN(marker_pos);
|
MEM_freeN(marker_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, int width, int height, float zoomx, float zoomy)
|
static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
|
||||||
|
int width, int height, float zoomx, float zoomy)
|
||||||
{
|
{
|
||||||
float x, y;
|
float x, y;
|
||||||
const int n = 10;
|
const int n = 10;
|
||||||
|
@ -317,7 +317,8 @@ int ED_clip_view_selection(SpaceClip *sc, ARegion *ar, int fit)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* center view */
|
/* center view */
|
||||||
clip_view_center_to_point(sc, (max[0]+min[0])/(2*frame_width), (max[1]+min[1])/(2*frame_height));
|
clip_view_center_to_point(sc, (max[0] + min[0]) / (2 * frame_width),
|
||||||
|
(max[1] + min[1]) / (2 * frame_height));
|
||||||
|
|
||||||
w = max[0] - min[0];
|
w = max[0] - min[0];
|
||||||
h = max[1] - min[1];
|
h = max[1] - min[1];
|
||||||
|
@ -166,7 +166,8 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc)
|
|||||||
|
|
||||||
/* draw graph lines */
|
/* draw graph lines */
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
clip_graph_tracking_values_iterate(sc, act_track, tracking_segment_point_cb, tracking_segment_start_cb, tracking_segment_end_cb);
|
clip_graph_tracking_values_iterate(sc, act_track, tracking_segment_point_cb,
|
||||||
|
tracking_segment_start_cb, tracking_segment_end_cb);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
/* selected knot handles on top of curves */
|
/* selected knot handles on top of curves */
|
||||||
|
@ -164,7 +164,8 @@ static int open_exec(bContext *C, wmOperator *op)
|
|||||||
if (op->customdata)
|
if (op->customdata)
|
||||||
MEM_freeN(op->customdata);
|
MEM_freeN(op->customdata);
|
||||||
|
|
||||||
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, errno ? strerror(errno) : "Unsupported movie clip format");
|
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str,
|
||||||
|
errno ? strerror(errno) : "Unsupported movie clip format");
|
||||||
|
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
@ -236,7 +237,8 @@ void CLIP_OT_open(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
|
WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE,
|
||||||
|
WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************* reload clip operator *********************/
|
/******************* reload clip operator *********************/
|
||||||
@ -586,7 +588,8 @@ void CLIP_OT_view_zoom_in(wmOperatorType *ot)
|
|||||||
ot->poll = ED_space_clip_view_clip_poll;
|
ot->poll = ED_space_clip_view_clip_poll;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in screen coordinates", -10.0f, 10.0f);
|
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location",
|
||||||
|
"Cursor location in screen coordinates", -10.0f, 10.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int view_zoom_out_exec(bContext *C, wmOperator *op)
|
static int view_zoom_out_exec(bContext *C, wmOperator *op)
|
||||||
@ -627,7 +630,8 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot)
|
|||||||
ot->poll = ED_space_clip_view_clip_poll;
|
ot->poll = ED_space_clip_view_clip_poll;
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
|
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location",
|
||||||
|
"Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************** view zoom ratio operator *********************/
|
/********************** view zoom ratio operator *********************/
|
||||||
@ -958,7 +962,8 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
|
|||||||
if (clip->source != MCLIP_SRC_MOVIE)
|
if (clip->source != MCLIP_SRC_MOVIE)
|
||||||
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, NULL, cfra, build_sizes, build_count, 0);
|
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, NULL, cfra, build_sizes, build_count, 0);
|
||||||
|
|
||||||
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra, build_undistort_sizes, build_undistort_count, 1);
|
BKE_movieclip_build_proxy_frame(clip, pj->clip_flag, distortion, cfra,
|
||||||
|
build_undistort_sizes, build_undistort_count, 1);
|
||||||
|
|
||||||
if (*stop || G.afbreek)
|
if (*stop || G.afbreek)
|
||||||
break;
|
break;
|
||||||
|
@ -203,7 +203,8 @@ void clip_delete_track(bContext *C, MovieClip *clip, ListBase *tracksbase, Movie
|
|||||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clip_delete_marker(bContext *C, MovieClip *clip, ListBase *tracksbase, MovieTrackingTrack *track, MovieTrackingMarker *marker)
|
void clip_delete_marker(bContext *C, MovieClip *clip, ListBase *tracksbase,
|
||||||
|
MovieTrackingTrack *track, MovieTrackingMarker *marker)
|
||||||
{
|
{
|
||||||
if (track->markersnr == 1) {
|
if (track->markersnr == 1) {
|
||||||
clip_delete_track(C, clip, tracksbase, track);
|
clip_delete_track(C, clip, tracksbase, track);
|
||||||
|
@ -232,7 +232,8 @@ static SpaceLink *clip_new(const bContext *C)
|
|||||||
|
|
||||||
sc = MEM_callocN(sizeof(SpaceClip), "initclip");
|
sc = MEM_callocN(sizeof(SpaceClip), "initclip");
|
||||||
sc->spacetype = SPACE_CLIP;
|
sc->spacetype = SPACE_CLIP;
|
||||||
sc->flag = SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES;
|
sc->flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH | SC_MANUAL_CALIBRATION |
|
||||||
|
SC_SHOW_GRAPH_TRACKS | SC_SHOW_GRAPH_FRAMES;
|
||||||
sc->zoom = 1.0f;
|
sc->zoom = 1.0f;
|
||||||
sc->path_length = 20;
|
sc->path_length = 20;
|
||||||
sc->scopes.track_preview_height = 120;
|
sc->scopes.track_preview_height = 120;
|
||||||
@ -1146,7 +1147,8 @@ static void dopesheet_area_draw(const bContext *C, ARegion *ar)
|
|||||||
|
|
||||||
/* time grid */
|
/* time grid */
|
||||||
unit = (sc->flag & SC_SHOW_SECONDS)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
|
unit = (sc->flag & SC_SHOW_SECONDS)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
|
||||||
grid = UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
|
grid = UI_view2d_grid_calc(CTX_data_scene(C), v2d, unit, V2D_GRID_CLAMP,
|
||||||
|
V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy);
|
||||||
UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
|
UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
|
||||||
UI_view2d_grid_free(grid);
|
UI_view2d_grid_free(grid);
|
||||||
|
|
||||||
|
@ -421,21 +421,26 @@ static void *slide_marker_customdata(bContext *C, wmEvent *event)
|
|||||||
if ((marker->flag & MARKER_DISABLED) == 0) {
|
if ((marker->flag & MARKER_DISABLED) == 0) {
|
||||||
if (!customdata)
|
if (!customdata)
|
||||||
if (mouse_on_offset(sc, track, marker, co, width, height))
|
if (mouse_on_offset(sc, track, marker, co, width, height))
|
||||||
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT, SLIDE_ACTION_POS, width, height);
|
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_POINT,
|
||||||
|
SLIDE_ACTION_POS, width, height);
|
||||||
|
|
||||||
if (sc->flag & SC_SHOW_MARKER_SEARCH) {
|
if (sc->flag & SC_SHOW_MARKER_SEARCH) {
|
||||||
if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 1, width, height))
|
if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 1, width, height))
|
||||||
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_OFFSET, width, height);
|
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH,
|
||||||
|
SLIDE_ACTION_OFFSET, width, height);
|
||||||
else if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 0, width, height))
|
else if (mouse_on_corner(sc, track, marker, TRACK_AREA_SEARCH, co, 0, width, height))
|
||||||
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH, SLIDE_ACTION_SIZE, width, height);
|
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_SEARCH,
|
||||||
|
SLIDE_ACTION_SIZE, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!customdata && (sc->flag & SC_SHOW_MARKER_PATTERN)) {
|
if (!customdata && (sc->flag & SC_SHOW_MARKER_PATTERN)) {
|
||||||
if (mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 1, width, height))
|
if (mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 1, width, height))
|
||||||
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_OFFSET, width, height);
|
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT,
|
||||||
|
SLIDE_ACTION_OFFSET, width, height);
|
||||||
|
|
||||||
if (!customdata && mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 0, width, height))
|
if (!customdata && mouse_on_corner(sc, track, marker, TRACK_AREA_PAT, co, 0, width, height))
|
||||||
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT, SLIDE_ACTION_SIZE, width, height);
|
customdata = create_slide_marker_data(sc, track, marker, event, TRACK_AREA_PAT,
|
||||||
|
SLIDE_ACTION_SIZE, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (customdata)
|
if (customdata)
|
||||||
@ -692,9 +697,12 @@ static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack *trac
|
|||||||
epsx = 12.0f / width;
|
epsx = 12.0f / width;
|
||||||
epsy = 12.0f / height;
|
epsy = 12.0f / height;
|
||||||
|
|
||||||
if (fabsf(co[0]-marker->pos[0]-track->offset[0])< epsx && fabsf(co[1]-marker->pos[1]-track->offset[1])<=epsy)
|
if (fabsf(co[0] - marker->pos[0] - track->offset[0]) < epsx &&
|
||||||
|
fabsf(co[1] - marker->pos[1] - track->offset[1]) <= epsy)
|
||||||
|
{
|
||||||
return TRACK_AREA_POINT;
|
return TRACK_AREA_POINT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRACK_AREA_NONE;
|
return TRACK_AREA_NONE;
|
||||||
}
|
}
|
||||||
@ -726,8 +734,9 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbas
|
|||||||
if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, cur, marker)) {
|
if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, cur, marker)) {
|
||||||
float dist, d1, d2 = FLT_MAX, d3 = FLT_MAX;
|
float dist, d1, d2 = FLT_MAX, d3 = FLT_MAX;
|
||||||
|
|
||||||
|
/* distance to marker point */
|
||||||
d1 = sqrtf((co[0] - marker->pos[0] - cur->offset[0]) * (co[0] - marker->pos[0] - cur->offset[0]) +
|
d1 = sqrtf((co[0] - marker->pos[0] - cur->offset[0]) * (co[0] - marker->pos[0] - cur->offset[0]) +
|
||||||
(co[1]-marker->pos[1]-cur->offset[1])*(co[1]-marker->pos[1]-cur->offset[1])); /* distance to marker point */
|
(co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
|
||||||
|
|
||||||
/* distance to pattern boundbox */
|
/* distance to pattern boundbox */
|
||||||
if (sc->flag & SC_SHOW_MARKER_PATTERN)
|
if (sc->flag & SC_SHOW_MARKER_PATTERN)
|
||||||
@ -1462,8 +1471,10 @@ static int track_markers_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* limit frames to be tracked by user setting */
|
/* limit frames to be tracked by user setting */
|
||||||
if (frames_limit) {
|
if (frames_limit) {
|
||||||
if (backwards) efra = MAX2(efra, sfra-frames_limit);
|
if (backwards)
|
||||||
else efra = MIN2(efra, sfra+frames_limit);
|
efra = MAX2(efra, sfra - frames_limit);
|
||||||
|
else
|
||||||
|
efra = MIN2(efra, sfra + frames_limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!track_markers_check_direction(backwards, framenr, efra))
|
if (!track_markers_check_direction(backwards, framenr, efra))
|
||||||
@ -1534,8 +1545,10 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
|
|||||||
* with fixed FPS. To deal with editor refresh we have to synchronize
|
* with fixed FPS. To deal with editor refresh we have to synchronize
|
||||||
* tracks from job and tracks in clip. Do this in timer callback
|
* tracks from job and tracks in clip. Do this in timer callback
|
||||||
* to prevent threading conflicts. */
|
* to prevent threading conflicts. */
|
||||||
if (tmj->delay>0) WM_jobs_timer(steve, tmj->delay/1000.0f, NC_MOVIECLIP|NA_EVALUATED, 0);
|
if (tmj->delay > 0)
|
||||||
else WM_jobs_timer(steve, 0.2, NC_MOVIECLIP|NA_EVALUATED, 0);
|
WM_jobs_timer(steve, tmj->delay / 1000.0f, NC_MOVIECLIP | NA_EVALUATED, 0);
|
||||||
|
else
|
||||||
|
WM_jobs_timer(steve, 0.2, NC_MOVIECLIP | NA_EVALUATED, 0);
|
||||||
|
|
||||||
WM_jobs_callbacks(steve, track_markers_startjob, NULL, track_markers_updatejob, NULL);
|
WM_jobs_callbacks(steve, track_markers_startjob, NULL, track_markers_updatejob, NULL);
|
||||||
|
|
||||||
@ -3503,7 +3516,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot)
|
|||||||
static EnumPropertyItem actions_items[] = {
|
static EnumPropertyItem actions_items[] = {
|
||||||
{TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"},
|
{TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"},
|
||||||
{TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"},
|
{TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"},
|
||||||
{TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"},
|
{TRACKING_CLEAN DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"},
|
||||||
{0, NULL, 0, NULL, NULL}
|
{0, NULL, 0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user