Commit Graph

491 Commits

Author SHA1 Message Date
b9d732e047 Fix T37907: Crash when change screen layout to "Motion Tracking"
Was a bug in recent change from my own.

Also fixed cache line being displayed twice.
2013-12-21 20:26:23 +06:00
aec90a8faf Fix wrong display of movie clip cache with mask overlay enabled 2013-12-20 22:17:43 +06:00
b2fdc591c3 UI: restore confirmation popups for delete operators.
It turned out this was leading to accidental deleting in some cases when the
info message was missed by users. Fixes T37801.
2013-12-20 01:40:33 +01:00
967b12060c Alpha channel of a plane track image works fine in MCE now 2013-12-06 20:08:37 +06:00
1815225faa Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-12-02 21:10:07 +11:00
fb3f240201 Image wrapping for plane track in clip editor
Summary:
Now it's possible to assign an image to plane tracks
in clip editor. This image is only used for display
in clip editor and this image is being warped into
the plane track rectangle.

Main purpose of this is to get early feedback about
how good image warping matches the footage, before
clip goes to the compositor.

Pretty much straightforward change: just compute
homography from undeformed normalized frame corner
coordinates (unity square) to plane marker corners
and apply this matrix to opengl stack.

Still could improve behavior when perspective
plane transform is degenerate, but that's not so
much critical for now i'd say.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: sebastian_k

Differential Revision: http://developer.blender.org/D57
2013-11-29 23:26:57 +06:00
cedc90b607 Fix errors and inconsistencies in confirmation popup removal.
* Improve some clip editor messages
* Remove popup for metastrips, seems unnecessary
* Renamed some variables for consistency
* Avoid unnecessary call to CTX_DATA_COUNT

Reviewed By: sergey, campbellbarton, aligorith

Differential Revision: http://developer.blender.org/D44
2013-11-29 17:49:01 +01:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
3ca4387bc8 UI: remove unnecessary confirmation popups
This makes a number of operators no longer ask for confirmation, rather it will
show an info message after performing the operation. Ref T37422 for decision. In
particular, these were changed:

* Delete objects, bones, keyframes, masks, mask curves, motion tracks, markers.
* Clear and delete keyframes in the 3D view.
* Align bone to parents.
* Separate bones from armature.
* Group/ungroup metastrips in sequencer.
* Copy/paste objects to/from buffer.

Reviewed By: brecht, dingto

Differential Revision: http://developer.blender.org/D35
2013-11-25 12:21:45 +01:00
f4762eb12b UI messages fixes... 2013-11-04 18:58:22 +00:00
7267221715 remove return argument from wmOperatorType->cancel, was only ever returning OPERATOR_CANCELLED. 2013-10-30 23:08:53 +00:00
cd70a0e73a Code cleanup: typo-fix 2013-10-30 11:33:11 +00:00
96cd8b9401 style cleanup 2013-10-29 03:04:46 +00:00
4ab478ffe1 Make it possible to track specified clip
Added a property to track_marker operator to be
able to render clip which name was passed to the
operator instead of clip from current clip editor
context.

Very much useful for automatic tests.
2013-10-28 21:49:49 +00:00
9f32e83175 Weighted tracks
Added a weight slider to track which defines
how much particular track affects in a final
reconstruction. This weight is for sure
animateable.

Currently it affects on BA step only which in
most cases will work just fine.

The usecase of this slider is to have it set
to 1.0 most of the time where the track is
good, but blend it's weight down to 0 when
tracker looses the track. This will prevent
camera from jump.

Tutorial is to be done by Sebastian.
2013-10-26 13:22:38 +00:00
304a32bf1f style cleanup 2013-10-23 02:52:27 +00:00
47f365419f Fix #37117: MCE prefetching fails with non-ascii characters in path 2013-10-17 12:28:32 +00:00
992902cee0 Fix #37118: MCEr: Prefetch frames doesn't respect input color space 2013-10-17 09:44:08 +00:00
71dae0cf40 Fix #37119: MCE: Prefetching doesn't fetch last frame of an image-sequence.
Silly mistake in final condition. Now it works fine.

Would be nice to have this for the final release, simple oneliner.
2013-10-17 09:19:03 +00:00
eaf0d267f2 Code cleanup: move hardcoded structure to a typedef 2013-10-15 15:21:33 +00:00
d2abc22823 Code cleanup: use bools instead of ints for tracking utility functions 2013-10-15 15:21:28 +00:00
d06bc34088 Fix for prefetch not working correct if last frame was loaded 2013-10-12 14:47:04 +00:00
d7983e3638 Option to overlay mask over the footage
Currently supports only two modes:
- Show alpha channel of the mask
- Multiply footage by the mask, which will give
  you final-looking combined image.

TODO: Currently rasterization happens on every
      redraw, need to cache rasterized mask
      somewhere to make redraw more realtime.
2013-10-12 14:09:05 +00:00
6619d6cba7 Fix potential usage of wrong track when setting axis for scene orientation 2013-09-23 08:04:55 +00:00
1f8ab25993 Setting keyframe is now possible for tracks which doesn't have marker at current frame 2013-09-17 08:58:12 +00:00
b9be47e91c Re-track the plane after clearing the keyframe
From the math point of view there're two cases:

- Clearing the keyframe between two other ones.

  In this case tracker will first track plane from
  left keyframe to right one without doing any kind
  of blending. This will make plane stick to the
  actual plane motion, but lead to possible jump
  at the right keyframe.

  Second step is to track from the right keyframe
  to the left one with blending. This gives nice
  transition at the point of second keyframe and
  this mimics situation when you've been setting
  keyframes from left to right.

- Clearing left-most/right-most keyframe.

  In this case it's enough to only re-track the
  plane without blending from the neighbor keyframe
  without blending.
