diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-29 21:26:57 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-29 21:26:57 +0400 |
commit | fb3f24020126afe843e509f53c985c327a324a23 (patch) | |
tree | 8c9ccba3ab2bd8866c54b1d460d2892bd95c38f6 /source/blender/blenloader | |
parent | 0d24c6f0d034d277feeff2650a8165294a259691 (diff) |
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
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_260.c | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d0eb0ed0be0..cb1d2a0b98f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6777,6 +6777,15 @@ static void lib_link_movieTracks(FileData *fd, MovieClip *clip, ListBase *tracks } } +static void lib_link_moviePlaneTracks(FileData *fd, MovieClip *clip, ListBase *tracksbase) +{ + MovieTrackingPlaneTrack *plane_track; + + for (plane_track = tracksbase->first; plane_track; plane_track = plane_track->next) { + plane_track->image = newlibadr_us(fd, clip->id.lib, plane_track->image); + } +} + static void lib_link_movieclip(FileData *fd, Main *main) { MovieClip *clip; @@ -6792,6 +6801,7 @@ static void lib_link_movieclip(FileData *fd, Main *main) clip->gpd = newlibadr_us(fd, clip->id.lib, clip->gpd); lib_link_movieTracks(fd, clip, &tracking->tracks); + lib_link_moviePlaneTracks(fd, clip, &tracking->plane_tracks); for (object = tracking->objects.first; object; object = object->next) { lib_link_movieTracks(fd, clip, &object->tracks); diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 45e764c1e73..14eb8ff4ea6 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -2529,4 +2529,19 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) } } + + { + if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) { + MovieClip *clip; + for (clip = main->movieclip.first; clip; clip = clip->id.next) { + MovieTrackingPlaneTrack *plane_track; + for (plane_track = clip->tracking.plane_tracks.first; + plane_track; + plane_track = plane_track->next) + { + plane_track->image_opacity = 1.0f; + } + } + } + } } |