Script to scrub through animation and take a screenshot at each frame

Started by wayneheim, November 08, 2021, 11:38:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wayneheim

Is it possible to write a script or is there such a script that will go through an animation frame by frame and do a screen capture of each frame? With gpu live preview rendering you would be able to generate all frames to an animation in a fraction of the time it take use render and gpu settings.

Wayne

INNEO_MWo


wayneheim

Might this be possible with a keyboard macro since you can play and stop the animation via the shift+spacebar and capture a screen with the p?  As long as you can define the pause in between each double space bar press and set the number of times it repeats the p to the number of frames I think that might work.

wayneheim

With some help from my son and Autohotkey, we got this to work.

^j::
MouseGetPos, xpos, ypos
numberOfFrames := 25
loop %numberOfFrames%
{
   Send {p}
   Sleep 500
   MouseClick, left, %xpos%, %ypos%
   waitTime := 8 * 1000
   Sleep waitTime
}
exitapp

Keyboard short cut is set to Control + J.
Set the number of frames for your animation
Sleep waittime is the amount of time you want your screen to redraw.

Once done, compile the script with the app. Then run the little exe that it makes. Once running, click on Keyshot window and hover your mouse over the "next frame" button on your timeline. Hit the control+j shortcut and keyshot will start taking screen captures and advancing one frame at a time.

I had to set my project window to "materials" because for some reason the other windows were switching the camera view. This allows you to use almost full use of your gpu's when rendering now.

Hope this helps others.

Wayne