├── requirements.txt ├── docs └── img │ ├── logo.jpg │ ├── logo.png │ └── logo_small.png ├── scripts ├── afterfx │ ├── package-lock.json │ ├── tsconfig.json │ ├── utils │ │ └── imgtobinary.py │ ├── package.json │ ├── script.ts │ └── afterfx_resources.md ├── cursor_recorder_standalone.py ├── cursor_recorder_for_obs.py └── Cursor Recorder for After Effects.jsx ├── .gitmodules ├── .gitignore ├── setup.py ├── README.md └── LICENSE /requirements.txt: -------------------------------------------------------------------------------- 1 | PyAutoGUI==0.9.38 2 | keyboard==0.13.2 3 | -------------------------------------------------------------------------------- /docs/img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakubKoralewski/cursor-recorder/HEAD/docs/img/logo.jpg -------------------------------------------------------------------------------- /docs/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakubKoralewski/cursor-recorder/HEAD/docs/img/logo.png -------------------------------------------------------------------------------- /docs/img/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JakubKoralewski/cursor-recorder/HEAD/docs/img/logo_small.png -------------------------------------------------------------------------------- /scripts/afterfx/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cursor-recorder-for-afterfx", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "scripts/afterfx/typings"] 2 | path = scripts/afterfx/typings 3 | url = https://github.com/JakubKoralewski/aftereffects.d.ts 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | test.py 2 | /.idea 3 | /.vscode 4 | /.vs 5 | /release 6 | *.egg-info 7 | __pycache__ 8 | ./cursor-recorder.json 9 | /.history 10 | *.txt 11 | node_modules 12 | scripts/ui.jsx 13 | cursor_recorder_for_afterfx.jsx 14 | .pytest* 15 | -------------------------------------------------------------------------------- /scripts/afterfx/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es3", 4 | "outFile": "../Cursor Recorder for After Effects.jsx", 5 | "removeComments": true 6 | }, 7 | "files": [ 8 | "script.ts" 9 | ], 10 | } -------------------------------------------------------------------------------- /scripts/afterfx/utils/imgtobinary.py: -------------------------------------------------------------------------------- 1 | # path_to_img 2 | 3 | import os 4 | from pathlib import Path 5 | 6 | scripts_path = Path(os.path.split(__file__)[0]) 7 | image_path = Path(scripts_path.parent.parent.parent / 'docs' / 'img' / 'logo_small.png') 8 | #print(image_path) 9 | 10 | bin_img = open(image_path, 'rb').read() 11 | out = open(Path(scripts_path / 'image.txt'), 'w+').write(bin_img.__str__()) -------------------------------------------------------------------------------- /scripts/afterfx/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cursor-recorder-for-afterfx", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "script.ts", 6 | "scripts": { 7 | "watch": "tsc -w", 8 | "build": "tsc && cd .. && sed -i '/\\$/d' 'Cursor Recorder for After Effects.jsx' && cat afterfx/license.txt > temp.jsx && cat 'Cursor Recorder for After Effects.jsx' >> temp.jsx && mv temp.jsx 'Cursor Recorder for After Effects.jsx'" 9 | }, 10 | "author": "Jakub Koralewski", 11 | "license": "MIT", 12 | "dependencies": {} 13 | } 14 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | with open("README.md", "r") as f: 4 | long_description = f.read() 5 | 6 | setup( 7 | name='cursor-recorder', 8 | version='0.2', 9 | description='Records cursor data', 10 | license='MIT', 11 | long_description=long_description, 12 | long_description_content_type='text/markdown', 13 | author='Jakub Koralewski', 14 | url='https://github.com/JakubKoralewski/cursor-recorder', 15 | packages=['cursor-recorder-for-afterfx'], #same as name 16 | install_requires=['PyAutoGUI', 'keyboard'], #external packages as dependencies 17 | classifiers=[ # Optional 18 | # How mature is this project? Common values are 19 | # 3 - Alpha 20 | # 4 - Beta 21 | # 5 - Production/Stable 22 | 'Development Status :: 3 - Alpha', 23 | 24 | # Pick your license as you wish 25 | 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL-2.0)', 26 | 27 | # Specify the Python versions you support here. In particular, ensure 28 | # that you indicate whether you support Python 2, Python 3 or both. 29 | # These classifiers are *not* checked by 'pip install'. See instead 30 | # 'python_requires' below. 31 | 'Programming Language :: Python :: 3', 32 | ], 33 | python_requires='>=3, <4', 34 | project_urls={ # Optional 35 | 'Bug Reports': 'https://github.com/JakubKoralewski/cursor-recorder/issues', 36 | 'Source': 'https://github.com/JakubKoralewski/cursor-recorder', 37 | }, 38 | ) -------------------------------------------------------------------------------- /scripts/cursor_recorder_standalone.py: -------------------------------------------------------------------------------- 1 | # OBSOLETE! Please use the OBS script. 2 | # This Source Code Form is subject to the terms of the Mozilla Public 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | # Copyright 2019 (c) Jakub Koralewski 6 | 7 | 8 | __version__ = "0.2" 9 | 10 | import json 11 | import os 12 | import sys 13 | import time 14 | IS37 = True 15 | 16 | try: 17 | time.time_ns() 18 | except AttributeError as e: 19 | IS37 = False 20 | 21 | import pyautogui 22 | import keyboard 23 | from typing import List, Tuple 24 | from enum import Enum 25 | 26 | class EXIT_TYPES(Enum): 27 | """ Should exit using Escape key or manually. """ 28 | KEYBOARD = 0 29 | SCRIPT = 1 30 | 31 | refreshAmount = 60 32 | 33 | EXIT_TYPE = EXIT_TYPES.SCRIPT 34 | # Set to True to exit main loop 35 | SHOULD_EXIT = False 36 | 37 | def exit_loop(): 38 | global SHOULD_EXIT 39 | SHOULD_EXIT = True 40 | 41 | full_path = os.path.join(os.path.split(__file__)[0], "cursor-recorder.txt") 42 | 43 | 44 | def startMenu(refreshAmount): 45 | file_exists = False 46 | 47 | if os.path.isfile(full_path): 48 | file_exists = True 49 | print(f'This file will be overwritten if you proceed: {full_path}') 50 | print( 51 | "The cursor position will be fetched {} time{} a second.".format( 52 | refreshAmount, "" if refreshAmount == 1 else "s" 53 | ) 54 | ) 55 | input("ENTER to start recording.") 56 | os.system("cls") 57 | if file_exists: 58 | os.remove(full_path) 59 | print("Removed file.") 60 | print("RECORDING! Press ESC to stop.") 61 | print("Consider setting cursor in TOP-LEFT corner.") 62 | 63 | def should_exit() -> bool: 64 | if EXIT_TYPE == EXIT_TYPES.KEYBOARD: 65 | if keyboard.is_pressed("esc"): 66 | return True 67 | elif EXIT_TYPE == EXIT_TYPES.SCRIPT: 68 | if should_exit == True: 69 | return True 70 | return False 71 | 72 | def save_to_file(seconds, x, y): 73 | 74 | with open(full_path, "a+") as file: 75 | file.write(f'{seconds} {x} {y}\n') 76 | 77 | print(seconds, x, y, flush=True, end='\r') 78 | 79 | 80 | def main(path = None, name = None): 81 | global refreshAmount 82 | refresh_rate: float = 1 / refreshAmount 83 | taim: int = 0 84 | skipping: bool = False 85 | 86 | # Cursor positions 87 | x: int 88 | y: int 89 | prev_x: int = -1 90 | prev_y: int = -1 91 | 92 | startTaim: int = time.time_ns() if IS37 else time.time() 93 | 94 | while True: 95 | time.sleep(refresh_rate) 96 | if IS37: 97 | taim = (time.time_ns() - startTaim) / (10 ** 9) 98 | else: 99 | taim = time.time() - startTaim 100 | 101 | # Get cursor position 102 | 103 | x, y = pyautogui.position() 104 | 105 | # If previous position same as current 106 | # no need to add same data 107 | if prev_x == x and prev_y == y: 108 | skipping = True 109 | 110 | if should_exit(): 111 | break 112 | continue 113 | else: 114 | if skipping == True: 115 | # If previously was skipping 116 | # create a keyframe that will stop sliding 117 | save_to_file(round(taim - refresh_rate, 3), prev_x, prev_y) 118 | 119 | if should_exit(): 120 | break 121 | 122 | skipping = False 123 | 124 | prev_x: int = x 125 | prev_y: int = y 126 | 127 | save_to_file(taim, x, y) 128 | 129 | if should_exit(): 130 | break 131 | 132 | print(f"File saved in {full_path}") 133 | print(f"Duration of recording: {taim}") 134 | 135 | if __name__ == "__main__": 136 | # If called directly ( not imported ) 137 | # then exit from loop using Escape Key 138 | EXIT_TYPE = EXIT_TYPES.KEYBOARD 139 | 140 | # Display start screen 141 | startMenu(refreshAmount) 142 | main() 143 | 144 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cursor-recorder :clapper: + :movie_camera: + :computer: + :mouse: = :sparkler: 2 | 3 | 4 | 5 | Records mouse movement to a file and opens it in After Effects. Use with [OBS Studio](https://github.com/obsproject/obs-studio) as an [external Python script][cursor_recorder_for_obs] or if you prefer a more manual approach, using the [standalone Python script][cursor_recorder_standalone]. Then use the [After Effects script][cursor_recorder_for_afterfx] to import the generated cursor movement data. 6 | 7 | ## How to use 8 | 9 | ### With OBS 10 | 11 | 0. Download the files: 12 | 1. cursor_recorder_for_obs.py 13 | 1. from [obsproject.com](https://obsproject.com/forum/resources/obs-cursor-recorder.789/) 14 | 2. or [this repository](https://raw.githubusercontent.com/JakubKoralewski/cursor-recorder/master/scripts/cursor_recorder_for_obs.py). 15 | 2. Cursor Recorder for After Effects.jsx 16 | 1. from [this repository](https://github.com/JakubKoralewski/cursor-recorder/blob/master/scripts/Cursor%20Recorder%20for%20After%20Effects.jsx) 17 | 18 | 1. #### Import the [cursor_recorder_for_obs.py][cursor_recorder_for_obs] in OBS. (You need to do this just once). 19 | 1. Go to `Tools -> Scripts`. 20 | 2. Make sure you have a Python (3.6.x) interpreter installed and its path set in OBS' settings (`Scripts -> Python Settings`). 21 | 3. Click the :heavy_plus_sign: icon (Add Scripts) and select the [cursor_recorder_for_obs.py][cursor_recorder_for_obs]. 22 | 4. Make sure the script is enabled. (It is by default). 23 | 5. Click `Install Python modules` if you don't have `pyautogui` and/or `keyboard` packages installed. 24 | 25 | 2. You're ready to start recording. The *.txt will be saved in the same place as your video with the same name. 26 | 3. Stop the recording. 27 | 4. #### Import the [Cursor Recorder for After Effects.jsx][cursor_recorder_for_afterfx] in After Effects. (You need to do this just once). 28 | 1. Go to the folder you installed After Effects. 29 | 2. To be exact, go here (e.g.:`Adobe After Effects CC 2019`)`\Support Files\Scripts\ScriptUI Panels`. 30 | 3. Place the [Cursor Recorder for After Effects.jsx][cursor_recorder_for_afterfx] file in the `ScriptUI Panels` folder. 31 | 32 | 5. #### Run the [Cursor Recorder for After Effects.jsx][cursor_recorder_for_afterfx] script. 33 | 1. Open After Effects. 34 | 2. Go to `Window -> ` scroll down to the `Cursor Recorder for After Effects.jsx` script and click it. 35 | 3. Click the help buttons for more info. 36 | 37 | 6. Checkout the `Add Expressions` section in the `Cursor Recorder for After Effects` script to quickly add predefined effects. 38 | 7. Do whatever you want with it from here. Check out the [**Examples**](#examples-with-after-effects-expressions) section below! 39 | 40 | ### Standalone 41 | 1. Use the [cursor_recorder_standalone.py][cursor_recorder_standalone]. 42 | 2. Specify `refresh_rate` variable inside the code for your needs. 43 | 3. File with the cursor movement should get saved to the same directory as your script. 44 | 4. [Import to After Effects.](#run-the-cursor_recorder_for_afterfxjsx-script) 45 | 46 | [cursor_recorder_for_obs]: ./scripts/cursor_recorder_for_obs.py 47 | [cursor_recorder_for_afterfx]: ./scripts/Cursor%20Recorder%20for%20After%20Effects.jsx 48 | [cursor_recorder_standalone]: ./scripts/cursor_recorder_standalone.py 49 | 50 | ## Examples (with After Effects expressions): 51 | 52 | ### SMOOTH FOLLOW (that's from the demo) 53 | 54 | ```javascript 55 | thisLayerScale = transform.scale; 56 | cursorX = thisComp.layer("cursor-recorder-movement").transform.position[0]; 57 | cursorY = thisComp.layer("cursor-recorder-movement").transform.position[1]; 58 | xvalue = linear(thisLayerScale[0], 100, 200, cursorX + 960, 1920); 59 | yvalue = linear(thisLayerScale[0], 100, 200, cursorY + 540, 1080); 60 | [xvalue - cursorX, yvalue - cursorY]; 61 | ``` 62 | 63 | ### CURSOR IN CENTER 64 | 65 | ```javascript 66 | // Expression set on video's anchor point 67 | thisComp.layer("cursor-recorder-movement").transform.position; 68 | ``` 69 | 70 | ## Weird things you can do with this 71 | *The images are links to streamable.com* 72 | 73 | ### You can do [this][vortex-thing-video]: 74 | 75 | [][vortex-thing-video] 76 | 77 | [vortex-thing-video]: https://streamable.com/ceebw 78 | 79 | ### [This][ideas-video] can give you some ideas: 80 | 81 | [][ideas-video] 82 | 83 | [ideas-video]: https://streamable.com/zk1yi 84 | 85 | ### [This][overkill-video] may seem like an overkill but I'm supposed to advertise a product so here you go: 86 | 87 | [][overkill-video] 88 | 89 | [overkill-video]: https://streamable.com/rvdxr 90 | 91 | BTW this is from [this browser extension](https://github.com/JakubKoralewski/google-calendar-box-select) of mine (I'm really selling out right now) 92 | 93 | ## Development 94 | 95 | I encourage you to fork, open issues and pull requests! :heart: 96 | 97 | ### After Effects script 98 | 99 | The script is developed using TypeScript. There are following commands available: 100 | ``` 101 | "scripts": { 102 | "watch": "tsc -w", 103 | "build": "tsc && cd .. && sed -i '/\\$/d' 'Cursor Recorder for After Effects.jsx' && cat afterfx/license.txt > temp.jsx && cat 'Cursor Recorder for After Effects.jsx' >> temp.jsx && mv temp.jsx 'Cursor Recorder for After Effects.jsx'" 104 | }, 105 | ``` 106 | 107 | Your current directory being `scripts\afterfx`: 108 | 109 | Run `npm run watch` for auto-reload. 110 | The file will get saved to `scripts\Cursor Recorder for After Effects.jsx`. 111 | Copy it to the ExtendScript Toolkit and run it or copy the whole file to the `ScriptUI Panels` in your After Effects installation. 112 | 113 | Run `npm run build` to have a production friendly version. 114 | The `"build"` script compiles the TypeScript file, removes comments and adds a copyright notice. 115 | 116 | ### Python script 117 | 118 | Currently OBS supports only 3.6.x Python interpreters! 119 | 120 | #### Debugging 121 | 122 | You can debug the Python script inside PyCharm following the instructions 123 | for "Python Remote Debug" as shown below: 124 | 125 | ![](https://i.imgur.com/tf3DqOQ.png) 126 | 127 | #### You need these packages 128 | 129 | The script requires: `pyautogui` and `keyboard`. Install them yourself or using this command: 130 | 131 | ```sh 132 | $ pip install -r requirements.txt 133 | ``` 134 | 135 | #### Take a look at these resources: 136 | 137 | - [Official OBS Scripting Documentation](https://obsproject.com/docs/scripting.html) 138 | - [a raw print out of all variables, properties and methods](https://gist.github.com/JakubKoralewski/4ea2a668364134f3689864f867143a0b) 139 | 140 | # License 141 | [Mozilla Public License Version 2.0](LICENSE) 142 | -------------------------------------------------------------------------------- /scripts/cursor_recorder_for_obs.py: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # Copyright 2019 (c) Jakub Koralewski 5 | 6 | import obspython as obs 7 | import datetime 8 | import os 9 | from subprocess import Popen, PIPE 10 | from typing import List 11 | import time 12 | import threading 13 | 14 | import logging 15 | import sys 16 | 17 | file_handler = logging.FileHandler(filename='obs_cursor_recorder.log') 18 | stdout_handler = logging.StreamHandler(sys.stdout) 19 | handlers = [file_handler, stdout_handler] 20 | logging.basicConfig( 21 | level=logging.DEBUG, 22 | format='[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s', 23 | handlers=handlers 24 | ) 25 | logger = logging.getLogger('obs_cursor_recorder_logger') 26 | 27 | p = sys.platform 28 | py_executable = "python.exe" 29 | if p == "linux" or p == "linux2": 30 | py_executable = "python3.6" 31 | elif p == "win32" or p == "win64": 32 | py_executable = "python.exe" 33 | else: 34 | logging.error(f"Unsupported platform: {p}\nWindows or Linux.") 35 | del p 36 | 37 | import_succeeded = False 38 | cached_settings = {} 39 | properties = {} 40 | is_being_recorded = False 41 | 42 | 43 | def now(): 44 | return datetime.datetime.now().time() 45 | 46 | 47 | logger.info(f"{now()}: refresh") 48 | py_dir = os.__file__.split("lib")[0] 49 | py_interpreter = os.path.join(py_dir, py_executable) 50 | logger.info(f'py_interpreter: {py_interpreter}') 51 | 52 | output = obs.obs_frontend_get_recording_output() 53 | 54 | SHOULD_EXIT = False 55 | 56 | name = 'obs_cursor_recorder.txt' 57 | path = 'C:/Users/Admin/Documents' 58 | 59 | 60 | def install_pip_then_multiple(packages): 61 | logger.info('Import pip then multiple modules.') 62 | assert (os.path.isdir(py_dir)) 63 | 64 | """ 65 | :param name - name of action you are doing, for logging 66 | """ 67 | def install(c: List, name: str = ""): 68 | logger.info(name) 69 | p = Popen( 70 | ' '.join(c), 71 | stdout=PIPE, 72 | stderr=PIPE, 73 | stdin=PIPE, 74 | executable=py_interpreter, 75 | cwd=py_dir[:-1] 76 | ) 77 | print(p.args) 78 | out, err = p.communicate() 79 | if len(err) != 0: 80 | logging.error(f"{name} Error:\n {err}") 81 | logging.info(f"{name} Output:\n {out}") 82 | 83 | cmd_line_update = [ 84 | py_executable, '-m', 'pip', 'install', '--upgrade', 'pip', '--user' 85 | ] 86 | 87 | cmd_line_install = [ 88 | py_executable, '-m', 'pip', 'install' 89 | ] + packages 90 | 91 | logger.debug(f'Python interpreter location: {py_interpreter}') 92 | logger.debug(f'Python interpreter location directory: {py_dir}') 93 | install(cmd_line_update, "Upgrading your pip version: ") 94 | install(cmd_line_install, "Installing packages: ") 95 | 96 | 97 | def install_modules_button_click(): 98 | install_pip_then_multiple(['pyautogui', 'keyboard']) 99 | 100 | 101 | try: 102 | import pyautogui 103 | import keyboard 104 | except ModuleNotFoundError: 105 | logger.error("PyAutoGui and or keyboard are not installed.\n\ 106 | I'm installing them for you if you don't mind.\n") 107 | install_pip_then_multiple(['pyautogui', 'keyboard']) 108 | import pyautogui 109 | import keyboard 110 | 111 | 112 | def save_to_file(seconds, x, y): 113 | full_path = os.path.join(path, name) if path and name else "cursor-recorder.txt" 114 | logger.info(f'Saving file to {full_path}') 115 | 116 | with open(full_path, "a+") as file: 117 | file.write(f'{seconds} {x} {y}\n') 118 | 119 | x = -1 120 | y = -1 121 | prev_x = -1 122 | prev_y = -1 123 | seconds = 0 124 | skipping = False 125 | 126 | 127 | def script_tick(time_passed): 128 | if not is_being_recorded or not cached_settings["use_default_fps"]: 129 | return 130 | 131 | global x 132 | global y 133 | global prev_x 134 | global prev_y 135 | global seconds 136 | global skipping 137 | 138 | seconds += time_passed 139 | 140 | # Get cursor position 141 | x, y = pyautogui.position() 142 | 143 | # If previous position same as current 144 | # no need to add same data 145 | if prev_x == x and prev_y == y: 146 | skipping = True 147 | return 148 | else: 149 | if skipping: 150 | # If previously was skipping 151 | # create a keyframe that will stop sliding 152 | save_to_file(seconds - time_passed, prev_x, prev_y) 153 | 154 | skipping = False 155 | 156 | prev_x = x 157 | prev_y = y 158 | 159 | save_to_file(seconds, x, y) 160 | 161 | 162 | def should_exit(): 163 | if SHOULD_EXIT: 164 | logger.info('should exit!') 165 | return True 166 | return False 167 | 168 | 169 | def cursor_recorder(): 170 | refresh_rate = 1 / cached_settings["custom_fps"] 171 | 172 | x = -1 173 | y = -1 174 | prev_x = -1 175 | prev_y = -1 176 | skipping = False 177 | 178 | startTaim: float = time.time() 179 | 180 | while True: 181 | time.sleep(refresh_rate) 182 | taim = time.time() - startTaim 183 | 184 | # Get cursor position 185 | x, y = pyautogui.position() 186 | 187 | # If previous position same as current 188 | # no need to add same data 189 | if prev_x == x and prev_y == y: 190 | skipping = True 191 | 192 | if should_exit(): 193 | break 194 | continue 195 | else: 196 | if skipping: 197 | # If previously was skipping 198 | # create a keyframe that will stop sliding 199 | save_to_file(round(taim - refresh_rate, 3), prev_x, prev_y) 200 | 201 | if should_exit(): 202 | break 203 | 204 | skipping = False 205 | 206 | prev_x: int = x 207 | prev_y: int = y 208 | 209 | save_to_file(taim, x, y) 210 | 211 | if should_exit(): 212 | break 213 | 214 | 215 | """ Registering callbacks: 216 | Docs: 217 | - https://obsproject.com/docs/reference-outputs.html#output-signal-handler-reference 218 | - https://obsproject.com/docs/frontends.html#signals 219 | """ 220 | 221 | 222 | def recording_start_handler(_): 223 | global is_being_recorded 224 | global path 225 | global name 226 | is_being_recorded = True 227 | 228 | logger.info(f'recording started ({now()})') 229 | output_settings = obs.obs_output_get_settings(output) 230 | logger.debug(obs.obs_data_get_json(output_settings)) 231 | 232 | """ Example path: "C:/Users/Admin/Documents/2019-04-04 16-02-28.flv" 233 | After `os.path.split(path)`: ('C:/Users/Admin/Documents', '2019-04-04 16-02-28.flv')""" 234 | raw_path = obs.obs_data_get_string(output_settings, "path") 235 | print(f"Raw path: '{raw_path}'") 236 | if raw_path == "": 237 | logging.info('Path is empty when starting recording, trying to use "url" if you\'re using FFmpeg!') 238 | raw_path = obs.obs_data_get_string(output_settings, "url") 239 | print(f"Raw path: '{raw_path}'") 240 | if raw_path == "": 241 | logging.error('Switched to "url" when "path" was not working, but still didn\'t get anything!') 242 | 243 | video_path_tuple = os.path.split(raw_path) 244 | video_name = video_path_tuple[-1] 245 | 246 | path = video_path_tuple[0] 247 | # Convert extension to txt from .flv 248 | name = os.path.splitext(video_name)[0] + '.txt' 249 | 250 | if not cached_settings["use_default_fps"]: 251 | global SHOULD_EXIT 252 | SHOULD_EXIT = False 253 | logger.info('Starting recording using custom FPS settings.') 254 | threading.Thread(target=cursor_recorder).start() 255 | 256 | 257 | def recording_stopped_handler(_): 258 | global is_being_recorded 259 | global SHOULD_EXIT 260 | SHOULD_EXIT = True 261 | is_being_recorded = False 262 | logger.info(f'recording stopped ({now()})') 263 | 264 | 265 | def script_description(): 266 | logger.debug('script_description') 267 | return '

