# Python API editor frames

**URL:** <https://forums.unrealengine.com/t/python-api-editor-frames/469225>\
**Category:** Editor Scripting\
**Tags:** Python, tick, unreal-engine, editor, question\
**Created:** [August 5, 2020, 7:57am UTC](https://forums.unrealengine.com/t/python-api-editor-frames/469225 "2020-08-05T07:57:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Stevens](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tim\_Stevens](https://forums.unrealengine.com/u/Tim_Stevens)\
**Post date:** [August 5, 2020, 7:57am UTC](https://forums.unrealengine.com/t/python-api-editor-frames/469225/1 "2020-08-05T07:57:09Z")

</div>

Hi all,  
I have some 3D environment in which I need to change the viewport position and take high-res screenshots.  
The following commands work nicely when executed one-by-one:  
unreal.EditorLevelLibrary.set\_level\_viewport\_camera\_info([x,y,z],[pitch,yaw,roll])  
unreal.AutomationLibrary.take\_high\_res\_screenshot(res\_x,res\_y,name)  
But when trying to run several of those in a script, only the last command of each kind is being executed (and the is\_task\_done() always returns “False” during the script’s runtime).

I have scoured the net and API reference for days now, and I understand that when running a python script then the entire script is being executed in one editor frame (or tick), and the commands I want need to be run in consecutive frames, as depicted in the link below, for example:  
[https://forums.unrealengine.com/development-discussion/python-scripting/1728778-how-to-wait-for-take\_high\_res\_screenshot](https://forums.unrealengine.com/development-discussion/python-scripting/1728778-how-to-wait-for-take_high_res_screenshot)

> **[Batch editor automation of sequencer, HRSS, python](https://forums.unrealengine.com/questions/944867/view.html)**
>
> We're developing an automation routine for the UE editor in python (4.24.1).  Our requirements are to generate individual PNG image frames from a scene that we are manipulating in script.  The # of combinations we have go into the thousands...

My scene is completely static, and I don’t mind waiting as many frames as needed. What I couldn’t figure out is how do I wait for the next frame without exiting my script? Or how do I “tick” the editor from within it? The keywords are too generic (that is, if “frame” or “tick” are even the right terminology) and I can’t seem to find what I need in search or google.

I would be ever grateful for any pointing towards the right direction.  
Many thanks, Tim.

---

<div class="post-metadata">

**Author:** ![darkczar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkczar](https://forums.unrealengine.com/u/darkczar)\
**Post date:** [December 15, 2020, 4:08pm UTC](https://forums.unrealengine.com/t/python-api-editor-frames/469225/2 "2020-12-15T16:08:10Z")

</div>

[https://forums.unrealengine.com/development-discussion/python-scripting/1679694-python-api-highrescreenshot](https://forums.unrealengine.com/development-discussion/python-scripting/1679694-python-api-highrescreenshot)

The code in the above link worked for me.

---

<div class="post-metadata">

**Author:** ![quackaddict7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@quackaddict7](https://forums.unrealengine.com/u/quackaddict7)\
**Post date:** [December 4, 2023, 6:51pm UTC](https://forums.unrealengine.com/t/python-api-editor-frames/469225/3 "2023-12-04T18:51:23Z")

</div>

@Tim_Stevens did you ever get this working? The link that darkczar pointed you to is dead but hopefully you remember what you did? I know this is really old, but I have the same issue.
