From 24ce60cfe4511534e57a2dea3f24579c74bbdd29 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 16 Aug 2013 09:46:30 +0000 Subject: 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 :) --- .../startup/bl_ui/properties_mask_common.py | 9 +++++-- release/scripts/startup/bl_ui/space_clip.py | 30 ++++++++++++++++++++++ release/scripts/startup/nodeitems_builtins.py | 1 + 3 files changed, 38 insertions(+), 2 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index d38f5f934b4..9f72d7a6d88 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -190,16 +190,21 @@ class MASK_PT_point(): clip = parent.id tracking = clip.tracking + row = col.row() + row.prop(parent, "type", expand=True) + col.prop_search(parent, "parent", tracking, "objects", icon='OBJECT_DATA', text="Object:") + tracks_list = "tracks" if parent.type == 'POINT_TRACK' else 'plane_tracks' + if parent.parent in tracking.objects: object = tracking.objects[parent.parent] col.prop_search(parent, "sub_parent", object, - "tracks", icon='ANIM_DATA', text="Track:") + tracks_list, icon='ANIM_DATA', text="Track:") else: col.prop_search(parent, "sub_parent", tracking, - "tracks", icon='ANIM_DATA', text="Track:") + tracks_list, icon='ANIM_DATA', text="Track:") class MASK_PT_display(): diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 5048a93d565..04584855ed3 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -311,6 +311,16 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): layout.operator("clip.join_tracks", text="Join") +class CLIP_PT_tools_plane_tracking(CLIP_PT_tracking_panel, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Plane Track" + + def draw(self, context): + layout = self.layout + layout.operator("clip.create_plane_track") + + class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' @@ -579,6 +589,26 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): layout.label(text=label_text) +class CLIP_PT_plane_track(CLIP_PT_tracking_panel, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Plane Track" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = context.space_data.clip + active_track = clip.tracking.plane_tracks.active + + if not active_track: + layout.active = False + layout.label(text="No active plane track") + return + + layout.prop(active_track, "name") + + class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'UI' diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 91090dc2c75..6a5dccaed88 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -342,6 +342,7 @@ compositor_node_categories = [ NodeItem("CompositorNodeMapUV"), NodeItem("CompositorNodeTransform"), NodeItem("CompositorNodeStabilize"), + NodeItem("CompositorNodePlaneTrackDeform"), ]), CompositorNodeCategory("CMP_GROUP", "Group", items=node_group_items), CompositorNodeCategory("CMP_LAYOUT", "Layout", items=[ -- cgit v1.2.3