0

Observing the manual informs that it is possible to reset the projection but could not reset the position of the cursor in the UV Map.

bpy.ops.uv.cursor_set(location=(0.0, 0.0))

Location, Cursor location in normalized (0.0-1.0) coordinates

https://docs.blender.org/api/blender_python_api_current/bpy.ops.uv.html

Martynas Žiemys
  • 24,274
  • 2
  • 34
  • 77
Júnior
  • 207
  • 1
  • 10

1 Answers1

1

It is possible to adjust cursor from another context with the following snippet:

import bpy
ob = bpy.context.active_object
for area in bpy.context.screen.areas:
    if area.type == 'IMAGE_EDITOR':   #find the UVeditor
        cursor = area.spaces.active.cursor_location   # get cursor location
        area.spaces.active.cursor_location.x = 0.5*1024;
        area.spaces.active.cursor_location.y = 0.5*1024;

Because you want to normalize in the (0.0,1.0) interval you will have to actually multiply this with the texture size (in my example hardcoded 1024 number).

Arise
  • 111
  • 3