Commit Graph

36 Commits

Author SHA1 Message Date
2da49c4a8f Rotation support for motion tracking markers
Implemented general transformation tool Rotation for motion tracking data.
Mainly used to rotate pattern of markers.

To achieve most of usability, added configurable pivot point which is in fact
was median point before, but now can be chosen from boundbox center, median point
or individual centers. Individual centers means transformation would be performed
around marker's position, which is useful for rotation and scale.

Also implemented alternative scaling transformation -- hit S, S leads to
scaling of pattern area only.

TODO:
- clamping in some cases isn't working well, but that's easier to be resolved
  after moving search are to marker.
- Update startup.blend so clip editor in Motion Tracking screen would be set to
  Individual Centers by default.
2012-05-18 09:33:50 +00:00
060282ea42 svn merge ^/trunk/blender -r46612:46629 2012-05-14 13:55:12 +00:00
be5b447100 lasso select for movie clip markers. 2012-05-14 12:04:00 +00:00
2a3fddf5b3 svn merge: Merging r46558 through r46612, from trunk 2012-05-13 18:16:25 +00:00
9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
16d93f3881 Merging r46203 through r46413 from trunk into soc-2011-tomato 2012-05-08 13:01:16 +00:00
48ead27366 Camera tracking: switch dopesheet information to lazy calculation
All operators which changes tracking data now just tags dopsheet as outdated,
actual re-calculaiton of happens only when this information is actually needed
(like on dopesheet draw).

This makes things a bit faster when there's no dopesheet visible in current
screen and also makes it much easier to update dopesheet using dependency
graph.

Also renamed dopesheet_sort_order to dopesheet_sort_method in rna and internal
stuff which makes much more sense and also correlated with naming in
file browser.
2012-05-03 23:15:01 +00:00
3336909050 Merging r46137 through r46202 from trunk into soc-2011-tomato 2012-05-02 18:07:01 +00:00
6f3400ca52 Clip editor: cleanup of View menu - do not show operators which doesn't make sense in dopesheet/curve view 2012-05-02 17:33:48 +00:00
f111131ca6 Camera tracking: initial commit of dopesheet view for clip editor
- Displays dopesheet information for selected tracks, and currently does not
  support any kind of editing.
- Changed regions to use the whole main region for such views as curves and dopesheet.
  This allows to have own panels with tools/properties in this area.
- Active clip is getting synchronized between different clip editor editors in the
  same screen, so updating of curve/dopesheet views happens automatically when one
  changes current clip in one of this editors.
- Panels in toolbox and properties panels are now separated to rely on current view
  mode, but some operators and poll functions still need to be updated.
- Added new screen called "Movie Tracking" where layout is configured to
  display timeline, main clip window, curves and dopesheet.
2012-04-30 16:19:20 +00:00
323aedb81e Camera tracking: use texture buffers (if supported) to display clip editor frames
Use texture buffers to display frames of footage in clip editor. This allows
to apply bilinear filtering of proxied resolution which.

This also resolves incredibly slow performance when drawing 4K footage on
some videocards (was originally noticed on macbook pro). Also this allows
to avoid sending the whole frame to the video memory when working with a
single frame (i.e. before this patch the whole frame would be send to the
videocard when panning frame).
2012-04-30 16:19:12 +00:00
9151d46d7d Tomato: initial commit of mask editing tools into SVN
- Added new dtaablock called Mask which might be re-used in any area.
  Currently editing of masks happens in clip editor and they might be used in
  compositor nodes only.
- Added new mode to clip clip editor to interact with masks.
  Implemented basic tools to create shapes, splines and points. Also implemented
  idea of UW points for feather which means feather points are have got U
  coordinate along spline (which is measured from 0 to 1) and W is it's weight
  meaning distance from main spline.
- Spline points might be parented to movie tracks.
  Interface for this isn't best yet.
- Rasterisaztion of masks happens in compositor node (Input -> Mask)
  Input image of this ode is used as reference for mask resolution.
  Currently all splines of all shapes are rasterizing independently which
  means shapes with holes are not supported.
  Also feather rasterization is not implemented.

  Rasterized was implemented by Pete Larbell, thanks!

Do not consider this is something finished, there's still lots of things to
be done (especially from interface and usability points of view).
2012-04-30 07:43:21 +00:00
ebe4ffa8de Tomato: refactoring of dopesheet to allow different sort orders in list of channels
Store list of channels displaying in dopesheet separately from list of tracks.
This allows to re-sort channels in dopesheet independently from list of all
tracks (currently only alphabetic sorting is implemented).

This also allows to cache assorted information (like tracked segments of track)
but currently such a things are not bottlenecks and could be done after merge
dopesheet view into trunk.

TODO:
- Still have some deadlocks when drawing selected channels.
  Skipping channel background or keyframe drawing helps here but
  this need to be resolved.
- Bump sub-version and wrote code needed to convert pre-dopesheet interface
  with opened curve view displaying properly.
- Probably it'll worth caching tracked segments.
2012-04-29 20:04:12 +00:00
a18e18264b Merging r46062 through r46073 from trunk into soc-2011-tomato 2012-04-29 14:10:13 +00:00
c27c87dde4 Camera tracking: backport refactoring made in local branches with masking and dopesheet view into trunk
Mostly related on changes in poll functions for tracking operators and some changes
to how interface is initializing for different view types.
2012-04-29 12:32:26 +00:00
ec4edb94d9 Camera tracking: initial commit of dopesheet view for clip editor:
- Changed regions to use the whole main region for such views as
  curves and dopesheet. This allows to have own panels with
  tools/properties in this areas.
- Active clip is getting synchronized between different clip editor
  editors in the same screen, so updating of curve/dopesheet views
  happens automatically when one changes current clip in one of this
  editors.
- Curves and dopesheet are still using PREVIEW region type instead of
  re-using main region.
- To deal with vertical synchronization in dopesheet, re-initialization
  of preview region happens.
- Panels in toolbox and properties panels are now separated to rely
  on current view mode, some operators and poll functions still need
  to be updated.
- Added new screen called "Movie Tracking" where layout is configured to
  display timeline, main clip window, curves and dopesheet.
2012-04-14 12:03:23 +00:00
c3218ebdff Camera tracking: use texture buffers (if supported) to display clip editor frames
Initial idea was to perform bilinear filtering for displaying proxied frame
to make it looking a bit smoother. It was done but it was also discovered
that using such kind of texture buffers helps on some crappy videocards
when playing $k footage.
2012-04-14 12:03:09 +00:00
37c02ddee1 Camera tracking: revert changes made for texture buffer frame drawing.
Will be applied as another cleaned-up patch.
2012-04-14 12:03:03 +00:00
746e712f7a Merging r44140 through r44226 from trunk into soc-2011-tomato 2012-02-18 16:12:22 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
c8f5dac11b Movie Clip Editor: implemented option to display frame using OpenGL textures
Initial idea was to perform bilinear filtering for displaying proxied frame
to make it looking a bit smoother. It was done but it was also discovered
that using such kind of texture buffers helps on some crappy videocards
when playing $k footage.

Currently check for NPOT support is disabled, so use this option with care.
2012-02-03 19:13:31 +00:00
27d42c63d9 Camera tracking integration
===========================

Commiting camera tracking integration gsoc project into trunk.

This commit includes:

- Bundled version of libmv library (with some changes against official repo,
  re-sync with libmv repo a bit later)
- New datatype ID called MovieClip which is optimized to work with movie
  clips (both of movie files and image sequences) and doing camera/motion
  tracking operations.
- New editor called Clip Editor which is currently used for motion/tracking
  stuff only, but which can be easily extended to work with masks too.

  This editor supports:
  * Loading movie files/image sequences
  * Build proxies with different size for loaded movie clip, also supports
    building undistorted proxies to increase speed of playback in
    undistorted mode.
  * Manual lens distortion mode calibration using grid and grease pencil
  * Supervised 2D tracking using two different algorithms KLT and SAD.
  * Basic algorithm for feature detection
  * Camera motion solving. scene orientation

- New constraints to "link" scene objects with solved motions from clip:

  * Follow Track (make object follow 2D motion of track with given name
    or parent object to reconstructed 3D position of track)
  * Camera Solver to make camera moving in the same way as reconstructed camera

This commit NOT includes changes from tomato branch:

