In brief
- Scene data includes objects in the scene, along with timing and render settings.
- Render resolution, resolution percentage, and frame range can be configured through the Python API.
- A preview pixel size of 2 means displaying the image at 50% resolution.
- The Scene.use_nodes property has been deprecated since Blender 5.0; render.use_compositing is documented for compositing.
What will you learn in this guide?
Blender’s Python API lets you read and edit scene and render settings with code. This guide covers setting a scene’s frame range, configuring render resolution, choosing a preview scale, and controlling compositing behavior. The examples are limited to the properties and values listed in the documentation; they do not create a ready-made scene or project file.
For repeated camera presentations, animation ranges, or visualization work prepared for different output dimensions, managing settings with code can help maintain consistency. The goal here is not to require the same values in every project, but to show which scene properties can be managed programmatically.
Requirements and scope
The examples are based on the Scene and RenderSettings properties in the Blender Python API. You’ll need an environment that can run Python code in Blender and a Scene object to work with. The code snippets assume that the scene variable represents the scene you want to edit. How to obtain this variable depends on your project workflow; the source documentation does not prescribe a specific interface path.
These are current API pages, and the excerpts do not specify the Blender version in which each property was introduced. Before using the code, verify that it is compatible with the API documentation for your Blender version. The sources do not mention any account, paid license, add-on, or specific hardware requirements. The examples also do not select a render engine; the only documented value listed for RenderSettings.engine is BLENDER_EEVEE.
Step-by-step: edit scene settings
Set the frame range first.
Scene.frame_startandScene.frame_enddefine the first and last frames in the playback or render range. The documentation gives default values of 1 for the start frame and 250 for the end frame.frame_set()sets the scene’s frame while updating object and view layer data.
def set_frame_range(scene):
scene.frame_start = 1
scene.frame_end = 250
scene.frame_set(1)This example sets the scene range to the documented default values and moves the current frame to the start. The API documentation specifically recommends using frame_set() rather than changing the frame_current value directly. For a single-frame, non-animated project, you may not need to change the frame range.
Define the pixel dimensions of the render output. Set the horizontal and vertical resolution with
resolution_xandresolution_y, and the percentage applied to these dimensions withresolution_percentage. The documented defaults are 1920 × 1080 at 100%.
def set_render_resolution(scene):
scene.render.resolution_x = 1920
scene.render.resolution_y = 1080
scene.render.resolution_percentage = 100These values retain the default output shown in the source. If you need a different delivery size, review all three settings together: the resolution percentage changes the scale at which the specified horizontal and vertical pixel dimensions are applied. The example does not set a file path or output format; the documentation lists those as separate properties.
Treat preview scale separately from render resolution.
preview_pixel_sizesets the pixel scale for viewport renders. The documentation explains that a value of2means 50% of full resolution,4means 25%, and8means 12.5%. The example below uses half of the full resolution.
def set_preview_scale(scene):
scene.render.preview_pixel_size = '2'This setting is not the same as resolution_percentage: one controls viewport render scale, while the other controls the render resolution percentage. If you need to change the target output size, changing the preview scale alone is not enough. Keeping this distinction in mind helps avoid mistaking a low-resolution preview for the final output.
Manage the compositing pass explicitly.
render.use_compositingdetermines whether the render result passes through the compositing pipeline. According to the documentation, this applies if a compositing node group is assigned to the scene.
def set_compositing(scene, enabled):
scene.render.use_compositing = enabledPass True or False to the function to control this behavior. However, this code does not create a node group or set up compositing content; it only changes whether the render result passes through the compositing process. Enabling the setting on its own therefore does not add an effect to the image.
Common mistakes
Confusing preview and output resolution: preview_pixel_size applies to viewport renders, while resolution_x, resolution_y, and resolution_percentage relate to render resolution. Check the right group of properties when verifying the desired output dimensions.
Treating the scene range and simulation range as the same thing: frame_start and frame_end define the playback/render range. simulation_frame_start and simulation_frame_end specify the start and end frames for simulations. In addition, use_custom_simulation_range allows a different simulation range to be used for simulation nodes that do not define their own frame range.
Relying on outdated compositing properties: The Scene.use_nodes property has been deprecated since Blender 5.0; the documentation says it has no effect and recommends using scene.render.use_compositing to enable or disable compositing. compositing_node_group has also been deprecated since 5.0, with removal planned for version 6.0. The documentation points to the compositor_effects property instead, but describes it as read-only. Check these distinctions when migrating old code to new projects.
Ignoring how settings affect memory use: use_persistent_data can speed up repeat renders by keeping data in memory for subsequent renders and animation renders; the trade-off is increased memory use. Rather than enabling it automatically for every job, it is more prudent to test it under your project and machine conditions.
Use in architecture and archviz workflows
For architecture firms and archviz artists, this approach can be useful when the same scene settings need to be applied repeatedly. For example, you can group frame range and output resolution settings into a function to standardize them across a team. Students can also use small experiments to see how scene range, preview scale, and final render scale are different settings.
However, code does not guarantee that scene content is correct or that hardware performance will be suitable. The sources do not provide specific hardware requirements, license costs, or render times. Since use_persistent_data can increase memory use, monitor memory while testing it on a workstation. If the project will be opened in another Blender version, verify API compatibility and review any scripts that rely on deprecated compositing properties.
Next steps
Start by running the frame range and resolution examples separately in a copy of your scene. Then change the preview scale and check that it is not the same setting as the final output resolution. For compositing, remember that use_compositing controls the pass through the compositing pipeline; it does not set up node group content. Compare the properties you plan to use in your own script against the API documentation for your target Blender version.
Sources and license
This guide was adapted into Turkish using the Blender Python API documentation for Scene and RenderSettings. Both sources are licensed under CC BY-SA 4.0: Scene and RenderSettings.
Sources
2 sourcesSource texts are not republished; short quotes are marked, everything else is our own summary and commentary.
For small studios and students in Turkey, the value of this API approach lies less in any promise of hardware-independent speed and more in making repeated settings consistent. Grouping the frame range and output dimensions in a script can reduce manual checks for similar presentation work.
However, `use_persistent_data` can increase memory use, so it’s best not to add it to a general workflow without testing it on demanding scenes. Blender version compatibility with the API and the status of deprecated compositing properties should also be checked before production. Since the sources do not specify license costs or a hardware threshold, these should be assessed separately based on project requirements.
Frequently asked questions
How do you set render resolution with the Blender Python API?
Use the `scene.render.resolution_x`, `scene.render.resolution_y`, and `scene.render.resolution_percentage` properties. The documented defaults are 1920, 1080, and 100%, respectively.
Are Blender’s preview resolution and render resolution the same?
No. `preview_pixel_size` sets the viewport render scale, while `resolution_x`, `resolution_y`, and `resolution_percentage` define the render resolution.
Which compositing setting should you use instead of `Scene.use_nodes` in Blender?
The API documentation recommends using `scene.render.use_compositing` to enable or disable compositing. The compositing process applies if a compositing node group is assigned to the scene.