OBS Cursor Recorder

Lets you save your cursor movement to a file.' \ 268 | '

©2019 Jakub Koralewski. ' \ 269 | 'Open-source on GitHub.
' 272 | 273 | 274 | def script_properties(): 275 | logger.debug('script_properties') 276 | props = obs.obs_properties_create() 277 | enabled = obs.obs_properties_add_bool(props, "enabled", "Enabled") 278 | obs.obs_property_set_long_description(enabled, "Whether to save the file when recording or not.") 279 | 280 | long_default_fps_description = "Use this option to achieve higher accuracy than every video frame." 281 | 282 | default_fps = obs.obs_properties_add_bool(props, "use_default_fps", "Use video's FPS to capture cursor") 283 | obs.obs_property_set_long_description(default_fps, long_default_fps_description) 284 | 285 | custom_fps = obs.obs_properties_add_int_slider(props, "custom_fps", "Custom FPS", 1, 200, 1) 286 | obs.obs_property_set_long_description(custom_fps, long_default_fps_description) 287 | 288 | install_modules = obs.obs_properties_add_button( 289 | props, 290 | "install_modules", 291 | "Install Python modules", 292 | install_modules_button_click 293 | ) 294 | 295 | obs.obs_property_set_long_description( 296 | install_modules, 297 | "Installs pip, pyautogui and keyboard Python modules in your specified Python interpreter." 298 | ) 299 | 300 | return props 301 | 302 | 303 | def script_save(settings): 304 | logger.debug('script_save') 305 | script_update(settings) 306 | 307 | 308 | def script_update(settings): 309 | logger.debug('script_update') 310 | 311 | cached_settings["use_default_fps"] = obs.obs_data_get_bool(settings, "use_default_fps") 312 | cached_settings["custom_fps"] = obs.obs_data_get_int(settings, "custom_fps") 313 | cached_settings["enabled"] = obs.obs_data_get_bool(settings, "enabled") 314 | 315 | if cached_settings["enabled"]: 316 | logger.info('Registering start and stop handlers.') 317 | signal_handler = obs.obs_output_get_signal_handler(output) 318 | try: 319 | obs.signal_handler_connect(signal_handler, 'start', recording_start_handler) 320 | obs.signal_handler_connect(signal_handler, 'stop', recording_stopped_handler) 321 | except RuntimeError as e: 322 | logger.critical(f'Disregarding error when connecting start and stop handlers: {e}') 323 | else: 324 | logger.info('Disconnecting start and stop handlers.') 325 | signal_handler = obs.obs_output_get_signal_handler(output) 326 | obs.signal_handler_disconnect(signal_handler, 'start', recording_start_handler) 327 | if not is_being_recorded: 328 | obs.signal_handler_disconnect(signal_handler, 'stop', recording_stopped_handler) 329 | 330 | logger.debug(f'cached_settings: {cached_settings}') 331 | 332 | 333 | def script_defaults(settings): 334 | logger.debug('script_defaults') 335 | obs.obs_data_set_default_bool(settings, "enabled", True) 336 | obs.obs_data_set_default_bool(settings, "use_default_fps", True) 337 | obs.obs_data_set_default_int(settings, "custom_fps", 30) 338 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | -------------------------------------------------------------------------------- /scripts/Cursor Recorder for After Effects.jsx: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at https://mozilla.org/MPL/2.0/. 4 | * All comments and write lines are removed from this file */ 5 | 6 | var helpFromTwoText = "You need to select an even amount of items in your project panel.\nEach pair must consist of a data (.txt) file and a video file. The names of the video and data files (disregarding the extension) have to be the same!\nThey will be unless you changed them.\n\n1. Select the video, data pairs in the project panel.\n2. Click this button.\n3. Your composition(s) will be created."; 7 | var helpFromFileText = "This will ask you to select a file from your drive.\nCompared to the 'From Two' button above, you do not have to import the .txt file in your project.\n\n1. Have a composition open.\n2. Click this button.\n3. Select a .txt file.\n4. You have a null."; 8 | var helpTipHelpTip = 'Get more info.'; 9 | var repositoryLink = 'https://github.com/JakubKoralewski/cursor-recorder'; 10 | var about = "`Cursor Recorder for After Effects` is only a part of the `cursor-recorder` project.\nThe other half is the script - `Cursor Recroder for OBS` that lets you exactly time the start and stop of the cursor recording by getting the cursor data only when you record in OBS Studio.\n\nThe project is open-source on Github at " + repositoryLink + "."; 11 | var copyrightHelpTip = "Mozilla Public License 2.0 \nIf a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/"; 12 | var FILE; 13 | (function (FILE) { 14 | FILE[FILE["TXT"] = 0] = "TXT"; 15 | FILE[FILE["VIDEO"] = 1] = "VIDEO"; 16 | })(FILE || (FILE = {})); 17 | var PROPERTIES; 18 | (function (PROPERTIES) { 19 | PROPERTIES["ANCHOR_POINT"] = "anchorPoint"; 20 | PROPERTIES["POSITION"] = "position"; 21 | PROPERTIES["X_POSITION"] = "xPosition"; 22 | PROPERTIES["Y_POSITION"] = "yPosition"; 23 | PROPERTIES["Z_POSITION"] = "zPosition"; 24 | PROPERTIES["SCALE"] = "scale"; 25 | PROPERTIES["ORIENTATION"] = "orientation"; 26 | PROPERTIES["ROTATION"] = "rotation"; 27 | PROPERTIES["X_ROTATION"] = "xRotation"; 28 | PROPERTIES["Y_ROTATION"] = "yRotation"; 29 | PROPERTIES["Z_ROTATION"] = "zRotation"; 30 | PROPERTIES["OPACITY"] = "opacity"; 31 | })(PROPERTIES || (PROPERTIES = {})); 32 | ; 33 | var EXPRESSIONS = [ 34 | { 35 | name: "Cursor always in center", 36 | expressions: { 37 | video: [{ 38 | property: PROPERTIES.ANCHOR_POINT, 39 | expression: function (nullName) { 40 | return "thisComp.layer(\"" + nullName + "\").transform.position;"; 41 | } 42 | }] 43 | } 44 | }, 45 | { 46 | name: "Smooth Follow", 47 | optional_args: [ 48 | { 49 | title: "Multiplier", 50 | id: "multiplier", 51 | "default": 2 52 | } 53 | ], 54 | expressions: { 55 | video: [{ 56 | property: PROPERTIES.POSITION, 57 | expression: function (nullName, opts) { 58 | var width = opts.width || 1920; 59 | var height = opts.height || 1080; 60 | var multiplier = parseFloat(opts.multiplier.text) || 2; 61 | var multiplier100 = 100 * multiplier; 62 | return "thisLayerScale = transform.scale;\ncursorX = thisComp.layer(\"" + nullName + "\").transform.position[0];\ncursorY = thisComp.layer(\"" + nullName + "\").transform.position[1];\nxvalue = linear(thisLayerScale[0], 100, " + multiplier100 + ", cursorX + " + width / multiplier + ", " + width + ");\nyvalue = linear(thisLayerScale[0], 100, " + multiplier100 + ", cursorY + " + height / multiplier + ", " + height + ");\n[xvalue - cursorX, yvalue - cursorY];"; 63 | } 64 | }, 65 | { 66 | property: PROPERTIES.SCALE, 67 | expression: function (_nullName, opts) { 68 | var multiplier = parseFloat(opts.multiplier.text) || 2; 69 | var multiplier100 = 100 * multiplier; 70 | return [multiplier100, multiplier100]; 71 | } 72 | }] 73 | } 74 | } 75 | ]; 76 | var currentOptionalArgs = []; 77 | { 78 | function cursorRecorderPanel(thisObj) { 79 | function buildUI(thisObj) { 80 | var myPanel = thisObj instanceof Panel 81 | ? thisObj 82 | : new Window("palette", "Cursor Recorder For After Effects", undefined, { 83 | resizeable: true, 84 | closeButton: true 85 | }); 86 | myPanel.alignment = ['center', 'center']; 87 | myPanel.alignChildren = 'center'; 88 | myPanel.preferredSize = [400, 200]; 89 | myPanel.helpTip = about; 90 | var pCreateNull = myPanel.add("panel", undefined, "Create Null"); 91 | pCreateNull.orientation = 'column'; 92 | pCreateNull.alignment = 'center'; 93 | var gfromTwo = pCreateNull.add("group", undefined, { name: "fromTwo" }); 94 | gfromTwo.orientation = 'row'; 95 | var fromTwoButton = gfromTwo.add("button", undefined, "Create Comp from video and data", { name: "fromTwo" }); 96 | fromTwoButton.alignment = 'fill'; 97 | var helpFromTwo = gfromTwo.add("button", undefined, "?", { name: "helpFromTwo" }); 98 | helpFromTwo.helpTip = helpTipHelpTip; 99 | helpFromTwo.alignment = "right"; 100 | helpFromTwo.maximumSize = [30, 20]; 101 | fromTwoButton.onClick = function () { 102 | fromTwoButtonClicked(); 103 | }; 104 | helpFromTwo.onClick = function () { 105 | displayHelp('How to use the From Two import', helpFromTwoText); 106 | }; 107 | var gfromFile = pCreateNull.add("group", undefined, { name: "fromFile" }); 108 | gfromFile.orientation = 'row'; 109 | var fromFileButton = gfromFile.add("button", undefined, "Import .txt file from file", { name: "fromFile" }); 110 | fromFileButton.alignment = 'fill'; 111 | var helpFromFile = gfromFile.add("button", undefined, "?", { name: "helpFromFile" }); 112 | helpFromFile.alignment = "right"; 113 | helpFromFile.maximumSize = [30, 20]; 114 | helpFromFile.helpTip = helpTipHelpTip; 115 | fromFileButton.onClick = fromFileButtonClicked; 116 | helpFromFile.onClick = function () { 117 | displayHelp('How to use the From File import', helpFromFileText); 118 | }; 119 | var pExpressions = myPanel.add("panel", undefined, "Add Expressions"); 120 | pExpressions.orientation = 'column'; 121 | pExpressions.alignment = 'fill'; 122 | var gTVWithOptArgs = pExpressions.add("group"); 123 | gTVWithOptArgs.orientation = 'column'; 124 | gTVWithOptArgs.alignment = 'fill'; 125 | var tvExpressions = gTVWithOptArgs.add("treeview", undefined, undefined, { name: "Expression List" }); 126 | tvExpressions.alignment = 'fill'; 127 | var createdExpressions = []; 128 | for (var i = 0; i < EXPRESSIONS.length; i++) { 129 | var createdExpression = tvExpressions.add("item", EXPRESSIONS[i].name, i); 130 | createdExpression.onActivate = function () { 131 | alert("expression activated"); 132 | }; 133 | createdExpressions.push(createdExpression); 134 | } 135 | tvExpressions.onChange = function () { 136 | var opt_args = EXPRESSIONS[tvExpressions.selection.index].optional_args; 137 | if (opt_args) { 138 | for (var _i = 0, opt_args_1 = opt_args; _i < opt_args_1.length; _i++) { 139 | var arg = opt_args_1[_i]; 140 | var newOptionalArg = gTVWithOptArgs.add("edittext", undefined, arg["default"], { name: arg.title }); 141 | newOptionalArg.preferredSize = [80, 20]; 142 | newOptionalArg.justify = 'center'; 143 | newOptionalArg.helpTip = arg.title; 144 | currentOptionalArgs.push({ name: arg.id, element: newOptionalArg }); 145 | } 146 | myPanel.layout.layout(true); 147 | } 148 | else { 149 | if (currentOptionalArgs) { 150 | for (var _a = 0, currentOptionalArgs_1 = currentOptionalArgs; _a < currentOptionalArgs_1.length; _a++) { 151 | var arg = currentOptionalArgs_1[_a]; 152 | gTVWithOptArgs.remove(arg.element); 153 | } 154 | currentOptionalArgs = []; 155 | } 156 | myPanel.layout.layout(true); 157 | } 158 | }; 159 | var addExpressionButton = pExpressions.add("button", undefined, "Add Expression"); 160 | addExpressionButton.onClick = function () { 161 | var selectedExpression = tvExpressions.selection; 162 | addExpression(selectedExpression.index, currentOptionalArgs ? currentOptionalArgs : null); 163 | }; 164 | var copyright = myPanel.add("edittext", undefined, "Copyright MPL-2.0 (c) 2019 by Jakub Koralewski"); 165 | copyright.helpTip = about + '\n\n' + copyrightHelpTip; 166 | var link = myPanel.add("button", undefined, repositoryLink); 167 | link.onClick = function () { 168 | openURL(repositoryLink); 169 | }; 170 | myPanel.onResizing = myPanel.onResize = myPanel.onShow = function () { 171 | this.layout.resize(); 172 | }; 173 | myPanel.layout.layout(true); 174 | return myPanel; 175 | } 176 | var UI = buildUI(thisObj); 177 | if (UI != null && UI instanceof Window) { 178 | UI.center(); 179 | UI.show(); 180 | } 181 | } 182 | cursorRecorderPanel(this); 183 | } 184 | function openURL(address) { 185 | try { 186 | var URL = new File("cursor-recorder-shortcut.html"); 187 | URL.open("w"); 188 | URL.writeln(''); 189 | URL.close(); 190 | URL.execute(); 191 | } 192 | catch (err) { 193 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 194 | } 195 | } 196 | function addExpression(selectedExpressionNumber, currentOptionalArgs) { 197 | try { 198 | var activeComp = getActiveComp(); 199 | var selectedExpression = EXPRESSIONS[selectedExpressionNumber]; 200 | var neededFiles = []; 201 | if (selectedExpression.expressions["null"]) { 202 | neededFiles.push(FILE.TXT); 203 | } 204 | if (selectedExpression.expressions.video) { 205 | neededFiles.push(FILE.VIDEO); 206 | } 207 | var null_layer = void 0; 208 | var video_layers = []; 209 | for (var i = 1, len = activeComp.numLayers; i <= len; i++) { 210 | var layer = activeComp.layers[i]; 211 | if (layer.nullLayer) { 212 | null_layer = layer; 213 | } 214 | else { 215 | if (layer.hasVideo) { 216 | video_layers.push(layer); 217 | } 218 | } 219 | } 220 | if (neededFiles.indexOf(FILE.VIDEO) !== -1) { 221 | if (video_layers.length === 0) { 222 | alert("Video not found in this composition!"); 223 | } 224 | var video_layer = void 0; 225 | var foundSameName = false; 226 | for (var _i = 0, video_layers_1 = video_layers; _i < video_layers_1.length; _i++) { 227 | var layer = video_layers_1[_i]; 228 | if (getStringWithoutExtension(layer.name) === getStringWithoutExtension(null_layer.name)) { 229 | foundSameName = true; 230 | video_layer = layer; 231 | break; 232 | } 233 | } 234 | if (!foundSameName) { 235 | video_layer = video_layers[0]; 236 | } 237 | var optionalArgs = { width: video_layer.width, height: video_layer.height }; 238 | for (var _a = 0, currentOptionalArgs_2 = currentOptionalArgs; _a < currentOptionalArgs_2.length; _a++) { 239 | var optArg = currentOptionalArgs_2[_a]; 240 | optionalArgs[optArg.name] = optArg.element; 241 | } 242 | for (var _b = 0, _c = selectedExpression.expressions.video; _b < _c.length; _b++) { 243 | var expression = _c[_b]; 244 | var expressionResult = expression.expression(null_layer.name, optionalArgs); 245 | setExpression(video_layer, expression.property, expressionResult); 246 | } 247 | } 248 | if (neededFiles.indexOf(FILE.TXT) !== -1) { 249 | for (var _d = 0, _e = selectedExpression.expressions["null"]; _d < _e.length; _d++) { 250 | var expression = _e[_d]; 251 | setExpression(null_layer, expression.property, expression.expression(null_layer.name)); 252 | } 253 | } 254 | } 255 | catch (err) { 256 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 257 | } 258 | } 259 | function setExpression(layer, property, expressionResult) { 260 | if (typeof expressionResult == "string") { 261 | layer.transform[property].expression = expressionResult; 262 | } 263 | else { 264 | layer.transform[property].setValue(expressionResult); 265 | } 266 | } 267 | function displayHelp(title, helpText) { 268 | alert(helpText, title); 269 | } 270 | function fromTwoButtonClicked() { 271 | try { 272 | var selection = app.project.selection; 273 | if (selection.length == 0) { 274 | alert("You must select something first!"); 275 | return; 276 | } 277 | else if (selection.length % 2 !== 0) { 278 | alert("You did not select an even number of elements!"); 279 | return; 280 | } 281 | var cursorRecorderDataFileFound = false; 282 | var fileMappings = {}; 283 | for (var i = 0, len = selection.length; i < len; i++) { 284 | if (!(selection[i] instanceof FootageItem)) { 285 | alert(getName(selection[i]).concat(" is not a valid file. Please select a video and a text file.")); 286 | return; 287 | } 288 | var withoutExtension = getStringWithoutExtension(selection[i].file.name); 289 | if (!(withoutExtension in fileMappings)) { 290 | fileMappings[withoutExtension] = { txt: null, video: null }; 291 | } 292 | if (selection[i].file.name.endsWith('txt')) { 293 | cursorRecorderDataFileFound = true; 294 | fileMappings[withoutExtension].txt = selection[i]; 295 | } 296 | else { 297 | fileMappings[withoutExtension].video = selection[i]; 298 | } 299 | selection[i].selected = false; 300 | } 301 | if (!cursorRecorderDataFileFound) { 302 | alert("None of the selected items was a .txt file!"); 303 | return; 304 | } 305 | for (var name in fileMappings) { 306 | var mapping = fileMappings[name]; 307 | var newComp = createCompFromFootage(mapping.video); 308 | addCursorRecorderNull(newComp, mapping.txt.file); 309 | newComp.openInViewer(); 310 | } 311 | } 312 | catch (err) { 313 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 314 | } 315 | } 316 | function fromFileButtonClicked() { 317 | try { 318 | var fromFileAlertTitle = 'Importing From File Error.'; 319 | var activeComposition = getActiveComp(); 320 | if (!activeComposition) { 321 | if (!app.project.activeItem || app.project.activeItem === undefined) { 322 | alert("You neither have a composition opened in the viewer nor selected in the project panel!", fromFileAlertTitle); 323 | return; 324 | } 325 | if (app.project.activeItem.typeName != "Composition") { 326 | alert("You did not select a composition, but a " + app.project.activeItem.typeName + "!", fromFileAlertTitle); 327 | return; 328 | } 329 | } 330 | var file = File.openDialog("Choose a file containing the cursor movement data.", "Text files: *.txt", true); 331 | if (!file) { 332 | return; 333 | } 334 | addCursorRecorderNull(app.project.activeItem, new File(file)); 335 | } 336 | catch (err) { 337 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 338 | } 339 | } 340 | function addCursorRecorderNull(comp, dataFile) { 341 | try { 342 | var times = []; 343 | var positions = []; 344 | var myNull = void 0; 345 | if (dataFile.open("r")) { 346 | myNull = comp.layers.addNull(); 347 | myNull.name = dataFile.name; 348 | var last_time = void 0; 349 | var line = void 0; 350 | while (true) { 351 | line = dataFile.readln(); 352 | var splitLine = line.split(" "); 353 | if (!line) { 354 | myNull.outPoint = parseFloat(last_time); 355 | break; 356 | } 357 | last_time = splitLine[0]; 358 | times.push(splitLine[0]); 359 | positions.push([splitLine[1], splitLine[2]]); 360 | } 361 | myNull.outPoint = parseFloat(last_time); 362 | dataFile.close(); 363 | } 364 | else { 365 | alert("There was an error opening the file!"); 366 | return; 367 | } 368 | myNull.transform.position.setValuesAtTimes(times, positions); 369 | } 370 | catch (err) { 371 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 372 | } 373 | } 374 | function createCompFromFootage(footage) { 375 | var fileNameOnly = getStringWithoutExtension(footage.name); 376 | var newComp = app.project.items.addComp(fileNameOnly, footage.width, footage.height, footage.pixelAspect, footage.duration, footage.frameRate); 377 | newComp.layers.add(footage); 378 | return newComp; 379 | } 380 | function getName(obj) { 381 | return ((obj.file && obj.file.name) || obj.name); 382 | } 383 | function getStringWithoutExtension(str) { 384 | var dotPosition = str.lastIndexOf("."); 385 | return str.substring(dotPosition, 0); 386 | } 387 | function getActiveComp() { 388 | var comp; 389 | var X = app.project.activeItem; 390 | var selComp = app.project.selection.length === 1 && app.project.selection[0].typeName === "Composition" ? app.project.selection[0] : null; 391 | var temp; 392 | function activateCompViewer() { 393 | var A = (app.activeViewer && app.activeViewer.type === ViewerType.VIEWER_COMPOSITION); 394 | if (A) 395 | app.activeViewer.setActive(); 396 | return A; 397 | } 398 | ; 399 | if (X instanceof CompItem) { 400 | if (selComp === null) { 401 | comp = X; 402 | } 403 | else if (selComp !== X) { 404 | comp = null; 405 | } 406 | else { 407 | X.selected = false; 408 | temp = app.project.activeItem; 409 | X.selected = true; 410 | if (temp === null) { 411 | comp = (activateCompViewer() && app.project.activeItem === X) ? X : null; 412 | } 413 | else { 414 | comp = X; 415 | } 416 | ; 417 | } 418 | ; 419 | } 420 | else { 421 | comp = activateCompViewer() ? app.project.activeItem : null; 422 | } 423 | ; 424 | return comp; 425 | } 426 | ; 427 | if (!String.prototype.endsWith) { 428 | String.prototype.endsWith = function (search, this_len) { 429 | if (this_len === undefined || this_len > this.length) { 430 | this_len = this.length; 431 | } 432 | return this.substring(this_len - search.length, this_len) === search; 433 | }; 434 | } 435 | -------------------------------------------------------------------------------- /scripts/afterfx/script.ts: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at https://mozilla.org/MPL/2.0/. 4 | * All comments and write lines are removed from this file */ 5 | 6 | /// 7 | 8 | const helpFromTwoText = `You need to select an even amount of items in your project panel. 9 | Each pair must consist of a data (.txt) file and a video file. The names of the video and data files (disregarding the extension) have to be the same! 10 | They will be unless you changed them. 11 | 12 | 1. Select the video, data pairs in the project panel. 13 | 2. Click this button. 14 | 3. Your composition(s) will be created.`; 15 | 16 | const helpFromFileText = `This will ask you to select a file from your drive. 17 | Compared to the 'From Two' button above, you do not have to import the .txt file in your project. 18 | 19 | 1. Have a composition open. 20 | 2. Click this button. 21 | 3. Select a .txt file. 22 | 4. You have a null.`; 23 | 24 | const helpTipHelpTip = 'Get more info.'; 25 | 26 | const repositoryLink = 'https://github.com/JakubKoralewski/cursor-recorder'; 27 | 28 | /* const about = `\`Cursor Recorder for After Effects\` is only a part of the \`cursor-recorder\` project. 29 | The other half is the script - \`Cursor Recroder for OBS\` that lets you exactly time the start and stop of the cursor recording by getting the cursor data only when you record in OBS Studio. 30 | 31 | The project is open-source on Github at ${repositoryLink}.`; 32 | */ 33 | const copyrightHelpTip = `Mozilla Public License 2.0 34 | If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/`; 35 | 36 | 37 | enum FILE { 38 | TXT, 39 | VIDEO 40 | } 41 | 42 | enum PROPERTIES { 43 | ANCHOR_POINT = 'anchorPoint', 44 | POSITION = 'position', 45 | X_POSITION = 'xPosition', 46 | Y_POSITION = 'yPosition', 47 | Z_POSITION = 'zPosition', 48 | SCALE = 'scale', 49 | ORIENTATION = 'orientation', 50 | ROTATION = 'rotation', 51 | X_ROTATION = 'xRotation', 52 | Y_ROTATION = 'yRotation', 53 | Z_ROTATION = 'zRotation', 54 | OPACITY = 'opacity', 55 | }; 56 | 57 | interface IExpressionProperty { 58 | property: PROPERTIES; 59 | expression: (nullName?: string, optional_args?: any) => string | number[]; 60 | } 61 | 62 | interface INullExpression { 63 | null: IExpressionProperty; 64 | } 65 | interface IVideoExpression { 66 | video: IExpressionProperty; 67 | } 68 | 69 | interface IExpression { 70 | name: string; 71 | optional_args?: [ 72 | { 73 | title: string; 74 | id: string; 75 | default: any; 76 | }, 77 | ]; 78 | expressions: { 79 | null: IExpressionProperty[]; 80 | video?: IExpressionProperty[]; 81 | } | { 82 | null?: IExpressionProperty[]; 83 | video: IExpressionProperty[]; 84 | }; 85 | } 86 | 87 | const EXPRESSIONS: IExpression[] = [ 88 | 89 | /* Cursor will be always in center. You can scale the video up. */ 90 | { 91 | name: "Cursor always in center", 92 | expressions: { 93 | video: [{ 94 | property: PROPERTIES.ANCHOR_POINT, 95 | expression: function (nullName) { 96 | return "thisComp.layer(\"" + nullName + "\").transform.position;"; 97 | }, 98 | }] 99 | } 100 | }, 101 | 102 | /** The video will smoothly follow the cursor. You need to set the scale manually. 103 | * The maximum value is the. */ 104 | { 105 | name: "Smooth Follow", 106 | optional_args: [ 107 | { 108 | title: "Multiplier", 109 | id: "multiplier", 110 | default: 2, 111 | } 112 | ], 113 | expressions: { 114 | video: [{ 115 | /* TODO: Add a list of properties with each its own expression! */ 116 | property: PROPERTIES.POSITION, 117 | expression: function (nullName, opts) { 118 | let width = opts.width || 1920; 119 | let height = opts.height || 1080; 120 | let multiplier = parseFloat((opts.multiplier as EditText).text) || 2; 121 | let multiplier100 = 100 * multiplier; 122 | return `thisLayerScale = transform.scale; 123 | cursorX = thisComp.layer("`+ nullName + `").transform.position[0]; 124 | cursorY = thisComp.layer("`+ nullName + `").transform.position[1]; 125 | xvalue = linear(thisLayerScale[0], 100, `+ multiplier100 + `, cursorX + ` + width / multiplier + `, ` + width + `); 126 | yvalue = linear(thisLayerScale[0], 100, `+ multiplier100 + `, cursorY + ` + height / multiplier + `, ` + height + `); 127 | [xvalue - cursorX, yvalue - cursorY];` 128 | } 129 | }, 130 | { 131 | property: PROPERTIES.SCALE, 132 | expression: function(_nullName, opts) { 133 | let multiplier = parseFloat((opts.multiplier as EditText).text) || 2; 134 | let multiplier100 = 100 * multiplier; 135 | return [multiplier100, multiplier100]; 136 | } 137 | }] 138 | } 139 | } 140 | ]; 141 | 142 | interface IcurrentOptionalArg { 143 | name: string; 144 | element: EditText 145 | } 146 | 147 | let currentOptionalArgs: IcurrentOptionalArg[] = []; 148 | 149 | { 150 | /** Create the ScriptUI Panel */ 151 | function cursorRecorderPanel(thisObj) { 152 | /** Build the UI */ 153 | function buildUI(thisObj) { 154 | let myPanel = 155 | thisObj instanceof Panel 156 | ? thisObj 157 | : new Window("palette", "Cursor Recorder For After Effects", undefined, { 158 | resizeable: true, 159 | closeButton: true, 160 | }); 161 | myPanel.alignment = ['center', 'center']; 162 | myPanel.alignChildren = 'center'; 163 | myPanel.preferredSize = [400,200]; 164 | /* myPanel.helpTip = about; 165 | */ 166 | /** Panel create Null */ 167 | let pCreateNull = myPanel.add("panel", undefined, "Create Null"); 168 | pCreateNull.orientation = 'column'; 169 | pCreateNull.alignment = 'center'; 170 | 171 | /* From Two */ 172 | 173 | /** Group from Two */ 174 | let gfromTwo = pCreateNull.add("group", undefined, { name: "fromTwo" }); 175 | gfromTwo.orientation = 'row'; 176 | 177 | let fromTwoButton = gfromTwo.add("button", undefined, "Create Comp from video and data", { name: "fromTwo" }); 178 | fromTwoButton.alignment = 'fill'; 179 | let helpFromTwo = gfromTwo.add("button", undefined, "?", { name: "helpFromTwo" }); 180 | helpFromTwo.helpTip = helpTipHelpTip; 181 | helpFromTwo.alignment = "right"; 182 | helpFromTwo.maximumSize = [30, 20]; 183 | 184 | fromTwoButton.onClick = function () { 185 | fromTwoButtonClicked(); 186 | }; 187 | 188 | helpFromTwo.onClick = function () { 189 | displayHelp('How to use the From Two import', helpFromTwoText); 190 | }; 191 | 192 | /* From File */ 193 | 194 | /* Group from File */ 195 | let gfromFile = pCreateNull.add("group", undefined, { name: "fromFile" }); 196 | gfromFile.orientation = 'row'; 197 | 198 | let fromFileButton = gfromFile.add("button", undefined, "Import .txt file from file", { name: "fromFile" }); 199 | fromFileButton.alignment = 'fill'; 200 | let helpFromFile = gfromFile.add("button", undefined, "?", { name: "helpFromFile" }); 201 | helpFromFile.alignment = "right"; 202 | helpFromFile.maximumSize = [30, 20]; 203 | helpFromFile.helpTip = helpTipHelpTip; 204 | 205 | fromFileButton.onClick = fromFileButtonClicked; 206 | 207 | helpFromFile.onClick = function () { 208 | displayHelp('How to use the From File import', helpFromFileText); 209 | }; 210 | 211 | /* Expressions */ 212 | 213 | let pExpressions = myPanel.add("panel", undefined, "Add Expressions"); 214 | pExpressions.orientation = 'column'; 215 | pExpressions.alignment = 'fill'; 216 | 217 | /** This group allows to put the optional arguments right after the TreeView. */ 218 | let gTVWithOptArgs = pExpressions.add("group"); 219 | gTVWithOptArgs.orientation = 'column'; 220 | gTVWithOptArgs.alignment = 'fill'; 221 | 222 | /** Tree view of Expressions */ 223 | let tvExpressions = gTVWithOptArgs.add("treeview", undefined, undefined, { name: "Expression List" }); 224 | tvExpressions.alignment = 'fill'; 225 | 226 | let createdExpressions: ListItem[] = []; 227 | 228 | for (let i = 0; i < EXPRESSIONS.length; i++) { 229 | let createdExpression = tvExpressions.add("item", EXPRESSIONS[i].name, i); 230 | createdExpression.onActivate = function () { 231 | alert("expression activated"); 232 | } 233 | createdExpressions.push(createdExpression); 234 | } 235 | 236 | tvExpressions.onChange = function () { 237 | let opt_args = EXPRESSIONS[tvExpressions.selection.index].optional_args; 238 | if (opt_args) { 239 | /* Add optional arguments dialogs */ 240 | for (let arg of opt_args) { 241 | let newOptionalArg = gTVWithOptArgs.add("edittext", undefined, arg.default, { name: arg.title }); 242 | newOptionalArg.preferredSize = [80, 20]; 243 | newOptionalArg.justify = 'center'; 244 | newOptionalArg.helpTip = arg.title; 245 | currentOptionalArgs.push({ name: arg.id, element: newOptionalArg }); 246 | } 247 | myPanel.layout.layout(true); 248 | } else { 249 | if (currentOptionalArgs) { 250 | /* Remove optional arguments dialogs if they exist */ 251 | for (let arg of currentOptionalArgs) { 252 | gTVWithOptArgs.remove(arg.element); 253 | } 254 | currentOptionalArgs = []; 255 | } 256 | myPanel.layout.layout(true); 257 | } 258 | } 259 | 260 | /* Add Expression button */ 261 | let addExpressionButton = pExpressions.add("button", undefined, "Add Expression"); 262 | 263 | 264 | addExpressionButton.onClick = function () { 265 | let selectedExpression = tvExpressions.selection; 266 | 267 | /* If there are currently set optional arguments 268 | * addExpression with the optional arguments else don't. 269 | */ 270 | addExpression(selectedExpression.index, currentOptionalArgs ? currentOptionalArgs : null); 271 | } 272 | 273 | myPanel.add( 274 | "edittext", 275 | undefined, 276 | "Copyright MPL-2.0 (c) 2019 by Jakub Koralewski" 277 | ); 278 | /* copyright.helpTip = about + '\n\n' + copyrightHelpTip; 279 | */ 280 | let link = myPanel.add( 281 | "button", 282 | undefined, 283 | repositoryLink, 284 | ); 285 | 286 | link.onClick = function() { 287 | openURL(repositoryLink); 288 | } 289 | 290 | myPanel.onResizing = myPanel.onResize = myPanel.onShow = function() { 291 | this.layout.resize(); 292 | } 293 | 294 | myPanel.layout.layout(true); 295 | return myPanel; 296 | } 297 | 298 | let UI = buildUI(thisObj); 299 | if (UI != null && UI instanceof Window) { 300 | UI.center(); 301 | UI.show(); 302 | } 303 | } 304 | cursorRecorderPanel(this); 305 | } 306 | 307 | /** https://forums.adobe.com/thread/1295455 308 | * @author https://forums.adobe.com/people/JJMack 309 | */ 310 | function openURL(address: string) { 311 | try{ 312 | var URL = new File("cursor-recorder-shortcut.html"); 313 | URL.open("w"); 314 | URL.writeln(''); 315 | URL.close(); 316 | URL.execute(); 317 | }catch (err) { 318 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 319 | } 320 | } 321 | 322 | /** Triggered when the `Add Expression` button is clicked. 323 | * 324 | * @param {number} selectedExpressionNumber - the index of the expression in the expression list. 325 | * @param {any} currentOptionalArgs - optional arguments to use when setting the expression 326 | * e.g.: the multiplier of the zoom 327 | */ 328 | function addExpression(selectedExpressionNumber: number, currentOptionalArgs?: IcurrentOptionalArg[]) { 329 | try { 330 | $.writeln("Adding expression"); 331 | let activeComp = getActiveComp(); 332 | if(!activeComp) { 333 | alert("No active composition found!"); 334 | return; 335 | } 336 | let selectedExpression = EXPRESSIONS[selectedExpressionNumber]; 337 | 338 | /* Get the files needed for this expression to work. */ 339 | let neededFiles: FILE[] = []; 340 | 341 | if (selectedExpression.expressions.null) { 342 | $.writeln("Null layer is needed for this expression."); 343 | neededFiles.push(FILE.TXT); 344 | } 345 | if (selectedExpression.expressions.video) { 346 | $.writeln("Video layer is needed for this expression."); 347 | neededFiles.push(FILE.VIDEO); 348 | } 349 | 350 | $.writeln("Needed files: ", neededFiles); 351 | 352 | let null_layer: AVLayer; 353 | let video_layers: AVLayer[] = []; 354 | for (let i = 1, len = activeComp.numLayers; i <= len; i++) { 355 | /* Loop over every layer in the active composition. */ 356 | let layer = activeComp.layers[i]; 357 | 358 | if (layer.nullLayer) { 359 | $.writeln("Found the null layer"); 360 | null_layer = layer as AVLayer; 361 | } else { 362 | if (layer.hasVideo) { 363 | $.writeln("Found the video layer"); 364 | video_layers.push(layer as AVLayer); 365 | } 366 | } 367 | } 368 | 369 | /* If this expression needs a video to work 370 | * find one. */ 371 | 372 | if (neededFiles.indexOf(FILE.VIDEO) !== -1) { 373 | $.writeln("Executing video layer logic."); 374 | 375 | if (video_layers.length === 0) { 376 | alert("Video not found in this composition!"); 377 | } 378 | let video_layer: AVLayer; 379 | 380 | let foundSameName = false; 381 | for (let layer of video_layers) { 382 | if (getStringWithoutExtension(layer.name) === getStringWithoutExtension(null_layer.name)) { 383 | foundSameName = true; 384 | video_layer = layer; 385 | break; 386 | } 387 | } 388 | 389 | if (!foundSameName) { 390 | video_layer = video_layers[0]; 391 | $.writeln("Found multiple files, so I select the first one!"); 392 | } 393 | /* Assigning optional arguments for the function */ 394 | let optionalArgs = { width: video_layer.width, height: video_layer.height }; 395 | for (let optArg of currentOptionalArgs) { 396 | optionalArgs[optArg.name] = optArg.element; 397 | } 398 | 399 | for (let expression of selectedExpression.expressions.video){ 400 | let expressionResult = expression.expression( 401 | null_layer.name, 402 | optionalArgs 403 | ); 404 | setExpression(video_layer, expression.property, expressionResult); 405 | } 406 | } 407 | if (neededFiles.indexOf(FILE.TXT) !== -1) { 408 | $.writeln("Executing null layer logic."); 409 | for (let expression of selectedExpression.expressions.null){ 410 | setExpression(null_layer, expression.property, expression.expression(null_layer.name)); 411 | } 412 | } 413 | 414 | 415 | } catch (err) { 416 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 417 | } 418 | } 419 | 420 | /** Once you get the expression's result e.g.: a string to set an expression 421 | * or a raw value to set directly. This function takes care of detecting 422 | * whether the return value is: 423 | * 424 | * a string => expression 425 | * anything else => a direct value 426 | * 427 | * @param {AVLayer} layer - the layer to set the value to 428 | * @param {string} property - e.g.: position, rotation 429 | * @param {any} expressionResult - any return value set in the expression's function 430 | */ 431 | function setExpression(layer: AVLayer, property: string, expressionResult: any) { 432 | if (typeof expressionResult == "string") { 433 | layer.transform[ 434 | property 435 | ].expression = expressionResult; 436 | } else { 437 | layer.transform[ 438 | property 439 | ].setValue(expressionResult as any); 440 | } 441 | } 442 | 443 | /** Triggered when the `?` button is clicked next to the corresponding `Create Null` button. */ 444 | function displayHelp(title: string, helpText: string) { 445 | alert(helpText, title); 446 | } 447 | 448 | interface IFileMapping { 449 | [name: string]: { txt: FootageItem; video: FootageItem }; 450 | } 451 | 452 | /** Triggered when the `fromTwo` button is clicked. 453 | * It looks for pairs of text files and video files in the selected items in the project panel. 454 | * It finds those pairs and creates the corresponding compositions and opens these newly created compositions. 455 | */ 456 | function fromTwoButtonClicked() { 457 | try { 458 | $.writeln("From two clicked."); 459 | let selection = app.project.selection as FootageItem[]; 460 | if (selection.length == 0) { 461 | alert("You must select something first!"); 462 | return; 463 | } else if (selection.length % 2 !== 0) { 464 | alert("You did not select an even number of elements!"); 465 | return; 466 | } 467 | let cursorRecorderDataFileFound = false; 468 | 469 | /** It creates a mapping, where the key is the name of the either pair of the files without the extension. 470 | * 471 | * The txt property is the text FootageItem. 472 | * The video property is the video FootageItem. 473 | * 474 | * This allows for any even number of selected items. 475 | */ 476 | let fileMappings: IFileMapping = {}; 477 | for (let i = 0, len = selection.length; i < len; i++) { 478 | if (!(selection[i] instanceof FootageItem)) { 479 | /* Both a text file and a movie are a FootageItem. */ 480 | alert(getName(selection[i]).concat(" is not a valid file. Please select a video and a text file.")); 481 | return; 482 | } 483 | 484 | let withoutExtension = getStringWithoutExtension(selection[i].file.name); 485 | 486 | if (!(withoutExtension in fileMappings)) { 487 | $.writeln('creating empty object'); 488 | fileMappings[withoutExtension] = { txt: null, video: null }; 489 | $.writeln('created empty object'); 490 | } 491 | 492 | if (selection[i].file.name.endsWith('txt')) { 493 | /* File is a txt! */ 494 | cursorRecorderDataFileFound = true; 495 | $.writeln('addign txt file'); 496 | fileMappings[withoutExtension].txt = selection[i]; 497 | $.writeln('added txt file'); 498 | } else { 499 | /* File is a video file! */ 500 | $.writeln('addign video file'); 501 | fileMappings[withoutExtension].video = selection[i]; 502 | $.writeln('added video file'); 503 | } 504 | 505 | /* This is done so, when a file is selected later 506 | * you can be sure it's the only selected one! */ 507 | selection[i].selected = false; 508 | } 509 | if (!cursorRecorderDataFileFound) { 510 | alert("None of the selected items was a .txt file!"); 511 | return; 512 | } 513 | 514 | for (let name in fileMappings) { 515 | let mapping = fileMappings[name]; 516 | let newComp = createCompFromFootage(mapping.video); 517 | addCursorRecorderNull(newComp, mapping.txt.file); 518 | newComp.openInViewer(); 519 | } 520 | } catch (err) { 521 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 522 | } 523 | } 524 | 525 | /** Triggered when the `fromFile` button is clicked. 526 | * It triggers a file dialog. You need to select the cursor-recorder .txt file. 527 | * It then interprets the data using the `addCursorRecorderNull()` function. 528 | * It adds the null to the composition selected in the project panel. 529 | */ 530 | function fromFileButtonClicked() { 531 | try { 532 | let fromFileAlertTitle = 'Importing From File Error.'; 533 | let activeComposition = getActiveComp(); 534 | if (!activeComposition) { 535 | $.writeln(`A composition was not open in the viewer. 536 | Looking for a selected composition in the project panel.`); 537 | if (!app.project.activeItem || app.project.activeItem === undefined) { 538 | alert( 539 | "You neither have a composition opened in the viewer nor selected in the project panel!", 540 | fromFileAlertTitle 541 | ); 542 | return; 543 | } 544 | if (app.project.activeItem.typeName != "Composition") { 545 | alert( 546 | "You did not select a composition, but a " + app.project.activeItem.typeName + "!", 547 | fromFileAlertTitle 548 | ); 549 | return; 550 | } 551 | } 552 | 553 | let file = File.openDialog("Choose a file containing the cursor movement data.", "Text files: *.txt", true); 554 | 555 | if (!file) { 556 | /* User cancelled */ 557 | return; 558 | } 559 | 560 | $.writeln(file); 561 | addCursorRecorderNull(app.project.activeItem as CompItem, new File(file as any)); 562 | 563 | } catch (err) { 564 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 565 | } 566 | } 567 | 568 | /** The logic behind interpreting a cursor recorder data txt file. 569 | * 570 | * @param {CompItem} comp - the composition to add the null to 571 | * @param {File} dataFile - the file containg the data 572 | */ 573 | function addCursorRecorderNull(comp: CompItem, dataFile: File) { 574 | try { 575 | let times = []; 576 | let positions = []; 577 | let myNull: Layer; 578 | if (dataFile.open("r")) { 579 | myNull = comp.layers.addNull(); 580 | myNull.name = dataFile.name; 581 | let lines = dataFile.read().split('\n'); 582 | dataFile.close(); 583 | let last_time: string; 584 | $.writeln("lines: ", lines); 585 | for (let line of lines) { 586 | let splitLine = line.split(" "); 587 | if (!splitLine[2]) { 588 | continue; 589 | } 590 | last_time = splitLine[0]; 591 | times.push(splitLine[0]); 592 | positions.push([splitLine[1], splitLine[2]]) 593 | } 594 | $.writeln("last_time: ", last_time); 595 | myNull.outPoint = parseFloat(last_time); 596 | } else { 597 | alert("There was an error opening the file!"); 598 | return; 599 | } 600 | 601 | myNull.transform.position.setValuesAtTimes(times, positions); 602 | } catch (err) { 603 | alert("Error at line# " + err.line.toString() + "\r" + err.toString()); 604 | } 605 | } 606 | 607 | /** Emulates the behavior of dragging a video FootageItem onto the `New Compostion` button. */ 608 | function createCompFromFootage(footage: FootageItem) { 609 | let fileNameOnly = getStringWithoutExtension(footage.name); 610 | let newComp = app.project.items.addComp(fileNameOnly, footage.width, footage.height, footage.pixelAspect, footage.duration, footage.frameRate); 611 | newComp.layers.add(footage); 612 | return newComp; //Adds file to comp 613 | } 614 | 615 | function getName(obj: Item) { 616 | return (((obj as FootageItem).file && (obj as FootageItem).file.name) || obj.name); 617 | } 618 | 619 | /** Gets everything before the dot in the string. */ 620 | function getStringWithoutExtension(str: string) { 621 | let dotPosition = str.lastIndexOf("."); 622 | return str.substring(dotPosition, 0); 623 | } 624 | 625 | /** Finds active composition. IMHO better than selecting a composition in the project panel. 626 | * 627 | * @author Function by UQg https://forums.adobe.com/thread/2341455 628 | * @returns {CompItem | null} If found a composition returns the composition, else null. 629 | * */ 630 | function getActiveComp(): CompItem | null { 631 | var comp: Item; // the returned quantity 632 | var X = app.project.activeItem; // the initial activeItem 633 | var selComp = 634 | app.project.selection.length === 1 && app.project.selection[0].typeName === "Composition" 635 | ? app.project.selection[0] : null; // the unique selected comp, or null 636 | var temp: Item; 637 | 638 | function activateCompViewer() { 639 | var A = (app.activeViewer && app.activeViewer.type === ViewerType.VIEWER_COMPOSITION); 640 | if (A) app.activeViewer.setActive(); 641 | return A; 642 | }; 643 | 644 | if (X instanceof CompItem) { 645 | if (selComp === null) { 646 | comp = X; 647 | } 648 | else if (selComp !== X) { 649 | comp = null; // ambiguity : the timeline panel is active, X is the front comp, but another comp is selected 650 | } 651 | else { 652 | X.selected = false; 653 | temp = app.project.activeItem; 654 | X.selected = true; 655 | 656 | if (temp === null) { 657 | comp = (activateCompViewer() && app.project.activeItem === X) ? X : null; 658 | } 659 | else { 660 | comp = X; 661 | }; 662 | }; 663 | } 664 | else { 665 | comp = activateCompViewer() ? app.project.activeItem : null; 666 | }; 667 | return comp as CompItem; 668 | }; 669 | 670 | /* Polyfills */ 671 | 672 | interface String { 673 | /** Official polyfill from MDN */ 674 | endsWith: (search: string, this_len?: number) => boolean; 675 | } 676 | 677 | if (!String.prototype.endsWith) { 678 | String.prototype.endsWith = function (search: string, this_len?: number) { 679 | if (this_len === undefined || this_len > this.length) { 680 | this_len = this.length; 681 | } 682 | return this.substring(this_len - search.length, this_len) === search; 683 | }; 684 | } 685 | 686 | -------------------------------------------------------------------------------- /scripts/afterfx/afterfx_resources.md: -------------------------------------------------------------------------------- 1 | 2 | app.executeCommand() codes: 3 | http://www.sundstedt.se/aescripts/AE_CS3_Command_IDs.pdf 4 | 5 | image: 6 | https://github.com/NTProductions/ui-image-testing 7 | 8 | dockable: 9 | https://github.com/NTProductions/dockable-ui 10 | 11 | ScriptUI Classes: 12 | http://jongware.mit.edu/Sui/index_1.html 13 | 14 | JavaScript Tools Guide: 15 | https://wwwimages2.adobe.com/content/dam/acom/en/devnet/scripting/pdfs/javascript_tools_guide.pdf 16 | 17 | ScriptUI for dummies: 18 | https://adobeindd.com/view/publications/a0207571-ff5b-4bbf-a540-07079bd21d75/y2c4/publication-web-resources/pdf/scriptui-2-13-f-2017.pdf 19 | 20 | HTML5 Extensions: 21 | http://www.adobe.com/devnet/creativesuite/articles/introducing-html5-extensions.html 22 | http://blogs.adobe.com/cssdk/2013/09/introducing-html5-extensions.html 23 | http://labs.adobe.com/technologies/extensionbuilder3/ 24 | https://www.youtube.com/watch?v=ZzdRfhT6R68 25 | https://github.com/Adobe-CEP/Samples 26 | https://github.com/Adobe-CEP/Samples/tree/master/AfterEffectsPanel 27 | 28 | HTML Panels: 29 | https://forums.adobe.com/external-link.jspa?url=http%3A%2F%2Fwww.davidebarranca.com%2Fcategory%2Fcode%2Fhtml-panels%2F 30 | 31 | const logo = '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00d\x00\x00\x00d\x08\x06\x00\x00\x00p\xe2\x95T\x00\x00"\x81IDATx\xda\xec[\x05\x94\xdcF\xb6\xbdR\xe30yLY\x8f!\x8c`f\x87\x99L\xe1\x98\xc2\xb8\x04a\x06\xd3R\xe0l\x98\x99\x99\xe9l\x989ff\x84A\x0f\xb5\xea\xdfwN\xf5\xf1\xfbZI3\x13\xa6\x97sSjui,\xbd[\x0fK\x8d\xdf\xe47\xf9\xa6\xe2D\xc0Up"\xf0\x9b|C\tRvL!n\x91\x08\x83\x9a\x13\x8b \xec\'\'\xb1\x9f \t\xae\x1e\x15\t\x0ea,kr~ED\xd88\xa0V\xeav\xdbm\xd7\xf1\xa5\x97^:p\xe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\x9b\x8a\x8b\xd9n\xbf\xfao\x7f\x83\x90\xf1;\x06\xe5\xa2L3\x84\x9c\x98\xcd\x8aD\x1c\xe5v\xf4HX\r\xd8c\x11\x19\xe1\xd8\xc1%\x00G\xcd\xe1\x7f\x06\xce\xa6\xeb\xbf.*\x84<\x90\x8e1r^\x82\xba\x16ny\x17\xaa:$\xdaB89\x9f\x16\xe2l\xaaAj\xc5\x0f\xaa\x9d\xc101\x11V\xa1% \xd0\x7fK\xa1O\xc6\xd6\x92|\xb0U\xf2\x19S`\xe9\xde\xca\xdeD<\x9d\x0b\xd99\x90\xc7\x81(-\nv\x9e>\xe7\xda\xf3\xd9\xcf\xf2\xbd\xe3\xda\xcf\xfa;\x8b\xa4\x03\xd9k\xf7\xc7\xdb\xec.\xa8\xe80\x9b\x90\xa4\x18\xe4s\xd6\xae]\xabC\x9c\t\x8a!\xac\xa5\xd2\xf9P\xc2\xadUE\x84\x89vS\xd1\xe7\x03\xb2\xae\xefV\x92|\xe0C\xf7\xdd\x17\xa3\x0e8\x00[\xd0M\xe7z\x06b\xea9\x99\x0c\x8f=\xe4\xca\x98\xf1\x90\xe7\x05A\xbe\xe3\x1cu\x8e\xc7\x84\xbd\x96\xc8\xc9\x08\xf89\x04\t~\xef\x17\x12%\xef\n\x08t\xd34\xc18\x92jMs\xd1a\x86\x95\x82\x12\xb1\x8e\xef^\xfe\xaf\xbdk\x00\x92d[\xa2\xf7\x0e\x9em\xdb\xb6m\xdb\xb6m\xdb\xb6m\xdb\xb6m\xdb\xc4r\xe6\xedN\xffs\xe2\xd7\x89\xcd\xcd\xc8\x89\xdb\x13\xfd\xfaq3"\xa3\x1a\x83\xaa:7y3\xb3j\xa9\x194\x05\x029\x0c" \xa7\x85\xb0?\xc2\xfd\x95\xcc \xad*\x86\xa8\xeb\x7f\x97\x16\\\xad\xe7\x0b\x91\xf96\xbb\xad\xdb\x02\x82&\xa2\xb8d\xcf\xde\xedMvwPn\xef?\x90\xa8&\x18\xccrA\xd1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a\xcb\xbc\xb9\xc4>\x8d\x1f0\xc7\xea]\x1b\x13\xean$\xa8\xa7a8U\x07\xaaJ\x03\xc0\xba\xf8 z\xc4\x14\x9d\xa0\xbep\xa1\x7f\xfd\x1e\x04)\xf8\n\x9bF_\xe3\xe6\x7f\xfb\xf0\xc3\x0f\x7f#u\xe4\xd2?b\x0f\x82weu\xfc\xe7\x03\x12\x01\xe3\x8c\x7f\x9bQi\xe2\xb6@\xdd\xf1\xc8\x18gX8\x05C#\x89IP2\xbc\xb3.\xe4\xd4\x06\xa0\xb8\xc0>\xe9\x8el\r0\x99\x9fu\x92\x1d\x006\xb0#\x87@\xfc\xfb\x00\x89G\x1a\xb68[#\x00\xda\x1c\xb7\x8a\x1d\xb0a\x8e\x8dl$!f\'\tb\x0f\xc4\x7f\x01\x10Q.\x00$\x90\xfc\xeb\xec8\x1a\x85\xda\xe5\x80\xb1\xc7Z= \xfc\x17\x01\x89\xcf\xc7\xde\xe8\xe2cl\xe3\x04\x97\x03\xc6\x83\x95z\x0e\xc2\x10\xca\xe2\x82\xc4xn\t8;\x1eB\xcd\x07M\xfc\xcf\xa5\xff\x01\xfd`\x8b\x1b\xb9D\x1f\x1e\x00\x00\x00\x00IEND\xaeB`\x82'; 32 | --------------------------------------------------------------------------------