I want to change the Outliner / Filter / Restriction Toggled by the following python script in Blender v2.81 Python Console:
bpy.context.space_data.show_restrict_column_select = True
bpy.context.space_data.show_restrict_column_hide = False
bpy.context.space_data.show_restrict_column_viewport = True
bpy.context.space_data.show_restrict_column_render = True
These command are copied from the “Info” windows when these filters were altered manually. But the following error messages were displayed after executing the scripts:
bpy.context.space_data.show_restrict_column_select = True
Traceback (most recent call last):
File “<blender_console>”, line 1, in
AttributeError: ‘SpaceConsole’ object has no attribute ‘show_restrict_column_select’
bpy.context.space_data.show_restrict_column_hide = False
Traceback (most recent call last):
File “<blender_console>”, line 1, in
AttributeError: ‘SpaceConsole’ object has no attribute ‘show_restrict_column_hide’
bpy.context.space_data.show_restrict_column_viewport = True
Traceback (most recent call last):
File “<blender_console>”, line 1, in
AttributeError: ‘SpaceConsole’ object has no attribute ‘show_restrict_column_viewport’
bpy.context.space_data.show_restrict_column_render = True
Traceback (most recent call last):
File “<blender_console>”, line 1, in
AttributeError: ‘SpaceConsole’ object has no attribute ‘show_restrict_column_render’
The state of filters were not changed.
Anyone know what is wrong with the script statements and how to correct it?