- New nodes (they'll be commited as separated patch)
- Automatic image offset guessing for image input node and image editor
  (need to do more tests and gather more feedback)
- Code cleanup in libmv-capi. It's not so critical cleanup, just increasing
  readability and understanadability of code. Better to make this chaneg when
  Keir will finish his current patch.

More details about this project can be found on this page:
    http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2011

Further development of small features would be done in trunk, bigger/experimental
features would first be implemented in tomato branch.
2011-11-07 12:55:18 +00:00
e4cbb8dd94 Camera tracking integration
===========================

- Fixed jump when sliding movie clip with lock to selection enabled and nothing selected.
- Reset offset from locked position when adding new marker.
2011-10-29 11:34:26 +00:00
d4be67f501 Camera tracking integration
===========================

Remove $Id$
2011-10-24 15:24:53 +00:00
827fa36f0b Camera tracking integration
===========================

Naming refactor: avoid using acquire from movie clip related functions.
This stuff doesn't need releasing, all locks happens in getters,
so using get instead of acquire makes more sense here.
2011-10-20 09:52:13 +00:00
5f0e32fe6c Camera tracking integration
===========================

- Fixed movie clip cache drawing -- it used to draw both
  distorted and undistorted cached frames.
- Undistort markers position in clip editor when using
  undistorted rendering.
  Can be noticeable slower when displaying paths.
- Display proper image in track preview widget when
  using undistorted rendering.
- Do not mark scoped as dirty when not in tracking mode.
2011-10-10 15:29:39 +00:00
e2db9a9ee1 Camera tracking integration
===========================

- Added python method MovieClip.tracking.tracs.add() to add new track.
  Marker for this track is getting created on position (0, 0) and it's
  keyframed to specified frame number.

- Implemented rotation 2D stabilization. It's supposed to be used in the
  following workflow:

  * Set tracks which defines location stabilization.
  * Choose one track which defines orientation.
  * Vector which connects median point of location and track used for
    rotation would have the same orientation along all frames.

  2D stabilization with rotation can be a bit slow.

- Some internal refactor and code clean-up.
2011-09-07 08:09:50 +00:00
6cc4952ca3 Camera tracking integration
===========================

- Fixed bug with resetting marker's flag for non-transforming
  tracks when canceling transformation.
- Fixed bug with keyframing non-selected tracks when initializing
  tracking tools.
- Changed selection policy: now invisible parts of marker
  can be selected.
- Added operator redo panel to Clip Editor.
- Set Scale operator now uses operator property for scale.
- Added operator "Clean Tracks" which currently checks if tracks
  are tracked long enough and can select bad tracks, delete them
  or delete tracking segments which are too short.
2011-08-04 14:39:37 +00:00
a28867e172 Camera tracking integration
===========================

- Made naming in libmv-api more uniform.
- Move aspect ration detection of clip to movieclip.c.
- Remove unused width and height from camera intrinsics function.
- Reconstruction should now deal correct with aspect ratio.
2011-08-03 18:28:40 +00:00
b5716beef0 Camera tracking integration
===========================

- Do not show frame boundary border when stabilization isn't enabled.
- Separate stabilization settings from display in clip editor.
  Now clip can contain stabilization data but still be displayed
  un-stabilized in clip editor.
- Internal changes in stabilization:
  * Use separated location/scale parameters rather than 4x4 matrix.
    In some ares "decomposed" data is needed (text draw functions, i.e.).
    Also such decomposed data could be used in compositor.
  * MovieClip now uses own structure for cache where additional data
    can be stored. MovieCache structure now one of properties in
    this new structure.
  * Get rid of stable image buffer stored in MovieClipStabilization
    structure. Pre-created buffer for scaling still stored there.
    This helps to keep playback realtime -- re-creating this buffer
    introduces ~15% slowdown.
- Added sliders to 2D stabilization panel which controls intensity
  of translation/scale which applies on shot.
- Added filter type to Stabilize2D compositor node. Supports nearest,
  bilinear and bicubic interpolation.
- After discussion with Sebastian and Francois added new node called
  Transformation. It can apply translation, rotation and scale. It's
  not the same thing as applying this components separately -- all
  transformation is happening inside "canvas". And it should be more
  accurate on interpolation and sub-pixel translation.
  Need to check order of applying translation/scale/rotation btw.
- Added output sockets to movie clip compositor node. They holds
  stabilization data which can be used by Translate or Transform
  nodes.
- Minor fix of UI issues in Display panel.
2011-08-01 15:28:19 +00:00
3eea1954c1 Camera tracking integration
===========================

- If "Zoom To Mouse" is enabled in user preferences then
  zooming would happen to mouse position in clip editor.
- Fixed 1px padding from shot boundary rectangle.
- Allow for some operators grab cursor.
- Enlarge marker anchor sliding area and make it prioritized
  on pattern/search slide zones,
2011-08-01 08:29:17 +00:00
6745e45c48 Camera tracking integration
===========================

Implemented 2D stabilization:

- Based on average point of several tracks.
- Tracks for stabilization are controllable from
  "2D stabilization" panel.
- Implemented autoscaling. Could fail if average point is
  too close to frame boundary.
- Background clip in 3D viewport and MovieClip input
  compositor nodes are using stable shot.

Some internal weak things:
- Stable shots aren't cached in moviecache. There is
  only one "slot" for stable shot inside stabilization
  structure.
- This could fail if several threads are requested different
  frames (for example when starting playback, pause to make
  Nodes Editor trigger refresh, continue playback).
- Due to it shouldn't crash i decided to implement better
  caching for stable shots a bit later.
2011-07-29 15:25:00 +00:00
cd332d571a Camera tracking integration
===========================

- Fixed crash when transforming disabled marker.
- Select Inverse wouldn't select hidden parts of markers.
- Movie Clip display aspect ratio is now available on Display panel.
2011-07-21 09:23:25 +00:00
6e3bcdcb26 Camera tracking integration
===========================

- Marker's preview panel is now avaliable with any
  tool selected (except NONE).
- Fixed bug with marker's point going outside of pattern
  when scaling pattern which isn't centered to marker's pos.
- Changed a bit pattern area image generation.
  Now it shouldn't give artifacts with different kinds of
  offsets caused because of float-?int conversions.
- Rollback code for generating flat buffer of search area
  when tracking. It'll be more accurate with current position
  calculation.
  Will switch to BKE_tracking_acquire_search_imbuf when
  backwards position calculation would be implemented.
- Added option to make markers thin. It's in Debug panel due
  to this option was really useful for debugging preview image
  but not sure it'll be useful for artists.
- Added "View Selected" operator (hotkey is numpad period).
  Fits view to show all selection at the frame.
- Added option "Lock to Selection" which locks view
  to show centered selection. Useful to visual markers
  tracking during playback.
  This option is on "Display" panel.
2011-06-15 17:23:08 +00:00
02ace953a9 Camera tracking integration
===========================

- itasc adopted for Eigen3 library.
  It compiles well, but need deeper testing for regressions.
- Removed Eigen2 library.
- Added settings to tracker which could be changed from UI.
- Pattern area is now affects on tracker.
  Currently libmv supports square patterns which are centered
  to marker's position. Maximal pattern dimensions is sending
  to libmv as pattern size. Would be changed when libmv would
  support non-centered and non-square patterns.
- Fixed bug with syncing pattern's flags when tracking.
- Current frame in cache line became a bit more visible.
  It's useful for me to when debugging.
- Changed behaviour of "Add Marekr" operator: not it's non-modal
  and places marker on mouse position at click.
- Added macro "Add Marekr and Move" which is used to place
  markers from toolbar button.
- Added some utility functions to get image buffer under search
  and pattern area which also returns relative position of
  marker center for this images.
  Generated images are more "correct" from coords rounding
  POV, but  re-calculation of marker position back to
  frame coords is more complicated and not implemented yet,
  so old not very accurate logic is still used.
- Added preview widget with content of pattern area.

NOTE: files saved in previous versions of this branch could
      easily crash on tracking. Use "Reset To Settings" button
      from Tracking Settings before tracking selected markers
      for such files.

TODO:
- Implement adjusting marker position from marker's
  preview widget.
- We've got an idea of sliding marker after click before
  releasing mouse button.
2011-06-14 16:22:06 +00:00
c4849aee1c Camera tracking integration
===========================

Implemented basic structures and operators for markers manipulaiton.

Markers contains:
- Position of marker at frame in unified 0..1 coordinates
- Relative positions of left-bottom and right-top corners of pattern area
- Relative positions of left-bottom and right-top corners of search area
- Selection flags

New operators:
- Create new maerker. It's a modal operator which creates markers
  at mouse position when LMB is clicking.
- Delete selected markers.
- Select marker using RMB. Some parts of marker (point, patter, search)
  could be deselected.
- Select markers using rectangular selection.
- Select markers using circle selection.
- Marker translation (G-key).
- Marker scaling (S-key).

UI changes:
- Added mode to space clip. Currently supported modes are:
    * View mode
    * Tracking mode
  This was intended to separate different categories of tools,
  so interface shouldn't be overheaded with plenty of tools
  which aren't actually using in the same time.
- Created new panel when actiev tool is 'MARKER' and there's
  active marker where positions could be adjusted in pixel space.

Internal changes:
- Splitted DNA/RNA movieclip files to make separation of
  tracking data and movie data more clear. This could be useful
  in the future when we'll want to support multiplie moies
  for single camera tracking (to make tracking more accurate).
- Added new file in blenkernel, where all tracking-related function
  would be stored. Not very much function here at this moment,
  but in the future all stuff related on converting DNA to external
  tracking data would be stored here.
2011-06-03 15:39:53 +00:00