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.
This commit adds the ability to normalize patterns by their
average value while tracking, to make them invariant to global
illumination changes.
To see this in action, check out the "Lobby" scene from Hollywood
VFX. If you track the markers that are shadowed by the actress,
previously they would not track. With the scale adaption on, the
tracker would shrink the area to compensate for the changed
illumination, losing the track. With "Normalize" turned on, the
patch is correctly tracked and scale is maintained.
A remaining problem is that only the Ceres cost function is
updated to handle the normalization. The brute translation search
does not take this into account. Perhaps "Prepass" (see below)
should get disabled if normalization is enabled until I fix the
prepass to normalize as well.
There are a few other changes:
- Cleanups in tracking RNA comments.
- Bail out of the sampling loop early if the mask is zero; this
saves expensive samples of the image derivatives.
- Rename the wordy "Translation initialization" to "Prepass" at
Sebastian's suggestion.
- Fix a bug where the mask was ignored when sampling in the cost
functor.
This replaces the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
- The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
- There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine (Not implemented yet)
* Perspective
The most stable is the "translation" parameterization. The
others work but still require some tweaking.
- The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
- The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
Also made BKE_tracking_get_search_imbuf use space conversion utility functions,
so now it's not so annoying that search area calculation is happening differently
in different paces.
Also allow even sizes for search area.
Another small fix is about flipping search area dumping by libmv-capi.
It used to be flipped since in blender Y axis is up-aimed.
This commit removes the use of the legacy RegionTracker API from
Blender, and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
- Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
- Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
- Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
- Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Remove the "num_samples_xy" concept and replace it with
automatic determination of the number of samples. This makes the
API easier for users.
- Fix various bugs in the parameterizations.
There remains a bug with subpixel precision tracking when in
"keyframe" mode; this will get fixed shortly.
- adding new points de-selects previous so Ctrl+Click+Drag works usefully.
- cyclic curves now extrude properly
- adding new points inbetween existing now use the surrounding points handle length.
have no object bounding box. Better fix will be to figure out why they are the
bounding boxes are not made.
Thanks to Campbell to tracking down the commit that caused this.
This commit adds some first building blocks for the two operators to work modally based on mouse input. To make their function easier, two hotkeys are introduced, Ctrl+B for bevel and I for inset.
TODO:
After discussion with Campbell, we would like to add scale-style line indicators for the operators. This is already done for transform operators but a new interface for mesh operations may have to be written using pieces from that code since, strictly speaking bevel and inset are not exactly "transform" operators.
Also, a better input method for inset is needed and more options exposed. The method implemented right now uses mouse move for thickness and ctrl-mouse move for depth. These are calculated using the distance of the selection center in screen space and the mouse position. While that may work and prevents abrupt changes in values when switching from thickness tweak mode to depth tweak mode, it limits the magnitude of values that can be put into the tool especially in small or large scale.
Alternatives until a better method is written include:
* use relative offset (works but may give strange results)
* tweak manually after the operation.
Removing this option from the UI. Cyclic offset and/or other the myriad of other
half-working walk/stride cycle stuff has been removed pending further review at
a later date about what's really needed, and the best way to do so with regards
to different rig types (i.e. setup antagonistic).
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.
GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);
Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
- Fixed crash on slide undo. Was caused by some typos in slide
data initialization and not checking for slide action in
cancel callback
- Always create keyframe for frame when marker is stared sliding.
This operator still had some built-in assumptions about the connectivity of input/output sockets (1-to-n in all current node systems). For future node systems (e.g. flow-based particles) and for general customizable nodes the operator is now fully symmetric and supports all kinds of connectivity limits (1:1, 1:n, m:1, m:n).
The operator data can also store a list of node links as opposed to a single link now, so that multiple links can be redirected at once. Holding the CTRL key when clicking a socket, all links from/to that socket are detached and can be moved to a different socket. This is useful for quickly appending a node without moving every individual link.