0
$\begingroup$

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':
        bpy.ops.view3d.view_all(center=True)

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?

$\endgroup$
2

1 Answer 1

1
$\begingroup$

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

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

$\endgroup$

You must log in to answer this question.

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