From d89cf51b1ef8ceeda87b6190e81efba1dc44bb9b Mon Sep 17 00:00:00 2001 From: tentacle Date: Sun, 29 Jan 2006 15:08:51 +0000 Subject: [PATCH] moved all tracking stuff into FexTracker popup menu tracking is now somewhat complete you can track points, convert these to movement&scaling and then split your line and let it be repositioned and rescaled Originally committed to SVN as r42. --- FexTracker/FexTrackerRel.lib | Bin 8262 -> 8946 bytes FexTracker/FexTrackerRel_Opti.lib | Bin 8416 -> 9108 bytes core/FexTracker.h | 12 ++- core/FexTrackingFeature.h | 2 +- core/ass_dialogue.cpp | 15 +++ core/ass_dialogue.h | 2 + ...ck_split.bmp => button_track_movement.bmp} | Bin core/bitmaps/button_track_split_line.bmp | Bin 0 -> 1318 bytes core/fexmovement.h | 36 +++++++ core/frame_main.h | 8 ++ core/frame_main_events.cpp | 90 +++++++++++++++++- core/res.rc | 3 + core/video_box.cpp | 13 +-- core/video_display.cpp | 56 +++++++---- 14 files changed, 204 insertions(+), 33 deletions(-) rename core/bitmaps/{button_track_split.bmp => button_track_movement.bmp} (100%) create mode 100644 core/bitmaps/button_track_split_line.bmp create mode 100644 core/fexmovement.h diff --git a/FexTracker/FexTrackerRel.lib b/FexTracker/FexTrackerRel.lib index a998d6474d12b8316a97f15927f61a793114d7dc..b49534a4880ba4181c68ea40e888e494fcdf5668 100644 GIT binary patch delta 1628 zcma)7OK1~O6g_EL(=?y4oy<)BlUA$}Ewv@}gQ6++S33yZZbqDVzrK?HG= zas_uP=(eE7or~5@DI!wAmAEK~;8qb7QR;p3GSg{Y*ucq5&b{~C`|f@3Wj6nbro*0HEChl4BBypMXH}w}jCL2t?;3QtT&SrX`|1 z%roNOD;VY{Lw_$}yybXCWB+mS#rPnRC~_i3Y@q^95@V!G5>4j-0rP=G>K7+wWM(VK z@iRvc13SyxJY!XTU4@HOQZb)D)j8PLInYzMwnXJmV`%8Y$mO9ut8gw) zd26aedwL5+M}SH}E#v&k4?1!yodPZ=dg{}cO`*-1LY&9YRSyhAfLj_cmIQt#fZzP= zGl01$b180z3H0#$cMce4yw`!ZZ0~ObJ}`DLMkx)PYXTl{%rB0e%>X$Dj~ik5 za7IA@wTM7P2thQU2Gv*tKcdi32Lo}$uom^u;X#!Zvg!z$s{PXR|JKs5x2gQxf4~!5 z*|(6ZZ>K?%;cR(*;I(Jn|26Y;$Gf2%4Bh@$blET_eC_lyJZ%qTLfL1(&ZG_ctSH{_ z{KxVSm!!uw`a zdf$(pbkmawwN>Qa!MS~$dle^x8jVf1gjj4KrUrz>7M7?*HH~;p+81-G7s-cA>B2{r zcUm<)^RJ^f%UzVXY(hJ`)QKj{crtV(?#RsRS-;34_Hlrw;>#MVCREGV!p0!ACc54A zb)=-Rm5m{qO7z-B(XGk2GZc9mn0TX-!UOF6<5 zicT+55vwG=8c|R0QZ8X*bBDZ#GZ}FcFD?RyJYsE~?AsuQu<~5^opV8tbe*O(&Ao<$ zY1z769IlGi@wsu=I+M;?`)fPfBf|bF+)PQ+SxaR?R=HwA8eKP?4Jw-S$&^jvzYFNJ HX!iaEBkZB8 delta 1230 zcmaJ>OK1~O6g`usY4e|CCYi~1l89}s^piBwh^18Q#~-F3A{2z|>e7XDA&688E{asR zf`|*1Lf6vNu3WU6E~Hl16-%s}x|J^6)%)f#X|geJGBf9%`#Ud_KT|ssFVdcJWn^@; zL~6u%a&fqnvp+Q-fB_)90YrBI?HEYbBoYUJK=M!`wgm_n6^Rt<1Tt=k_$DA=?n}fb zS@~>-{8C?YuHi*(S;EF=!S+{Q3Mb{C*1JB3j;cQh{Hq} zDq>LJYLow8-2n;(6ZGD@TYu@BSE!(#tKSZMR_fP7tK#YC^r)|%-p1)+MC}+m{9b<+ z`Q>u>2YQd-=(T=wN*VMq7Vc#F$}YXpt<|HL;sk4^L7j$X=cJ5lt@NUy`9%(&EHC7y zcis$rGJ0AiCx#Xfl0KHW*bAx#<5V_VH2rqv=VsMOQzLQuYw9)~PTXC*n`je5OrOwWK*iED4A*N;pHy zR#PKZKA)9krdSi?GS#j!J5 z_xS0#K=oXd_6*(GsFCZpHy&e2M3l*^{WOtpIwHzE%}YxwtclXweA|h#-*yk-x5hob dy3f$fLNi~ix>AsK@Sg?0E!^XSr$miH^dDKD4Uhl; diff --git a/FexTracker/FexTrackerRel_Opti.lib b/FexTracker/FexTrackerRel_Opti.lib index c38209731a85c198a5ca2c8140124c99f1a29f52..382cfc32b4fb417bc1b3d341680528210636078c 100644 GIT binary patch delta 1736 zcmb7EOK1~O6g^38()=4UnVEbhnbaS~`bpaQLDZIt|4OAOZNYxP6qKr66me%Q;!Y5+ zi1-Ireh?%pD^=VHYOT0%qflMx+FcRree+B*X&2VO$uQ@gd+vSrzIiikS9f1dx>}l> zH@0k`%c^=VpUdS<>o?#9kORVffHDR|p8&>?M6w&OFvCxVenBFA0}wF2OT^eiKpU4x z>;VMg6MvEAC&Nrhqz(@QDMs2Q(J%{G7~v-)F(nbZ#>R}yHwm5f0-968g^tr_3MUJvMq68Z+PXX2j_fL&tx&DK=7gczrOgR=7p0S z?&pCWy9=XbFS_fGn&r3F?y~cIQJ_jh_kub4)E5TE z6yQk|7&3tFBrwCcpaVD3z<1`nF<@K+_9TD_4$3l8CNRv+cd=%+0T^LS@%lB^e#&2t{(rVLd&Rx7c-Z&A(YP4X(zxi3Csj-YE-p;qv(1gBTzQ&yx#>f2 z()KaY!_a2?>+eu~jd%KUFX@4Y4mh~Z_U(LT+@BM(2_dE6+aG1nFk7s<$yCV(q1!7em4z z9BiDw7kiR=p}Dj$NiG$!+P0s4!o1&UZ;RcA>uB6ix?QU0wTmN`vg?BTtm?=QYHLe- z5{KtqN|xQm!4Xl?ys$zlkU^VP7AIQB zBt*+L1D9GEk+moV|AF4EW)b9T(az5A{=Ck$pn)%Q@ArJpIluEe_tCj;0}nEuVozsx zcNZCY;!b;Sdxv5Dt_J{|074r;bQ4f>Kzdjz)dyHw<$qRUS1LOX2&LDgv^hX1zAcq3 z07Ckb6qkfhW_({~EBwGRhNSW}#Xx;4y0RKBjv<_3*eI2jl8|kc|+q8Rgn4Fq{VZQot%}Hv!CNfi?E#G+;Xp z6q3M_Na6{`GeCtkWB@C9pv*B3$4VS)<@Z_6pWz(7Pw1$H1}_3oFQ5)V#83kd-0&lW zFnp*-90^1bfdZEk|36KO{))LAxT%=M;BUp8tbeA^l&_hthTl0xroKpz{ko9VXfYBx z(*NV5`82ZQvVHy#sH}#CPjA&dr~M^v+2&UKs8aPc>eONuKBA4;wy19I+aI(E+cxxq zMULsCwk60Hx-77+U$X6TQlryJX-_04tF|ogIeDXMX*89RueJe%<{i&#tqdv$|%Ck>7*X%uUe!806;(#ggvcBWVi-@274Zaqe?8XX@ movement + void InfluenceFeatures( int Frame, float x, float y, float off ); + FexMovement* GetMovement(); + +//feature access FexTrackingFeature* operator [] ( int i ); inline int GetCount(){ return nFeatures; }; inline int GetFrame(){ return CurFrame; }; diff --git a/core/FexTrackingFeature.h b/core/FexTrackingFeature.h index e0424a00d..f0371274e 100644 --- a/core/FexTrackingFeature.h +++ b/core/FexTrackingFeature.h @@ -18,7 +18,7 @@ public: int Eigenvalue; tenlist Pos; - + int StartTime; float Influence; diff --git a/core/ass_dialogue.cpp b/core/ass_dialogue.cpp index 95de06cb0..8fe96de5d 100644 --- a/core/ass_dialogue.cpp +++ b/core/ass_dialogue.cpp @@ -42,12 +42,15 @@ #include "utils.h" #include #include +#include "FexTracker.h" +#include "FexMovement.h" ////////////////////// AssDialogue ////////////////////// // Constructs AssDialogue AssDialogue::AssDialogue() { Tracker = 0; + Movement = 0; Type = ENTRY_DIALOGUE; group = _T("[Events]"); @@ -70,6 +73,7 @@ AssDialogue::AssDialogue() { AssDialogue::AssDialogue(wxString _data,bool IsSSA) { Tracker = 0; + Movement = 0; Type = ENTRY_DIALOGUE; group = _T("[Events]"); @@ -97,6 +101,17 @@ void AssDialogue::Clear () { delete *cur; } Blocks.clear(); + + if( Tracker ) + { + delete Tracker; + Tracker = 0; + } + if( Movement ) + { + DeleteMovement( Movement ); + Movement = 0; + } } diff --git a/core/ass_dialogue.h b/core/ass_dialogue.h index ff60c6415..2c1d5a00c 100644 --- a/core/ass_dialogue.h +++ b/core/ass_dialogue.h @@ -43,6 +43,7 @@ #include "ass_entry.h" #include "ass_time.h" class FexTracker; +class FexMovement; ////////////// @@ -167,6 +168,7 @@ public: wxString Effect; // Effect name wxString Text; // Raw text data FexTracker *Tracker; // Point tracker + FexMovement *Movement; // Point tracker generated movement bool Parse(bool IsSSA=false); // Parses raw ASS data into everything else void ParseASSTags(); // Parses text to generate block information (doesn't update data) diff --git a/core/bitmaps/button_track_split.bmp b/core/bitmaps/button_track_movement.bmp similarity index 100% rename from core/bitmaps/button_track_split.bmp rename to core/bitmaps/button_track_movement.bmp diff --git a/core/bitmaps/button_track_split_line.bmp b/core/bitmaps/button_track_split_line.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9bab8e6ffb8ac3de3103fc5d55eea9fb8f8441ea GIT binary patch literal 1318 zcmZwFF|O1=494;ANuWhET)`FM1k@Hickoes6c>ndSfb+$6h6Xh5ykRPyu0rqk>r>TLC36Jm zutH-b7YsB!kSH`p3c=u@h(w_=xBoTL5l9poBhgeD9DzikF+8MTa0C*C#z-6*gCmeA zG)68SQ-)&?Bnpk$shN?EK%&r?owgh42qX%P*;f)qIs%D8WA=5Wk&Zy3(3pLdWuzmJ zC^TkYa~tUhBnpi=KY@>tjzFT&7$x&h8IG9;j=j(rr3nT{AW>+{el|DK5l9pov!67K zbOaKG#_Z?jPcj{WM4>Ue6v{|PAW>+{E|WIW5l9pob1tDABOQT6p)qRa-!eD?iNdkZ zE-f?C5l9pov&+tnbOaKG#_W;|BOQT6p)tE$(?~}kQE1FAv`yUJz8KtE^)g2zFZ!3`KRXA*Y(l+QtKS|sE=FuokvaUb$!3SxqXlR c+t^2a8+)(sW4C@8d)BYU{k literal 0 HcmV?d00001 diff --git a/core/fexmovement.h b/core/fexmovement.h new file mode 100644 index 000000000..be657c915 --- /dev/null +++ b/core/fexmovement.h @@ -0,0 +1,36 @@ +// FexMovement.h: interface for the FexMovement class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_FEXMOVEMENT_H__63D8ADD8_4EA1_4C56_8D6F_7B587A1A61A4__INCLUDED_) +#define AFX_FEXMOVEMENT_H__63D8ADD8_4EA1_4C56_8D6F_7B587A1A61A4__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +typedef struct +{ + vec2 Pos; + vec3 Rot; + vec2 Scale; +}FexMovementFrame; + +#include "tenlist.h" +class FexMovement +{ +public: + FexMovement(); + ~FexMovement(); + + void Load( const char* Filename ); + void Save( const char* Filename ); + + const char* GetUniqueName(); + + tenlist Frames; +}; + +void FEXTRACKER_API DeleteMovement( FexMovement* delme ); + +#endif // !defined(AFX_FEXMOVEMENT_H__63D8ADD8_4EA1_4C56_8D6F_7B587A1A61A4__INCLUDED_) diff --git a/core/frame_main.h b/core/frame_main.h index 01715bb1c..794824804 100644 --- a/core/frame_main.h +++ b/core/frame_main.h @@ -105,9 +105,13 @@ private: void OnVideoPlayLine(wxCommandEvent &event); void OnVideoStop(wxCommandEvent &event); void OnVideoToggleScroll(wxCommandEvent &event); + + void OnVideoTrackerMenu(wxCommandEvent &event); void OnVideoTrackPoints(wxCommandEvent &event); void OnVideoTrackPointAdd(wxCommandEvent &event); void OnVideoTrackPointDel(wxCommandEvent &event); + void OnVideoTrackMovement(wxCommandEvent &event); + void OnVideoTrackSplitLine(wxCommandEvent &event); void OnKeyDown(wxKeyEvent &event); @@ -324,9 +328,13 @@ enum { Video_Play_Line, Video_Stop, Video_Auto_Scroll, + + Video_Tracker_Menu, Video_Track_Points, Video_Track_Point_Add, Video_Track_Point_Del, + Video_Track_Movement, + Video_Track_Split_Line, Menu_File_Recent = 2000, Menu_Video_Recent = 2200, diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index 51dfe72c2..afcf9c10b 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -74,6 +74,7 @@ #include "dialog_timing_processor.h" #include "FexTracker.h" #include "FexTrackingFeature.h" +#include "FexMovement.h" //////////////////// @@ -86,9 +87,13 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame) EVT_BUTTON(Video_Play_Line, FrameMain::OnVideoPlayLine) EVT_BUTTON(Video_Stop, FrameMain::OnVideoStop) EVT_TOGGLEBUTTON(Video_Auto_Scroll, FrameMain::OnVideoToggleScroll) - EVT_BUTTON(Video_Track_Points, FrameMain::OnVideoTrackPoints) - EVT_BUTTON(Video_Track_Point_Add, FrameMain::OnVideoTrackPointAdd) - EVT_BUTTON(Video_Track_Point_Del, FrameMain::OnVideoTrackPointDel) + + EVT_BUTTON(Video_Tracker_Menu, FrameMain::OnVideoTrackerMenu) + EVT_MENU(Video_Track_Points, FrameMain::OnVideoTrackPoints) + EVT_MENU(Video_Track_Point_Add, FrameMain::OnVideoTrackPointAdd) + EVT_MENU(Video_Track_Point_Del, FrameMain::OnVideoTrackPointDel) + EVT_MENU(Video_Track_Movement, FrameMain::OnVideoTrackMovement) + EVT_MENU(Video_Track_Split_Line, FrameMain::OnVideoTrackSplitLine) EVT_CLOSE(FrameMain::OnCloseWindow) @@ -1129,6 +1134,21 @@ void FrameMain::OnVideoToggleScroll(wxCommandEvent &event) { } +/////////////////// +// Track current line +void FrameMain::OnVideoTrackerMenu(wxCommandEvent &event) { + wxMenu menu( _("FexTracker") ); + AppendBitmapMenuItem(&menu, Video_Track_Points, _("track points"), _(""), wxBITMAP(button_track_points)); + menu.AppendSeparator(); + AppendBitmapMenuItem(&menu, Video_Track_Point_Add, _("add points to movement"), _(""), wxBITMAP(button_track_point_add)); + AppendBitmapMenuItem(&menu, Video_Track_Point_Del, _("remove points from movement"), _(""), wxBITMAP(button_track_point_del)); + menu.AppendSeparator(); + AppendBitmapMenuItem(&menu, Video_Track_Movement, _("generate movement from points"), _(""), wxBITMAP(button_track_movement)); + AppendBitmapMenuItem(&menu, Video_Track_Split_Line, _("split line for movement"), _(""), wxBITMAP(button_track_split_line)); + PopupMenu(&menu); +} + + /////////////////// // Track current line void FrameMain::OnVideoTrackPoints(wxCommandEvent &event) { @@ -1170,6 +1190,70 @@ void FrameMain::OnVideoTrackPoints(wxCommandEvent &event) { } +/////////////////// +// Track current line +void FrameMain::OnVideoTrackMovement(wxCommandEvent &event) { + videoBox->videoDisplay->Stop(); + + // Get line + AssDialogue *curline = SubsBox->GetDialogue(EditBox->linen); + if (!curline) return; + if( !curline->Tracker ) return; + + // Create Movement + if( curline->Movement ) DeleteMovement( curline->Movement ); + curline->Movement = curline->Tracker->GetMovement(); + + // Remove Tracker + delete curline->Tracker; + curline->Tracker = 0; + + videoBox->videoDisplay->RefreshVideo(); +} + + +/////////////////// +// split current line +void FrameMain::OnVideoTrackSplitLine(wxCommandEvent &event) { + videoBox->videoDisplay->Stop(); + + // Get line + AssDialogue *curline = SubsBox->GetDialogue(EditBox->linen); + if (!curline) return; + if( !curline->Movement ) return; + + // Create split lines + int StartFrame = VFR_Output.CorrectFrameAtTime(curline->Start.GetMS(),true); + int EndFrame = VFR_Output.CorrectFrameAtTime(curline->End.GetMS(),false); + + for( int Frame = StartFrame; Frame < EndFrame; Frame ++ ) + { + int localframe = Frame - StartFrame; + + while( curline->Movement->Frames.size() <= localframe ) localframe--; + FexMovementFrame f = curline->Movement->Frames[localframe]; +// f.Pos.x /= videoBox->videoDisplay->GetW + + AssDialogue *cur = new AssDialogue( curline->data ); + cur->Start.SetMS(VFR_Output.CorrectTimeAtFrame(Frame,true)); + cur->End.SetMS(VFR_Output.CorrectTimeAtFrame(Frame,false)); + cur->Text = wxString::Format( _T("{\\pos(%.0f,%.0f)\\fscx%.2f\\fscy%.2f}"), f.Pos.x, f.Pos.y, f.Scale.x*100, f.Scale.y*100 ) + cur->Text; + cur->UpdateData(); + + SubsBox->InsertLine(cur,EditBox->linen + Frame - StartFrame,true,false); + } + + // Remove Movement + DeleteMovement( curline->Movement ); + curline->Movement = 0; + + // Remove this line + SubsBox->DeleteLines( EditBox->linen, EditBox->linen, false ); + + videoBox->videoDisplay->RefreshVideo(); +} + + /////////////////// // Increase Influence void FrameMain::OnVideoTrackPointAdd(wxCommandEvent &event) { diff --git a/core/res.rc b/core/res.rc index d618c2011..bbf9fc79c 100644 --- a/core/res.rc +++ b/core/res.rc @@ -79,9 +79,12 @@ shift_to_frame_disable BITMAP "bitmaps/shift_to_frame_disable.bmp" button_play BITMAP "bitmaps/button_play.bmp" button_stop BITMAP "bitmaps/button_stop.bmp" + button_track_points BITMAP "bitmaps/button_track_points.bmp" button_track_point_add BITMAP "bitmaps/button_track_point_add.bmp" button_track_point_del BITMAP "bitmaps/button_track_point_del.bmp" +button_track_movement BITMAP "bitmaps/button_track_movement.bmp" +button_track_split_line BITMAP "bitmaps/button_track_split_line.bmp" button_bold BITMAP "bitmaps/button_bold.bmp" button_italics BITMAP "bitmaps/button_italics.bmp" diff --git a/core/video_box.cpp b/core/video_box.cpp index a1ea01200..7f6253aa6 100644 --- a/core/video_box.cpp +++ b/core/video_box.cpp @@ -59,12 +59,9 @@ VideoBox::VideoBox(wxPanel *parent) { AutoScroll = new ToggleBitmap(videoPage,Video_Auto_Scroll,wxBITMAP(toggle_video_autoscroll),wxSize(30,-1)); AutoScroll->SetToolTip(_("Toggle autoscroll of video")); AutoScroll->SetValue(Options.AsBool(_T("Sync video with subs"))); - wxBitmapButton *VideoTrackPointsButton = new wxBitmapButton(videoPage,Video_Track_Points,wxBITMAP(button_track_points),wxDefaultPosition,wxSize(25,-1)); - VideoTrackPointsButton->SetToolTip(_("Track point movements in video")); - wxBitmapButton *VideoTrackPointAddButton = new wxBitmapButton(videoPage,Video_Track_Point_Add,wxBITMAP(button_track_point_add),wxDefaultPosition,wxSize(25,-1)); - VideoTrackPointAddButton->SetToolTip(_("Increase influence of tracking points")); - wxBitmapButton *VideoTrackPointDelButton = new wxBitmapButton(videoPage,Video_Track_Point_Del,wxBITMAP(button_track_point_del),wxDefaultPosition,wxSize(25,-1)); - VideoTrackPointDelButton->SetToolTip(_("Decrease influence of tracking points")); + + wxBitmapButton *VideoTrackerMenuButton = new wxBitmapButton(videoPage,Video_Tracker_Menu,wxBITMAP(button_track_points),wxDefaultPosition,wxSize(25,-1)); + VideoTrackerMenuButton->SetToolTip(_("FexTracker")); // Seek videoSlider = new VideoSlider(videoPage,-1); @@ -99,9 +96,7 @@ VideoBox::VideoBox(wxPanel *parent) { videoBottomSizer->Add(AutoScroll,0,wxTOP|wxBOTTOM|wxALIGN_CENTER|wxEXPAND,2); videoBottomSizer->Add(VideoPosition,1,wxLEFT|wxALIGN_CENTER,5); videoBottomSizer->Add(VideoSubsPos,1,wxALIGN_CENTER,0); - videoBottomSizer->Add(VideoTrackPointsButton,0,wxTOP|wxBOTTOM|wxALIGN_CENTER,2); - videoBottomSizer->Add(VideoTrackPointAddButton,0,wxTOP|wxBOTTOM|wxALIGN_CENTER,2); - videoBottomSizer->Add(VideoTrackPointDelButton,0,wxTOP|wxBOTTOM|wxALIGN_CENTER,2); + videoBottomSizer->Add(VideoTrackerMenuButton,0,wxTOP|wxBOTTOM|wxALIGN_CENTER,2); VideoSizer = new wxBoxSizer(wxVERTICAL); VideoSizer->Add(videoDisplay,0,wxEXPAND,0); VideoSizer->Add(videoSliderSizer,0,wxEXPAND,0); diff --git a/core/video_display.cpp b/core/video_display.cpp index a6b7fc6c2..dae9d34f4 100644 --- a/core/video_display.cpp +++ b/core/video_display.cpp @@ -55,6 +55,7 @@ #include #include "FexTracker.h" #include "FexTrackingFeature.h" +#include "FexMovement.h" /////// @@ -557,7 +558,7 @@ void VideoDisplay::DrawTrackingOverlay( wxDC &dc ) // Get line AssDialogue *curline = grid->GetDialogue(grid->editBox->linen); - if( !curline || !curline->Tracker ) return; + if( !curline ) return; int StartFrame = VFR_Output.CorrectFrameAtTime(curline->Start.GetMS(),true); int EndFrame = VFR_Output.CorrectFrameAtTime(curline->End.GetMS(),false); @@ -565,28 +566,45 @@ void VideoDisplay::DrawTrackingOverlay( wxDC &dc ) if( frame_nEndFrame ) return; int localframe = frame_n - StartFrame; - if( curline->Tracker->GetFrame() <= localframe ) return; - dc.SetLogicalFunction(wxCOPY); - - for( int i=0;iTracker->GetCount();i++ ) + if( curline->Tracker ) { - FexTrackingFeature* f = (*curline->Tracker)[i]; - if( f->StartTime > localframe ) continue; - int llf = localframe - f->StartTime; - if( f->Pos.size() <= llf ) continue; - vec2 pt = f->Pos[llf]; - pt.x *= provider->GetZoom(); - pt.y *= provider->GetZoom(); - pt.x = int(pt.x); - pt.y = int(pt.y); + if( curline->Tracker->GetFrame() <= localframe ) return; - dc.SetPen(wxPen(wxColour(255*(1-f->Influence),255*f->Influence,0),1)); + dc.SetLogicalFunction(wxCOPY); - dc.DrawLine( pt.x-2, pt.y, pt.x, pt.y ); - dc.DrawLine( pt.x, pt.y-2, pt.x, pt.y ); - dc.DrawLine( pt.x+1, pt.y, pt.x+3, pt.y ); - dc.DrawLine( pt.x, pt.y+1, pt.x, pt.y+3 ); + for( int i=0;iTracker->GetCount();i++ ) + { + FexTrackingFeature* f = (*curline->Tracker)[i]; + if( f->StartTime > localframe ) continue; + int llf = localframe - f->StartTime; + if( f->Pos.size() <= llf ) continue; + vec2 pt = f->Pos[llf]; + pt.x *= provider->GetZoom(); + pt.y *= provider->GetZoom(); + pt.x = int(pt.x); + pt.y = int(pt.y); + + dc.SetPen(wxPen(wxColour(255*(1-f->Influence),255*f->Influence,0),1)); + + dc.DrawLine( pt.x-2, pt.y, pt.x, pt.y ); + dc.DrawLine( pt.x, pt.y-2, pt.x, pt.y ); + dc.DrawLine( pt.x+1, pt.y, pt.x+3, pt.y ); + dc.DrawLine( pt.x, pt.y+1, pt.x, pt.y+3 ); + } + } + else if( curline->Movement ) + { + if( curline->Movement->Frames.size() <= localframe ) return; + + dc.SetPen(wxPen(wxColour(255,0,0),2)); + FexMovementFrame f = curline->Movement->Frames.lVal[localframe]; + f.Pos.x *= provider->GetZoom(); + f.Pos.y *= provider->GetZoom(); + f.Scale.x *= 30* provider->GetZoom(); + f.Scale.y *= 30* provider->GetZoom(); + dc.DrawLine( f.Pos.x-f.Scale.x, f.Pos.y, f.Pos.x+f.Scale.x+1, f.Pos.y ); + dc.DrawLine( f.Pos.x, f.Pos.y-f.Scale.y, f.Pos.x, f.Pos.y+f.Scale.y+1 ); } }