[Bf-extensions-cvs] [9999dada] master: Update for API change: scene.cursor_location -> scene.cursor.location

Campbell Barton noreply at git.blender.org
Fri Mar 1 02:52:14 CET 2019


Commit: 9999dada60a64eb27b37c4d711f4c3979888253e
Author: Campbell Barton
Date:   Fri Mar 1 12:49:17 2019 +1100
Branches: master
https://developer.blender.org/rBA9999dada60a64eb27b37c4d711f4c3979888253e

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.

===================================================================

M	add_advanced_objects_menu/add_mesh_aggregate.py
M	add_curve_extra_objects/add_curve_spirofit_bouncespline.py
M	add_curve_extra_objects/add_curve_torus_knots.py
M	add_curve_extra_objects/add_surface_plane_cone.py
M	add_curve_ivygen.py
M	add_curve_sapling/utils.py
M	add_mesh_extra_objects/Wallfactory.py
M	add_mesh_extra_objects/add_empty_as_parent.py
M	archimesh/achm_books_maker.py
M	archimesh/achm_column_maker.py
M	archimesh/achm_curtain_maker.py
M	archimesh/achm_door_maker.py
M	archimesh/achm_kitchen_maker.py
M	archimesh/achm_lamp_maker.py
M	archimesh/achm_main_panel.py
M	archimesh/achm_roof_maker.py
M	archimesh/achm_room_maker.py
M	archimesh/achm_shelves_maker.py
M	archimesh/achm_stairs_maker.py
M	archimesh/achm_tools.py
M	archimesh/achm_venetian_maker.py
M	archimesh/achm_window_maker.py
M	archimesh/achm_window_panel.py
M	archipack/archipack_autoboolean.py
M	archipack/archipack_door.py
M	archipack/archipack_fence.py
M	archipack/archipack_floor.py
M	archipack/archipack_reference_point.py
M	archipack/archipack_roof.py
M	archipack/archipack_slab.py
M	archipack/archipack_stair.py
M	archipack/archipack_truss.py
M	archipack/archipack_wall2.py
M	archipack/archipack_window.py
M	camera_turnaround.py
M	io_import_images_as_planes.py
M	io_scene_ms3d/ms3d_import.py
M	magic_uv/op/align_uv_cursor.py
M	measureit/measureit_main.py
M	mesh_auto_mirror.py
M	mesh_carver.py
M	mesh_extra_tools/mesh_edge_roundifier.py
M	mesh_extra_tools/mesh_select_tools/mesh_index_select.py
M	mesh_tiny_cad/CCEN.py
M	object_fracture/fracture_ops.py
M	object_fracture_cell/__init__.py
M	render_povray/primitives.py
M	space_view3d_math_vis/draw.py
M	space_view3d_pie_menus/pie_cursor.py
M	space_view3d_pie_menus/pie_origin.py
M	space_view3d_spacebar_menu.py
M	uv_texture_atlas.py

===================================================================

diff --git a/add_advanced_objects_menu/add_mesh_aggregate.py b/add_advanced_objects_menu/add_mesh_aggregate.py
index d86a9697..2665df13 100644
--- a/add_advanced_objects_menu/add_mesh_aggregate.py
+++ b/add_advanced_objects_menu/add_mesh_aggregate.py
@@ -247,7 +247,7 @@ class OBJECT_OT_agregate_mesh(Operator):
             msv.append(obj.modifiers[i].show_viewport)
             obj.modifiers[i].show_viewport = False
 
-        cur = scn.cursor_location
+        cur = scn.cursor.location
         for i in range(self.numP):
 
             mes = choice(par).data
@@ -310,7 +310,7 @@ class OBJECT_OT_agregate_mesh(Operator):
                 bpy.ops.object.join()
 
             if self.track:
-                cur = scn.cursor_location = cpom[1]
+                cur = scn.cursor.location = cpom[1]
 
         for i in range(len(msv)):
             obj.modifiers[i].show_viewport = msv[i]
diff --git a/add_curve_extra_objects/add_curve_spirofit_bouncespline.py b/add_curve_extra_objects/add_curve_spirofit_bouncespline.py
index 2b7ed914..b220157c 100644
--- a/add_curve_extra_objects/add_curve_spirofit_bouncespline.py
+++ b/add_curve_extra_objects/add_curve_spirofit_bouncespline.py
@@ -926,10 +926,10 @@ def move_origin_to_start():
         start = active.matrix_world @ spline.points[0].co
         start = start[:-1]
 
-    cursor = bpy.context.scene.cursor_location.copy()
-    bpy.context.scene.cursor_location = start
+    cursor = bpy.context.scene.cursor.location.copy()
+    bpy.context.scene.cursor.location = start
     bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
-    bpy.context.scene.cursor_location = cursor
+    bpy.context.scene.cursor.location = cursor
 
 
 def draw_spline_settings(self):
