In View from Top screen, I want get location 3Dcursor by script, when i click change 3dcursor point. Can you help me.

thank you so much!

enter image description here


You can get the cursor location using bpy.context.scene.cursor_location

to change the cursor location you just set its values as shown here bpy.context.scene.cursor_location = (0,0,0)

In blender 2.80+, the syntax is :

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

  • $\begingroup$ Thank Tak, You have event click change cursor_location? when click other position, get new cursor location $\endgroup$ – kapigon Mar 13 '17 at 9:41
  • $\begingroup$ @LdHòa I've updated my answer. If you want to set the cursor_location then you set it using bpy.context.scene.cursor_location = (0,0,0) $\endgroup$ – Tak Mar 13 '17 at 9:42
  • $\begingroup$ I saw your answer. I want to find event when mouser click change position in View from Top screen -> print new cursor_location. $\endgroup$ – kapigon Mar 13 '17 at 9:47
  • $\begingroup$ @LdHòa I'm not sure what you mean, this bpy.context.scene.cursor_location will give you the current location of the cursor shown in the 3D Cursor location panel $\endgroup$ – Tak Mar 13 '17 at 9:50
  • 1
    $\begingroup$ fyi In Blender 2.8 it is: bpy.context.scene.cursor Docs $\endgroup$ – mikechambers Jul 25 '19 at 17:45

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.