3
$\begingroup$

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

$\endgroup$
8
$\begingroup$

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)

$\endgroup$
  • $\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
  • $\begingroup$ There are very few events you can get with python api ( docs.blender.org/api/blender_python_api_2_61_release/… also good read: docs.blender.org/api/blender_python_api_2_71_release/… ), you'd have to poll cursor position yourself to know when position changed. $\endgroup$ – kilbee Mar 13 '17 at 10:52

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.