Whether to use gizmos when working in Blender is a highly debated topic among 3D artists. However, even without using gizmos on a regular basis, there are times when “those arrows” could be very useful. If gizmos are hide by default in our Blender settings, we can write a simple script that will temporarily show and hide gizmos in the 3D viewport.
Gizmo display in the 3D viewport’s area is controlled through its “space” pointer. We should manipulate with properties’ names begin with “show_gizmo_object_” and are followed by the desired gizmo type: “rotate,” “scale,” or “translate,” for the rotation, scale, and translation gizmos, respectively. For example, to display the translation gizmo, the “show_gizmo_object_translate” property is used.
Let’s write a script that will control the translation gizmo’s display when executed. We’ll create it in “toggle” mode, meaning that if the gizmo isn’t displayed, it will be shown, and if it’s already shown, it will be hidden.
To control the state of the 3D viewport’s area from the text editor’s area, we should use a temporary context override.
Let’s get a pointer to the 3D viewport area,
|
1 2 |
area = next((_area for _area in bpy.context.screen.areas \ if _area.type == 'VIEW_3D'), None) |
and call temp_override() with the area specified in the parameters.
|
1 |
with bpy.context.temp_override(area=area): |
Now, among the 3D viewport spaces, we determine the one in which the rendering actually occurs.
|
1 2 |
for space in area.spaces: if space.type == 'VIEW_3D': |
Having obtained a pointer to the viewport space, we can change the value of the gizmo’s display property in it to the opposite value each time the code is executed.
|
1 |
space.show_gizmo_object_translate = not space.show_gizmo_object_translate |
As a result, each time the script is executed, the gizmo in the 3D viewport will be toggled on or off.
The full code:
|
1 2 3 4 5 6 7 |
area = next((_area for _area in bpy.context.screen.areas \ if _area.type == 'VIEW_3D'), None) with bpy.context.temp_override(area=area): for space in area.spaces: if space.type == 'VIEW_3D': space.show_gizmo_object_translate = not space.show_gizmo_object_translate |
We can also configure the rotation and scaling gizmos to be on or off using the corresponding properties.
For scaling:
|
1 |
space.show_gizmo_object_scale = not space.show_gizmo_object_scale |
and for rotation:
|
1 |
space.show_gizmo_object_scale = not space.show_gizmo_object_scale |
We can also use any combination of these three gizmo types.
For convenience, we can bind such a script to keystrokes and enable and disable the desired gizmos in a “single button” mode.

.blend file on Patreon