0
$\begingroup$

I'm new to Blender and I'm jumping into the deep end with scripting. Is it possible to get the default value of a slider? For example, I'm after the anti-aliasing filter value.

# get current anti-alias setting
AA = bpy.context.scene.render.filter_size

# change anti alias value
x = 1.2
bpy.context.scene.render.filter_size = x

get the default value and revert back to it when finished
# AAdefault = bpy.context.scene.render.filter_size.default ???
bpy.context.scene.render.filter_size = AAdefault
$\endgroup$

1 Answer 1

3
$\begingroup$

Get default value

import bpy

bpy.context.scene.render.filter_size = 2.0
print(bpy.context.scene.render.filter_size)
# >>> 2.0
default_value = bpy.context.scene.render.bl_rna.properties["filter_size"].default
print(default_value)
# >>> 1.5

# bpy.context.scene.render.filter_size = default_value
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .