Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-01 04:49:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-01 04:51:10 +0300
commit9999dada60a64eb27b37c4d711f4c3979888253e (patch)
treeb325eb58ec754c883683696683933fc9d368eb0d /space_view3d_spacebar_menu.py
parentdd0dffef42ae64d1bf16e879e3f1470ce3bf5cad (diff)
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.
Diffstat (limited to 'space_view3d_spacebar_menu.py')
-rw-r--r--space_view3d_spacebar_menu.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/space_view3d_spacebar_menu.py b/space_view3d_spacebar_menu.py
index 18acb942..be900c42 100644
--- a/space_view3d_spacebar_menu.py
+++ b/space_view3d_spacebar_menu.py
@@ -2738,7 +2738,7 @@ def edgeIntersect(context, operator):
return
point = line[0].lerp(line[1], 0.5)
- context.scene.cursor_location = obj.matrix_world * point
+ context.scene.cursor.location = obj.matrix_world * point
# Cursor Edge Intersection Operator #
@@ -2789,16 +2789,16 @@ class SetObjectMode(Operator):
# Origin To Selected Edit Mode #
def vfeOrigin(context):
try:
- cursorPositionX = context.scene.cursor_location[0]
- cursorPositionY = context.scene.cursor_location[1]
- cursorPositionZ = context.scene.cursor_location[2]
+ cursorPositionX = context.scene.cursor.location[0]
+ cursorPositionY = context.scene.cursor.location[1]
+ cursorPositionZ = context.scene.cursor.location[2]
bpy.ops.view3d.snap_cursor_to_selected()
bpy.ops.object.mode_set()
bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
bpy.ops.object.mode_set(mode='EDIT')
- context.scene.cursor_location[0] = cursorPositionX
- context.scene.cursor_location[1] = cursorPositionY
- context.scene.cursor_location[2] = cursorPositionZ
+ context.scene.cursor.location[0] = cursorPositionX
+ context.scene.cursor.location[1] = cursorPositionY
+ context.scene.cursor.location[2] = cursorPositionZ
return True
except:
return False
@@ -2834,7 +2834,7 @@ class SnapCursSelToCenter(Operator):
return (context.area.type == "VIEW_3D" and context.mode == "OBJECT")
def execute(self, context):
- context.space_data.cursor_location = (0, 0, 0)
+ context.scene.cursor.location = (0, 0, 0)
for obj in context.selected_objects:
obj.location = (0, 0, 0)
return {'FINISHED'}