1

I just want to enter bpy.ops.view3d.snap_cursor_to_center() in my python console just to see how it works.

I am getting the error:

"RuntimeError: Operator bpy.ops.view3d.snap_cursor_to_center.poll() failed, context is incorrect".

I know I have to make sure my mouse cursor is hovering over the 3D viewport to execute this, but if move my mouse cursor over to the 3D viewport I can't press enter on the python console. This question sounds super stupid I know, but I just can't figure it out.

Inkplay_
  • 737
  • 1
  • 9
  • 23
  • 1
    Override the context. https://blender.stackexchange.com/questions/6101/poll-failed-context-incorrect-example-bpy-ops-view3d-background-image-add (probable duplicate) – batFINGER Apr 14 '19 at 16:24
  • Also related, there is no need to use that operator. https://blender.stackexchange.com/a/101892/15543 – batFINGER Apr 14 '19 at 16:49

0 Answers0