diff --git a/add_curve_extra_objects/add_curve_torus_knots.py b/add_curve_extra_objects/add_curve_torus_knots.py
index 30d19b58..8352ecfa 100644
--- a/add_curve_extra_objects/add_curve_torus_knots.py
+++ b/add_curve_extra_objects/add_curve_torus_knots.py
@@ -148,7 +148,7 @@ def align_matrix(self, context):
     if self.absolute_location:
         loc = Matrix.Translation(Vector((0, 0, 0)))
     else:
-        loc = Matrix.Translation(context.scene.cursor_location)
+        loc = Matrix.Translation(context.scene.cursor.location)
 
 # user defined location & translation
     userLoc = Matrix.Translation(self.location)
diff --git a/add_curve_extra_objects/add_surface_plane_cone.py b/add_curve_extra_objects/add_surface_plane_cone.py
index 94889f5b..2cd148d6 100644
--- a/add_curve_extra_objects/add_surface_plane_cone.py
+++ b/add_curve_extra_objects/add_surface_plane_cone.py
@@ -123,7 +123,7 @@ class MakeSurfaceWedge(Operator, MakeSurfaceHelpers):
         # change name
         context.active_object.name = 'SurfaceWedge'
         # get the wedge to the 3d cursor.
-        context.active_object.location = context.scene.cursor_location
+        context.active_object.location = context.scene.cursor.location
         bpy.ops.transform.resize(value=(size, size, size))
 
         # adjust resolution in u and v direction
@@ -186,7 +186,7 @@ class MakeSurfaceCone(Operator, MakeSurfaceHelpers):
         bpy.ops.object.editmode_toggle()
         # bring object to cursor
         bpy.ops.object.mode_set(mode='OBJECT')
-        context.active_object.location = context.scene.cursor_location
+        context.active_object.location = context.scene.cursor.location
         # adjust size
         bpy.ops.transform.resize(value=(size, size, size))
 
@@ -266,7 +266,7 @@ class MakeSurfaceStar(Operator, MakeSurfaceHelpers):
         # origin to geometry
         bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY', center='MEDIAN')
         # get object to 3d cursor
-        context.active_object.location = context.scene.cursor_location
+        context.active_object.location = context.scene.cursor.location
         # change name
         ao.name = 'SurfaceStar'
         # adjust size
@@ -334,7 +334,7 @@ class MakeSurfacePlane(Operator, MakeSurfaceHelpers):
 
         # bring object to 3d cursor
         bpy.ops.object.mode_set(mode='OBJECT')
-        context.active_object.location = context.scene.cursor_location
+        context.active_object.location = context.scene.cursor.location
         bpy.ops.transform.resize(value=(size, size, size))
 
         # adjust resolution in u and v direction
diff --git a/add_curve_ivygen.py b/add_curve_ivygen.py
index efb55f98..f4be17c7 100644
--- a/add_curve_ivygen.py
+++ b/add_curve_ivygen.py
@@ -528,7 +528,7 @@ class IvyGen(Operator):
         # radius = computeBoundingSphere(ob)  # Not needed anymore
 
         # Get the seeding point
-        seedPoint = context.scene.cursor_location
+        seedPoint = context.scene.cursor.location
 
         # Fix the random seed
         rand_seed(randomSeed)
diff --git a/add_curve_sapling/utils.py b/add_curve_sapling/utils.py
index 66ee91f6..5ea23001 100644
--- a/add_curve_sapling/utils.py
+++ b/add_curve_sapling/utils.py
@@ -1603,7 +1603,7 @@ def addTree(props):
     treeOb = bpy.data.objects.new('tree', cu)
     bpy.context.scene.collection.objects.link(treeOb)
 
-    # treeOb.location=bpy.context.scene.cursor_location attractUp
+    # treeOb.location=bpy.context.scene.cursor.location attractUp
 
     cu.dimensions = '3D'
     cu.fill_mode = 'FULL'
diff --git a/add_mesh_extra_objects/Wallfactory.py b/add_mesh_extra_objects/Wallfactory.py
index fa006774..8fb09e19 100644
--- a/add_mesh_extra_objects/Wallfactory.py
+++ b/add_mesh_extra_objects/Wallfactory.py
@@ -877,7 +877,7 @@ class add_mesh_wallb(Operator):
         context.view_layer.objects.active = ob_new
         ob_new.select_set(True)
 
-        ob_new.location = tuple(context.scene.cursor_location)
+        ob_new.location = tuple(context.scene.cursor.location)
         ob_new.rotation_quaternion = [1.0, 0.0, 0.0, 0.0]
 
         return {'FINISHED'}
