Page MenuHome

Python render setting commands are incorrect in the Info view
Closed, ResolvedPublic

Description

This applies to at least 2.77a and 2.78rc1

When I change certain render settings using the GUI, the Python command for that render setting shows up in the Info area. However, when I open up a console and try to duplicate these commands, I get the following error:

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: 'Scene' object has no attribute 'file_format'

I haven't done a thorough search for this mismatch, but it's incorrect for the following settings:
bpy.context.scene.file_format
bpy.context.scene.color_depth
bpy.context.scene.color_mode
bpy.context.scene.exr_codec
bpy.context.scene.compression
bpy.context.scene.use_preview
bpy.context.scene.use_zbuffer

Thanks to this stackexchange post, I was able to figure out that the settings actually live in

bpy.context.scene.render.image_settings

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.Sep 14 2016, 11:01 AM

Note that our code to guess full RNA path is not always working fully… should output a ... in path then, though, to indicate it could not fully resolve it.

ImageFormatSettings were not setting their rna struct path, so a possible fix here D2228: possible fix for T49343

Note that our code to guess full RNA path is not always working fully… should output a ... in path then, though, to indicate it could not fully resolve it.

Yeah, I noticed that the tooltips put the '...' in there. However, as this screenshot shows, the Info area doesn't do the '...', so it leads me to believe that the settings are found in bpy.context.scene instead of bpy.context.scene.render.image_settings