-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresolve-retime-speed.pmc
144 lines (142 loc) · 8.86 KB
/
resolve-retime-speed.pmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[PMC Code v5.0.5]|F3||1|Window,2,Fast,0,1,Input,-1,-1,1|1|Macro1
Groups=Start:1
1|If File Not Exist|images\edit-page-timeline-settings.png|1|0|If_Statement|||||
2|[MsgBox]|Please check if folder "images" is found in %A_ScriptDir%|1|0|MsgBox|0||||
3|Return||1|0|Return|||||
4|[End If]|EndIf|1|0|If_Statement|||||
5|If Window Not Exist|ahk_exe Resolve.exe|1|0|If_Statement|||||
6|[MsgBox]|Please start Resolve to use Retime Speed selection|1|0|MsgBox|0||||
7|Return||1|0|Return|||||
8|[End If]|EndIf|1|0|If_Statement|||||
9|WinActivate||1|333|WinActivate||ahk_exe Resolve.exe|||
10|MouseGetPos|StartMouseX, StartMouseY|1|0|MouseGetPos|||||
011|[MsgBox]|Find timeline icon for setting search boundaries:|1|0|MsgBox|0||||
12|Continue, Stop, TimelineCursorX, TimelineCursorY, 0|0, 0, %A_ScreenWidth%, %A_ScreenHeight%, images\edit-page-timeline-settings.png|1|0|ImageSearch||Window|||
13|If Image/Pixel Found||1|0|If_Statement|||||
14|[Assign Variable]|ClipSearchBeginX := %TimelineCursorX% + 100|1|0|Variable|Expression||||
15|[Assign Variable]|ClipSearchBeginY := %TimelineCursorY% + 75|1|0|Variable|Expression||||
16|[Assign Variable]|ClipSearchEndX := %A_ScreenWidth%|1|0|Variable|||||
17|[Assign Variable]|ClipSearchEndY := %A_ScreenHeight% - 90|1|0|Variable|Expression||||
18|[Add Variable]|TimelineCursorY += 45|1|0|Variable|||||
019|Move|%ClipSearchBeginX%, %ClipSearchBeginY%, 0|1|10|Click|||||
020|[Pause]||1|5000|Sleep|||||
21|[Else]|Else|1|0|If_Statement|||||
22|[MsgBox]|No timeline has been found|1|0|MsgBox|0||||
23|Return||1|0|Return|||||
24|[End If]|EndIf|1|0|If_Statement|||||
25|[Assign Variable]|ClickOnRetimeDropdownCount := 0|1|0|Variable|||||
26|[Label]|ClickOnRetimeDropdown|1|0|Label|||||
27|[Add Variable]|ClickOnRetimeDropdownCount += 1|1|0|Variable|||||
28|MouseGetPos|TempMouseX, TempMouseY|1|0|MouseGetPos|||||
29|Move|0, 0, 0|1|10|Click|||||
30|[Pause]||1|50|Sleep|||||
031|Move|%ClipSearchBeginX%, %ClipSearchBeginY%, 0|1|10|Click|||||
032|[Pause]||1|2000|Sleep|||||
033|Move|%ClipSearchEndX%, %ClipSearchEndY%, 0|1|10|Click|||||
034|[Pause]||1|2000|Sleep|||||
35|Continue, Continue, ClipX, ClipY, 0|%ClipSearchBeginX%, %ClipSearchBeginY%, %ClipSearchEndX%, %ClipSearchEndY%, images\video-edge.png|1|0|ImageSearch||Window|||
36|Move|%TempMouseX%, %TempMouseY%, 0|1|10|Click|||||
37|If Image/Pixel Not Found||1|0|If_Statement|||||
38|[MsgBox]|Please select video clip first|1|0|MsgBox|0||||
39|Return||1|0|Return|||||
40|[End If]|EndIf|1|0|If_Statement|||||
041|[MsgBox]|Found %ClipX%`, %ClipY%|1|0|MsgBox|0||||
42|FindClipEnd|ClipEndX := ClipX, ClipY|1|0|Function|||||
43|Compare Variables|ClipEndX > 0|1|0|If_Statement|||||
044|Move|%ClipEndX%, %ClipY%, 0|1|10|Click|||||
045|[MsgBox]|Found the end of a clip %ClipEndX%!|1|0|MsgBox|0||||
46|[Else]|Else|1|0|If_Statement|||||
47|[Assign Variable]|ClipEndX := %A_ScreenWidth%|1|0|Variable|||||
48|[End If]|EndIf|1|0|If_Statement|||||
49|[Assign Variable]|ClipClickableX := %ClipX% + 20|1|0|Variable|Expression||||
50|[Assign Variable]|ClipClickableY := %ClipY% + 5|1|0|Variable|Expression||||
51|Continue, Continue, RetimeOpenedX, RetimeOpenedY, 0|%ClipX%, %ClipY%, %ClipEndX%, %ClipSearchEndY%, *1 images\retime-is-opened.png|1|0|ImageSearch||Window|||
52|If Image/Pixel Not Found||1|0|If_Statement|||||
053|[MsgBox]|If Retime is closed`, do the menu click|1|0|MsgBox|0||||
54|Right Move & Click|%ClipClickableX%, %ClipClickableY% Right, 1|1|10|Click|||||
055|[MsgBox]|Right Clicked on the selected Video Clip|1|0|MsgBox|0||||
56|[Assign Variable]|MenuTopRightX := %ClipClickableX%|1|0|Variable|||||
57|[Add Variable]|MenuTopRightX += 375|1|0|Variable|||||
58|[Pause]||1|300|Sleep|||||
59|Move, Continue, FoundX, FoundY, 1|%ClipClickableX%, 0, %MenuTopRightX%, %A_ScreenHeight%, images\retime-curve.png|1|0|ImageSearch||Window|||
60|If Image/Pixel Not Found||1|0|If_Statement|||||
61|[MsgBox]|Menu has not been opened. Clip is either too narrow or not fully visible. Move it fully inside the view or zoom a bit.|1|0|MsgBox|0||||
62|Return||1|0|Return|||||
63|[End If]|EndIf|1|0|If_Statement|||||
64|Left Click|Left, 1, |1|10|Click|||||
065|[MsgBox]|Clicked on Retime Curve %A_ScreenWidth% %A_ScreenHeight%|1|0|MsgBox|0||||
66|[Else]|Else|1|0|If_Statement|||||
067|[MsgBox]|FOUND THE EVENT ICON!|1|0|MsgBox|0||||
68|[End If]|EndIf|1|0|If_Statement|||||
69|[Pause]||1|200|Sleep|||||
70|Continue, Continue, RetimeSpeedX, RetimeSpeedY, 0|%ClipX%, %ClipSearchBeginY%, %ClipEndX%, %A_ScreenHeight%, images\retime-speed-dropdown-active-check.png|1|0|ImageSearch||Window|||
71|If Image/Pixel Found||1|0|If_Statement|||||
072|[MsgBox]|Retime Speed is already opened`, return|1|0|MsgBox|0||||
73|Return||1|0|Return|||||
74|[End If]|EndIf|1|0|If_Statement|||||
75|Continue, Continue, RetimeFrameX, RetimeFrameY, 1|%ClipX%, %ClipSearchBeginY%, %ClipEndX%, %ClipSearchEndY%, *1 images\retime-frame-dropdown.png|1|0|ImageSearch||Window|||
76|If Image/Pixel Found||1|0|If_Statement|||||
077|[MsgBox]|Found Retime Frame dropdown|1|0|MsgBox|0||||
78|PixelGetColor|RetimeFrameColor, RetimeFrameX, RetimeFrameY|1|0|PixelGetColor|||||
79|Left Move & Click|%RetimeFrameX%, %RetimeFrameY% Left, 1|1|10|Click|||||
80|Continue, Continue, FoundX, FoundY|%RetimeFrameX%, %RetimeFrameY%, %RetimeFrameX%, %RetimeFrameY%, %RetimeFrameColor%, 0, Fast RGB|60|50|PixelSearch|UntilNotFound|Window|||
81|[Pause]||1|100|Sleep|||||
82|[Add Variable]|RetimeFrameY += 15|1|0|Variable|||||
083|[MsgBox]|Finding and clicking on "Retime Speed" and "Retime Frame"...|1|0|MsgBox|0||||
84|Continue, Continue, DropdownBottomLeftX, DropdownBottomLeftY|%RetimeFrameX%, %RetimeFrameY%, %RetimeFrameX%, %A_ScreenHeight%, 0x090909, 0, Fast RGB|1|0|PixelSearch||Screen|||
85|If Image/Pixel Not Found||1|0|If_Statement|||||
86|[MsgBox]|Couldn't find the end of Dropdown Menu`, exiting.|1|0|MsgBox|0||||
87|Return||1|0|Return|||||
88|[End If]|EndIf|1|0|If_Statement|||||
089|Move|%DropdownBottomLeftX%, %DropdownBottomLeftY%, 0|1|10|Click|||||
090|[Pause]||1|4000|Sleep|||||
91|[Assign Variable]|DropdownTopRightX := DropdownBottomLeftX|1|0|Variable|Expression||||
92|[Add Variable]|DropdownTopRightX += 20|1|0|Variable|||||
93|[Assign Variable]|DropdownTopRightY := DropdownBottomLeftY|1|0|Variable|Expression||||
94|[Subtract Variable]|DropdownTopRightY -= 55|1|0|Variable|||||
095|Move|%DropdownTopRightX%, %DropdownTopRightY%, 0|1|10|Click|||||
096|[Pause]||1|1000|Sleep|||||
097|[MsgBox]|Finding max 2 checked items and unchecking them|1|0|MsgBox|0||||
98|[LoopStart]|LoopStart|2|0|Loop|||||
99|Continue, Continue, CheckedX, CheckedY, 1|%DropdownBottomLeftX%, %DropdownTopRightY%, %DropdownTopRightX%, %DropdownBottomLeftY%, *1 images\dropdown-checkbox.png|1|0|ImageSearch||Window|||
100|If Image/Pixel Found||1|0|If_Statement|||||
101|Left Move & Click|%CheckedX%, %CheckedY% Left, 1|1|10|Click|||||
102|[Pause]||1|100|Sleep|||||
103|[End If]|EndIf|1|0|If_Statement|||||
104|[LoopEnd]|LoopEnd|1|0|Loop|||||
105|[Pause]||1|200|Sleep|||||
106|[Assign Variable]|DropdownRetimeSpeedX := DropdownBottomLeftX|1|0|Variable|Expression||||
107|[Add Variable]|DropdownRetimeSpeedX += 4|1|0|Variable|||||
108|[Assign Variable]|DropdownRetimeSpeedY := DropdownBottomLeftY|1|0|Variable|Expression||||
109|[Subtract Variable]|DropdownRetimeSpeedY -= 35|1|0|Variable|||||
110|Left Move & Click|%DropdownRetimeSpeedX%, %DropdownRetimeSpeedY% Left, 1|1|10|Click|||||
111|[Pause]||1|200|Sleep|||||
112|[Add Variable]|DropdownRetimeSpeedX += 15|1|0|Variable|||||
113|Left Move & Click|%DropdownRetimeSpeedX%, %DropdownRetimeSpeedY% Left, 1|1|10|Click|||||
114|Move|%StartMouseX%, %StartMouseY%, 0|1|10|Click|||||
115|Return||1|0|Return|||||
116|[End If]|EndIf|1|0|If_Statement|||||
0117|[MsgBox]|No Retime Frame`, need to zoom in|1|0|MsgBox|0||||
118|Left Move & Click|%ClipX%, %TimelineCursorY% Left, 1|1|10|Click|||||
0119|[MsgBox]|Clicked on the timeline playhead near the clip to zoom in next|1|0|MsgBox|0||||
120|LControl Down|{LControl Down}|1|0|Send|||||
121|= Down|{= Down}|1|0|Send|||||
122|= Up|{= Up}|1|0|Send|||||
123|LControl Up|{LControl Up}|1|0|Send|||||
124|[Pause]||1|200|Sleep|||||
125|Compare Variables|ClickOnRetimeDropdownCount <= 5|1|0|If_Statement|||||
0126|[MsgBox]|Zoomed in`, trying again...|1|0|MsgBox|0||||
127|[Goto]|ClickOnRetimeDropdown|1|0|Goto|||||
128|[End If]|EndIf|1|0|If_Statement|||||
129|[MsgBox]|Unknown error`, probably couldn't find some elements.|1|0|MsgBox|0||||
[PMC Code v5.0.5]|||1|Window,2,Fast,0,1,Input,-1,-1,1|1|FindClipEnd()
Groups=Start:1
1|[FuncParameter]|ClipX|1|0|FuncParameter|||||
2|[FuncParameter]|ClipY|1|0|FuncParameter|||||
3|[FunctionStart]|FindClipEnd|1|0|UserFunction|Local| / |||
4|[Assign Variable]|ClipEndX := %ClipX% + 10|1|0|Variable|Expression||||
5|[Assign Variable]|ClipEndY := %ClipY% + 10|1|0|Variable|Expression||||
6|Continue, Continue, FoundX, FoundY|%ClipEndX%, %ClipEndY%, %A_ScreenWidth%, %ClipEndY%, 0xE64B3D, 0, Fast RGB|1|0|PixelSearch||Window|||
7|If Image/Pixel Found||1|0|If_Statement|||||
8|[FuncReturn]|FoundX|1|0|FuncReturn|||||
9|[End If]|EndIf|1|0|If_Statement|||||