diff --git a/add_mesh_extra_objects/add_empty_as_parent.py b/add_mesh_extra_objects/add_empty_as_parent.py
index 56334044..da4295ff 100644
--- a/add_mesh_extra_objects/add_empty_as_parent.py
+++ b/add_mesh_extra_objects/add_empty_as_parent.py
@@ -69,7 +69,7 @@ class P2E(Operator):
             pass
 
         if self.locat == 'CURSOR':
-            loc = sce.cursor_location
+            loc = sce.cursor.location
         elif self.locat == 'ACTIVE':
             loc = act.location
         else:
diff --git a/archimesh/achm_books_maker.py b/archimesh/achm_books_maker.py
index a3468be9..87373030 100644
--- a/archimesh/achm_books_maker.py
+++ b/archimesh/achm_books_maker.py
@@ -184,7 +184,7 @@ def create_book_mesh(self):
 # ------------------------------------------------------------------------------
 def generate_books(self):
     boxes = []
-    location = bpy.context.scene.cursor_location
+    location = bpy.context.scene.cursor.location
     myloc = copy(location)  # copy location to keep 3D cursor position
 
     # Create
diff --git a/archimesh/achm_column_maker.py b/archimesh/achm_column_maker.py
index d1680a9c..fdb30303 100644
--- a/archimesh/achm_column_maker.py
+++ b/archimesh/achm_column_maker.py
@@ -605,7 +605,7 @@ def create_circular_column(self, objname, radio_top, radio_mid, radio_bottom, he
     mesh = bpy.data.meshes.new(objname)
     myobject = bpy.data.objects.new(objname, mesh)
 
-    myobject.location = bpy.context.scene.cursor_location
+    myobject.location = bpy.context.scene.cursor.location
     bpy.context.collection.objects.link(myobject)
 
     mesh.from_pydata(myvertex, [], myfaces)
@@ -677,7 +677,7 @@ def create_torus(objname, radio_inside, radio_outside, height):
     mesh = bpy.data.meshes.new(objname)
     myobject = bpy.data.objects.new(objname, mesh)
 
-    myobject.location = bpy.context.scene.cursor_location
+    myobject.location = bpy.context.scene.cursor.location
     bpy.context.collection.objects.link(myobject)
 
     mesh.from_pydata(myvertex, [], myfaces)
@@ -726,7 +726,7 @@ def create_rectangular_base(self, objname, x, y, z, ramp=False):
     mesh = bpy.data.meshes.new(objname)
     myobject = bpy.data.objects.new(objname, mesh)
 
-    myobject.location = bpy.context.scene.cursor_location
+    myobject.location = bpy.context.scene.cursor.location
     bpy.context.collection.objects.link(myobject)
 
     mesh.from_pydata(myvertex, [], myfaces)
@@ -792,7 +792,7 @@ def create_arc(objname, radio, gap, thickness, center):
     mesh = bpy.data.meshes.new(objname)
     myobject = bpy.data.objects.new(objname, mesh)
 
-    myobject.location = bpy.context.scene.cursor_location
+    myobject.location = bpy.context.scene.cursor.location
     bpy.context.collection.objects.link(myobject)
 
     mesh.from_pydata(myvertex, [], myfaces)
diff --git a/archimesh/achm_curtain_maker.py b/archimesh/achm_curtain_maker.py
index 29740556..e0c9cc46 100644
--- a/archimesh/achm_curtain_maker.py
+++ b/archimesh/achm_curtain_maker.py
@@ -266,7 +266,7 @@ def generate_japan(self):
     support = []
     panel = []
 
-    location = bpy.context.scene.cursor_location
+    location = bpy.context.scene.cursor.location
     myloc = copy(location)  # copy location to keep 3D cursor position
 
     # ------------------
@@ -625,7 +625,7 @@ def create_bezier(objname, points, origin, depth=0.001, fill='FULL'):
 # All custom values are passed using self container (self.myvariable)
 # ------------------------------------------------------------------------------
 def generate_roller(self):
-    location = bpy.context.scene.cursor_location
+    location = bpy.context.scene.cursor.location
     myloc = copy(location)  # copy location to keep 3D cursor position
 
     # ------------------
diff --git a/archimesh/achm_door_maker.py b/archimesh/achm_door_maker.py
index 80a7a241..b7c468a7 100644
--- a/archimesh/achm_door_maker.py
+++ b/archimesh/achm_door_maker.py
@@ -76,7 +76,7 @@ def create_object(self, context):
     # we create main object and mesh
     mainmesh = bpy.data.meshes.new("DoorFrane")
     mainobject = bpy.data.objects.new("DoorFrame", mainmesh)
-    mainobject.location = bpy.context.scene.cursor_location
+    mainobject.location = bpy.context.scene.cursor.location
     bpy.context.collection.objects.link(mainobject)
     mainobject.DoorObjectGenerator.add()
 
@@ -601,7 +601,7 @@ def create_door_data(

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list