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.
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.
- 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.
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).
- 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).
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.
- 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.
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.
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.
===========================
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.
===========================
- Fixed jump when sliding movie clip with lock to selection enabled and nothing selected.
- Reset offset from locked position when adding new marker.
===========================
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.
===========================
- 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.
===========================
- 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.
===========================
- 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.
===========================
- 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.
===========================
- 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.
===========================
- 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,
===========================
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.
===========================
- 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.
===========================
- 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.
===========================
- 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.
===========================
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.