The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

I want to render my game to image animation frames using a cheat code. This is what I am imagining:

1) Start Game and execute cheat code, like hold "R" key.
2) For every frame that the game is running, save to a subfolder of my game folder called "renderframes" on my computer.

How would I go about creating this?

in Engine by (89 points)

Rendering every frame this way might take a bit too long, maybe you could use a screen recording software?

Rendering every frame this way might take a bit too long, maybe you
could use a screen recording software?

Why would it take too long? I have my reasons for rendering out actual frames of my project. I am aware there are screen recorders that can do this. However, I don't want a screen recorder for this task. I want the frame output to indicate actual frames in my project.

It may take too long because the engine is not designed to do this. You can see this straight away with the take_screenshot API, you will see it waits before giving you the resulting image:

That's because doing this, you are asking the renderer to lock the current frame and download it back to CPU side, which may stall rendering.
I also believe screen recorders use a specific driver to accomplish this in realtime, which Godot doesn't use anyways because the engine isn't designed for this.

You may try though, see if you get all frames. I'd be curious to know if it works.

1 Answer

+1 vote
by (107 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.