Closed alekseynp closed 3 years ago
Thank you for report the issue.
It look like blender itself make this unexpected color_depth modify.
When change output file_format to 'OPEN_EXR' then change back to 'PNG', the bug happend.
Here is python example to reproduce this bug:
>>> bpy.context.scene.render.image_settings.file_format
'PNG'
>>> bpy.context.scene.render.image_settings.color_depth
'8'
>>> bpy.context.scene.render.image_settings.file_format = 'OPEN_EXR'
>>> bpy.context.scene.render.image_settings.file_format = 'PNG'
>>> bpy.context.scene.render.image_settings.color_depth
'16'
Using GUI do those steps could reproduce bug too.
Does that mean this line is being ignored? https://github.com/DIYer22/bpycv/blob/6268b58812d15b9a8464939f19527b4ab41c9be2/bpycv/render_utils.py#L50
no
...
attrs = dict(
file_format="OPEN_EXR",
color_mode="RGBA",
color_depth="32",
use_zbuffer=True,
)
self.set_attrs(render.image_settings, attrs)
when set file_format="OPEN_EXR"
, Blender modify color_depth to "16" automaticly.
So, color_depth's value is "16", befor the line color_depth="32"
Easy enough to workaround by manually fixing after the call, but I can see you go to some advanced effort in the code to change and then reset parameters like this.
Blender 2.80
To reproduce, from Blender launch:
In the Scripting Console: