Records mouse movement to a file and opens it in After Effects. Use with OBS Studio as an external Python script or if you prefer a more manual approach, using the standalone Python script. Then use the After Effects script to import the generated cursor movement data.
Download the files:
Tools -> Scripts
.Scripts -> Python Settings
).Install Python modules
if you don't have pyautogui
and/or keyboard
packages installed.You're ready to start recording. The *.txt will be saved in the same place as your video with the same name.
Stop the recording.
Adobe After Effects CC 2019
)\Support Files\Scripts\ScriptUI Panels
.ScriptUI Panels
folder.Window ->
scroll down to the Cursor Recorder for After Effects.jsx
script and click it.Checkout the Add Expressions
section in the Cursor Recorder for After Effects
script to quickly add predefined effects.
Do whatever you want with it from here. Check out the Examples section below!
refresh_rate
variable inside the code for your needs.thisLayerScale = transform.scale;
cursorX = thisComp.layer("cursor-recorder-movement").transform.position[0];
cursorY = thisComp.layer("cursor-recorder-movement").transform.position[1];
xvalue = linear(thisLayerScale[0], 100, 200, cursorX + 960, 1920);
yvalue = linear(thisLayerScale[0], 100, 200, cursorY + 540, 1080);
[xvalue - cursorX, yvalue - cursorY];
// Expression set on video's anchor point
thisComp.layer("cursor-recorder-movement").transform.position;
The images are links to streamable.com
BTW this is from this browser extension of mine (I'm really selling out right now)
I encourage you to fork, open issues and pull requests! :heart:
The script is developed using TypeScript. There are following commands available:
"scripts": {
"watch": "tsc -w",
"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'"
},
Your current directory being scripts\afterfx
:
Run npm run watch
for auto-reload.
The file will get saved to scripts\Cursor Recorder for After Effects.jsx
.
Copy it to the ExtendScript Toolkit and run it or copy the whole file to the ScriptUI Panels
in your After Effects installation.
Run npm run build
to have a production friendly version.
The "build"
script compiles the TypeScript file, removes comments and adds a copyright notice.
Currently OBS supports only 3.6.x Python interpreters!
You can debug the Python script inside PyCharm following the instructions for "Python Remote Debug" as shown below:
The script requires: pyautogui
and keyboard
. Install them yourself or using this command:
$ pip install -r requirements.txt