I am trying to set the 3D cursor to the center using a script, so that when it then imports an FBX it is based on that cursor location.

So far I have this:

import bpy

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':

But I get an error: Operator bpy.ops.view3d.view_all.poll() expected a view3d region

If there is a better way to set the 3D cursor then that would be nice. But if this is the best way, then can anybody help me mend my script?


Posting solution here, so that this is marked as Answered:

bpy.context.scene.cursor.location = 0,0,0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.