[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39025] branches/soc-2011-tomato: Camera tracking integration
Sergey Sharybin
g.ulairi at gmail.com
Thu Aug 4 16:39:38 CEST 2011
Revision: 39025
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39025
Author: nazgul
Date: 2011-08-04 14:39:37 +0000 (Thu, 04 Aug 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
branches/soc-2011-tomato/source/blender/editors/include/ED_clip.h
branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_intern.h
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_ops.c
branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c
branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
branches/soc-2011-tomato/source/blender/editors/transform/transform_generics.c
branches/soc-2011-tomato/source/blender/makesdna/DNA_tracking_types.h
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_tracking.c
Added Paths:
-----------
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_toolbar.c
Removed Paths:
-------------
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_header.c
Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py 2011-08-04 14:39:37 UTC (rev 39025)
@@ -133,11 +133,6 @@
settings = clip.tracking.settings
col = layout.column(align=True)
- col.label(text="Transform:")
- col.operator("transform.translate")
- col.operator("transform.resize")
-
- col = layout.column(align=True)
col.label(text="Marker:")
col.operator("clip.add_marker_move")
col.operator("clip.delete_track")
@@ -193,10 +188,11 @@
row = col.row()
row.operator("clip.set_axis", text="Set X Axis").axis = 'X'
row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y'
-
- col = layout.column()
- col.prop(settings, "distance")
col.operator("clip.set_scale")
+
+ col = layout.column(align=True)
+ col.label(text="Clean-up:")
+ col.operator("clip.clean_tracks")
else:
layout.operator('clip.open')
Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h 2011-08-04 14:39:37 UTC (rev 39025)
@@ -91,8 +91,9 @@
struct ImBuf *BKE_tracking_stabilize_shot(struct MovieTracking *tracking, int framenr, struct ImBuf *ibuf, float loc[2], float *scale);
void BKE_tracking_stabdata_to_mat4(float loc[2], float scale, float mat[4][4]);
-#define TRACK_SELECTED(track) (((track->flag&TRACK_HIDDEN)==0) && ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT))
-#define TRACK_AREA_SELECTED(track, area) (((track->flag&TRACK_HIDDEN)==0) && ((area)==TRACK_AREA_POINT?(track)->flag&SELECT : ((area)==TRACK_AREA_PAT?(track)->pat_flag&SELECT:(track)->search_flag&SELECT)))
+#define TRACK_SELECTED(track) ((((track)->flag&TRACK_HIDDEN)==0) && ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT))
+#define TRACK_AREA_SELECTED(track, area) ((((track)->flag&TRACK_HIDDEN)==0) && ((area)==TRACK_AREA_POINT?(track)->flag&SELECT : ((area)==TRACK_AREA_PAT?(track)->pat_flag&SELECT:(track)->search_flag&SELECT)))
+#define TRACK_VIEW_SELECTED(sc, track) ((TRACK_AREA_SELECTED(track, TRACK_AREA_POINT) || (((sc)->flag&SC_SHOW_MARKER_PATTERN && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))) || (((sc)->flag&SC_SHOW_MARKER_SEARCH && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH)))))
#define MARKER_VISIBLE(sc, marker) (((marker)->flag&MARKER_DISABLED)==0 || ((sc)->flag&SC_HIDE_DISABLED)==0)
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c 2011-08-04 14:39:37 UTC (rev 39025)
@@ -237,7 +237,6 @@
clip->tracking.settings.frames_limit= 20;
clip->tracking.settings.keyframe1= 1;
clip->tracking.settings.keyframe2= 30;
- clip->tracking.settings.dist= 1;
clip->tracking.stabilization.scaleinf= 1.f;
clip->tracking.stabilization.locinf= 1.f;
Modified: branches/soc-2011-tomato/source/blender/editors/include/ED_clip.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/include/ED_clip.h 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/editors/include/ED_clip.h 2011-08-04 14:39:37 UTC (rev 39025)
@@ -42,6 +42,8 @@
struct wmEvent;
/* clip_editor.c */
+int ED_space_clip_poll(struct bContext *C);
+
void ED_space_clip_set(struct bContext *C, struct SpaceClip *sc, struct MovieClip *clip);
struct MovieClip *ED_space_clip(struct SpaceClip *sc);
void ED_space_clip_size(struct SpaceClip *sc, int *width, int *height);
Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt 2011-08-04 14:39:37 UTC (rev 39025)
@@ -41,7 +41,7 @@
set(SRC
space_clip.c
clip_draw.c
- clip_header.c
+ clip_toolbar.c
clip_ops.c
tracking_ops.c
clip_editor.c
Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c 2011-08-04 14:39:37 UTC (rev 39025)
@@ -284,7 +284,7 @@
if(!tiny) {
UI_ThemeColor(TH_MARKER_OUTLINE);
- if(TRACK_SELECTED(track)) {
+ if(TRACK_VIEW_SELECTED(sc, track)) {
glPointSize(5.0f);
glBegin(GL_POINTS);
for(i= a; i<b; i++) {
@@ -304,7 +304,7 @@
UI_ThemeColor(TH_PATH_BEFORE);
- if(TRACK_SELECTED(track)) {
+ if(TRACK_VIEW_SELECTED(sc, track)) {
glPointSize(3.0f);
glBegin(GL_POINTS);
for(i= a; i<b; i++) {
@@ -561,7 +561,7 @@
if((tiny && outline) || (marker->flag&MARKER_DISABLED))
return;
- if(!TRACK_SELECTED(track) || track->flag&TRACK_LOCKED)
+ if(!TRACK_VIEW_SELECTED(sc, track) || track->flag&TRACK_LOCKED)
return;
track_colors(track, act, col, scol);
@@ -686,7 +686,7 @@
char str[128]= {0}, state[64]= {0};
float x, y, dx= 0.f, dy= 0.f;
- if(!TRACK_SELECTED(track))
+ if(!TRACK_VIEW_SELECTED(sc, track))
return;
if(marker->flag&MARKER_DISABLED) {
Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c 2011-08-04 14:39:37 UTC (rev 39025)
@@ -55,6 +55,16 @@
#include "UI_view2d.h"
+int ED_space_clip_poll(bContext *C)
+{
+ SpaceClip *sc= CTX_wm_space_clip(C);
+
+ if(sc && sc->clip)
+ return 1;
+
+ return 0;
+}
+
void ED_space_clip_set(bContext *C, SpaceClip *sc, MovieClip *clip)
{
sc->clip= clip;
@@ -168,7 +178,7 @@
track= clip->tracking.tracks.first;
while(track) {
- if(TRACK_SELECTED(track)) {
+ if(TRACK_VIEW_SELECTED(sc, track)) {
MovieTrackingMarker *marker= BKE_tracking_get_marker(track, sc->user.framenr);
if(marker) {
Deleted: branches/soc-2011-tomato/source/blender/editors/space_clip/clip_header.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/clip_header.c 2011-08-04 14:19:35 UTC (rev 39024)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/clip_header.c 2011-08-04 14:39:37 UTC (rev 39025)
@@ -1,160 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2011 Blender Foundation.
- * All rights reserved.
- *
- *
- * Contributor(s): Blender Foundation,
- * Sergey Sharybin
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/editors/space_clip/clip_header.c
- * \ingroup spclip
- */
-
-#include "DNA_windowmanager_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
-
-#include "BKE_context.h"
-#include "BKE_screen.h"
-
-#include "ED_screen.h"
-
-#include "WM_types.h"
-
-/* ************************ header area region *********************** */
-
-/************************** properties ******************************/
-
-static ARegion *clip_has_properties_region(ScrArea *sa)
-{
- ARegion *ar, *arnew;
-
- ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if(ar)
- return ar;
-
- /* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
-
- /* is error! */
- if(ar==NULL)
- return NULL;
-
- arnew= MEM_callocN(sizeof(ARegion), "clip properties region");
-
- BLI_insertlinkafter(&sa->regionbase, ar, arnew);
- arnew->regiontype= RGN_TYPE_UI;
- arnew->alignment= RGN_ALIGN_RIGHT;
-
- arnew->flag= RGN_FLAG_HIDDEN;
-
- return arnew;
-}
-
-static int properties_poll(bContext *C)
-{
- return (CTX_wm_space_clip(C) != NULL);
-}
-
-static int properties_exec(bContext *C, wmOperator *UNUSED(op))
-{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= clip_has_properties_region(sa);
-
- if(ar)
- ED_region_toggle_hidden(C, ar);
-
- return OPERATOR_FINISHED;
-}
-
-void CLIP_OT_properties(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Properties";
- ot->description= "Toggle clip properties panel";
- ot->idname= "CLIP_OT_properties";
-
- /* api callbacks */
- ot->exec= properties_exec;
- ot->poll= properties_poll;
-}
-
-/************************** tools ******************************/
-
-static ARegion *clip_has_tools_region(ScrArea *sa)
-{
- ARegion *ar, *arnew;
-
- ar= BKE_area_find_region_type(sa, RGN_TYPE_TOOLS);
- if(ar)
- return ar;
-
- /* add subdiv level; after header */
- ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
-
- /* is error! */
- if(ar==NULL)
- return NULL;
-
- arnew= MEM_callocN(sizeof(ARegion), "clip tools region");
-
- BLI_insertlinkafter(&sa->regionbase, ar, arnew);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list