# How do I center the view at the origin without moving the 3D cursor?

The shortcut I have always used to center my view is Shift +C, then Alt + Home. This moves the 3D cursor to the origin, then centers the view on the 3D cursor.

However, in some situations, I want to center the view at the origin without affecting the location of the 3D cursor, which I have set for rotation purposes, etc. Is there a different shortcut I can use instead?

You can use Alt+F to centre the view to your mouse pointer.

The exact behaviour you requested can be achieved with a little Python. Run the following in the text editor and add a view3d.view_center_origin key-binding of your choosing.

import bpy

class VIEW3D_OT_View_Center_Origin(bpy.types.Operator):
bl_idname = "view3d.view_center_origin"
bl_label = "Center view to origin"

def invoke(self, context, event):
v3d = context.space_data
if v3d.type == "VIEW_3D":
rv3d = v3d.region_3d
current_cloc = v3d.cursor_location.xyz
v3d.cursor_location = (0, 0, 0)
bpy.ops.view3d.view_center_cursor()
v3d.cursor_location = current_cloc
return {'FINISHED'}

if __name__ == "__main__":
bpy.utils.register_class(VIEW3D_OT_View_Center_Origin)

• The Aldrick answer was the MUST answer! Great thanks to Aldrick! I have made THE add-on about this question with his code: blenderartists.org/forum/… The keymap is preseted on "ctrl shift Numpad ." but I can change it for you. Bye Spirou4D Jun 13 '13 at 7:05
• @Spirou4D Glad you found it useful. Jun 21 '13 at 17:27
• @Spirou4D and Aldrik: Thank you for the code/addon! This does exactly what I was looking for, very simply. Note to Spirou4D: I ended up changing the keymap to Ctrl+Shift+. (the normal period) in order to work better with how my laptop emulates the numpad.
– Gwen
Jun 21 '13 at 23:50
• In the case where v3d.type != "VIEW_3D", how can I change that using a script? Apr 17 '18 at 15:50

This is not the ideal way if there is a built in function, but you could do this:

1. Create an empty at the cursors postion.   You can do this with Shift + A EmptyPlain Axes. (Or really anything in the Empty menu, such as Box or Circle.)
2. Snap the cursor to the origin.  Shift + C.
3. Center view to cursor.  Alt + Home.
4. Select the empty you made and snap the cursor to the selection.  Shift + S and then Snap to Selected in the menu.

Alternatively, (based off of Jonathan's answer), you could:

1. Add an empty at the origin.  Shift + A EmptyPlain Axes, then set the location to 0,0,0 in the redo menu (F6)
2. Center view to the Empty.  . (on the numpad.)

This second method is a lot faster and you only have to add an empty once, but the first one does help if you accidentally move the cursor position.

• +1 You could then make a script to do all this and also delete the empty at the end. May 27 '13 at 6:53

If you want to center the view to the current selection then you can use Numpad.. This will center the view and zoom to the current selection.

However this will not work if you do not have a selected object.

You could just press the Home button

• Hi, on this site, we appreciate answers with good detail. If you could at least explain what this does it would be helpful. May 30 '13 at 4:24
• This doesn't do quite what I'm looking for, since I want to move the view so that it is centered on the origin. What Home does is center the view around the bounding box center for all of the objects, which probably will not quite line up with the origin.
– Gwen
May 31 '13 at 3:54
• I found this very useful....thank you. Apr 12 '19 at 22:13

I don't mean to add a redundant answer, but to improve on what Jonathan said, I would suggest selecting all objects with A, then pressing ..

The reason for this is that sometimes when you select a particular object and then centre the view, it leaves some objects out of sight. If you want to be able to view everything in your scene as if you had pressed CTRL+C, you will need to select all the objects.

@Aldrick answer is great, but it doesn't work in case v3d.type != "VIEW_3D", like in my case where my addon is in the Graph panel. I could bypass this problem using the following script:

def center_view():
current_cursor_pos = tuple(bpy.context.scene.cursor_location)
bpy.context.scene.cursor_location = (0, 0, 0)
for v3d_context in get_view3d_context():
try:
bpy.ops.view3d.view_center_cursor(v3d_context)
break
except Exception as e:
print('Wrong context')
bpy.context.scene.cursor_location = current_cursor_pos

def get_view3d_context():
for screen in bpy.data.screens:
for area in screen.areas:
for region in area.regions:
if region.type == 'WINDOW':
override = bpy.context.copy()
override['area'] = area
override["region"] = region
yield override