2013-09-17 08:54:10 +00:00
bf5bbda187 Muted footage in MCE still was reading the frames from disk
Wasn't so much great from speed point of view.
2013-09-17 08:43:35 +00:00
b56f8b139b Enable view3d-like shortcuts for pivot point in clip editor 2013-09-10 12:46:27 +00:00
c4e4329f29 Don't show 2D cursor in tracking mode i pivoting is not set to 2D cursor 2013-09-10 12:46:23 +00:00
e72c6f191f Tweaks to plane track
- Do plane re-evaluation only when transform is actually done.
  Before this re-evaluation happened on every mouse move.

- Added a flag "Auto Keyframe" for the plane track, which does:

  * If Auto Keyframe is enabled, then every manual edit of the
    plane will create a new keyframe at current frame and update
    plane motion between current frame and previous/next keyframe.

    This now also implies blending detected motion with neighbor
    keyframes, so there's no jump happening.

    No automatic update on manual point tracks edit will happen.

  * If auto Keyframe is disabled, then no keyframes are adding
    to the plane and every plane tweak will re-evaluate in on
    the whole frame range.

    In this case manual tweaks to point tracks and re-tracking
    them implies plane re-evaluation.
2013-09-10 12:46:18 +00:00
24b27b0474 Create/delete keyframe for motion tracks in clip editor
Use I to create a new keyframe, Alt-I to remove the ketframe.
2013-09-09 11:55:52 +00:00
ea94411db6 Enable vertex snapping to bundle positions
This means it's possible now to snap stuff to
reconstructed tracks positions.
2013-09-09 11:37:37 +00:00
35cd649c66 rename cursor setting functions to make modal set/restore more clearly related functions. 2013-09-06 22:34:29 +00:00
4df6c73d25 Code cleanup: use boolean instead of int for space_clip 2013-09-05 13:37:53 +00:00
9ccf84926d Fix #36605: Segfault when border selecting markers in the "graph" mode when no track is active 2013-08-30 09:11:47 +00:00
7e73620a98 Support transformation around 2D cursor in movie clip editor. 2013-08-29 13:04:12 +00:00
03dbae07d3 Mask primitives
Currently only circle and square, might be easily
extended in the future.

New primitives are creating at cursor location.
This also implied adding 2d cursor to space clip.

Also fix set 2D cursor location which didn't work
in image editor's mask mode since 2.67.

TODO: draw_image_cursor better be moved to some
      more generic file, but it's not so much
      important for now and might be solved later.

Thanks Campbell for the review!
2013-08-26 20:23:26 +00:00
7bd422143e Fix bad draw of plane track when using Tiny display option 2013-08-24 17:25:12 +00:00
Dalai Felinto
a47db8fff6 bugfix: fit_view property was saved in CLIP_OT_view_all operator
before that if you pressed 'F', fit_view would be True every time (e.g.,
even if you pressed 'HOME' which is supposed to call the operator
without the fit_view).

I'm not sure why we need a fullscreen without 'fit_view' but anyways,
that's a different issue.
2013-08-20 23:23:17 +00:00
7e7081551d Code cleanup: use bool instead of BOOL/int 2013-08-19 11:37:42 +00:00
4da3d5bcda Fix read past end of array when drawing tracking markers keyframes
Was introduced by plane track merge.
2013-08-19 11:36:29 +00:00
24ce60cfe4 Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.

Movie clip editor changes:

- Artist might create a plane track out of multiple point
  tracks which belongs to the same track (minimum amount of
  point tracks is 4, maximum is not actually limited).

  When new plane track is added, it's getting "tracked"
  across all point tracks, which makes it stick to the same
  plane point tracks belong to.

- After plane track was added, it need to be manually adjusted
  in a way it covers feature one might to mask/replace.

  General transform tools (G, R, S) or sliding corners with
  a mouse could be sued for this. Plane corner which
  corresponds to left bottom image corner has got X/Y axis
  on it (red is for X axis, green for Y).

- Re-adjusting plane corners makes plane to be "re-tracked"
  for the frames sequence between current frame and next
  and previous keyframes.

- Kayframes might be removed from the plane, using Shit-X
  (Marker Delete) operator. However, currently manual
  re-adjustment or "re-track" trigger is needed.

Compositor changes:

- Added new node called Plane Track Deform.

- User selects which plane track to use (for this he need
  to select movie clip datablock, object and track names).

- Node gets an image input, which need to be warped into
  the plane.

- Node outputs:
  * Input image warped into the plane.
  * Plane, rasterized to a mask.

Masking changes:

- Mask points might be parented to a plane track, which
  makes this point deforming in a way as if it belongs
  to the tracked plane.

Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578

This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
b5890b3519 fix for freed memory access clearing tracks in the clip editor. 2013-07-28 07:11:00 +00:00
29732f5d4f fix [#36283] Crash by activating "Clear Active" in Movie Clip Editor 2013-07-26 04:36:53 +00:00
cbf63e4698 fix for crash in track_markers_freejob (use freed memory) 2013-07-23 14:22:47 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
397da50002 style cleanup: switch statements, include break statements within braces & indent.
also indent case's within the switch (we already did both of these almost everywhere)
2013-07-19 15:23:42 +00:00
925c5010e8 fix for checking char arrays against NULL, instead check their first character. also remove some dead code (return directly after return). 2013-07-16 11:42:07 +00:00
9c8516703d replace strncpy with BLI_strncpy for cases we expect the string to be NULL terminated. 2013-07-14 22:08:56 +00:00
fa3699f067 fix errors in code
- BKE_mball_center_median(), didn't work.
- clip_refresh was removing handlers from wrong space.
- new_modifier, replace strcpy with BLI_strncpy
2013-07-13 05:50:35 +00:00