Update for API change: scene.cursor_location -> scene.cursor.location

Note that some scripts still used the 3D view cursor which has been
removed for a while.
This commit is contained in:
Campbell Barton
2019-03-01 12:49:17 +11:00
parent dd0dffef42
commit 9999dada60
52 changed files with 123 additions and 123 deletions

View File

@ -49,14 +49,14 @@ class AlignVertices(Operator):
auto_m = context.scene.auto_mirror
bpy.ops.object.mode_set(mode='OBJECT')
x1, y1, z1 = bpy.context.scene.cursor_location
x1, y1, z1 = bpy.context.scene.cursor.location
bpy.ops.view3d.snap_cursor_to_selected()
x2, y2, z2 = bpy.context.scene.cursor_location
x2, y2, z2 = bpy.context.scene.cursor.location
bpy.context.scene.cursor_location[0], \
bpy.context.scene.cursor_location[1], \
bpy.context.scene.cursor_location[2] = 0, 0, 0
bpy.context.scene.cursor.location[0], \
bpy.context.scene.cursor.location[1], \
bpy.context.scene.cursor.location[2] = 0, 0, 0
# Vertices coordinate to 0 (local coordinate, so on the origin)
for vert in bpy.context.object.data.vertices:
@ -69,10 +69,10 @@ class AlignVertices(Operator):
axis = 2
vert.co[axis] = 0
bpy.context.scene.cursor_location = x2, y2, z2
bpy.context.scene.cursor.location = x2, y2, z2
bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
bpy.context.scene.cursor_location = x1, y1, z1
bpy.context.scene.cursor.location = x1, y1, z1
bpy.ops.object.mode_set(mode='EDIT')
return {'FINISHED'}