diff --git a/add_advanced_objects_menu/add_mesh_aggregate.py b/add_advanced_objects_menu/add_mesh_aggregate.py index d86a969718c67bde2232e1638ecfb36e5f9b4e53..2665df139bb1a1b245775f9f0309c9f0d631c249 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 2b7ed914cd7f9982be3d6aa23b2369cb03998060..b220157c5b5dd261a8f044002565848e262da608 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 30d19b5836e3c5a25fbd4b270b1c0efef2bd26ed..8352ecfaf19562dfff566247909c9a51cc2447f4 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 94889f5b995b8eab4a74a1c199782751e0146437..2cd148d6a7bb80155618c0da1a1b59a9b733fc89 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 efb55f983cf226748b0c14a18f5acae5e79c7aed..f4be17c7edb06842aa0248772df46f6ff731bb5a 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 66ee91f6a5844fdc727dec6f17128a9d6521caab..5ea23001e4ca8d8a4f57cea0d80fd142ae549838 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 fa006774fb06b9333d7e4805f589cee2bd5495b2..8fb09e19dc784f193b3bb530bfda50a3ae9dfdc2 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 563340446331c45652be6f6d5193d3f6e00151d5..da4295ffde6cb10e71f2651f4c7aa98dc535b332 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 a3468be986407ad46a1a99d432a12b1c3f7f230e..873730306e50ffc924d6600fe648b8e5cd13cb5c 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 d1680a9cc503a4adcf65743c4b613dfa47436b09..fdb3030371434b83443083a1657872d2f8a5928c 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 297405562026ac595e6767e3742f68d8865222ae..e0c9cc465bb095f3ea2fe5d5c23b87c31f00db8f 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 80a7a2410c21df06cf5b61826224699a9407ae3b..b7c468a75694169bdda994fa13376740b9bf1677 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(self, myframe, width, openside): mymesh = bpy.data.meshes.new("Door") myobject = bpy.data.objects.new("Door", mymesh) - myobject.location = bpy.context.scene.cursor_location + myobject.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(myobject) mymesh.from_pydata(verts, [], faces) @@ -653,7 +653,7 @@ def create_handle(self, mydoor, pos, frame_width, openside): mymesh = bpy.data.meshes.new("Handle_" + pos) myobject = bpy.data.objects.new("Handle_" + pos, mymesh) - myobject.location = bpy.context.scene.cursor_location + myobject.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(myobject) mymesh.from_pydata(verts, [], faces) diff --git a/archimesh/achm_kitchen_maker.py b/archimesh/achm_kitchen_maker.py index 14860f739f5a62ac0dbb89f4579f99b0f7bca41e..ad3e1123ad06751cb08dbc06c6daf2a3cc1ba0fd 100644 --- a/archimesh/achm_kitchen_maker.py +++ b/archimesh/achm_kitchen_maker.py @@ -629,7 +629,7 @@ def generate_cabinets(self): boxes = [] bases = [] - location = bpy.context.scene.cursor_location + location = bpy.context.scene.cursor.location myloc = copy(location) # copy location to keep 3D cursor position # Fit to floor if self.fitZ: diff --git a/archimesh/achm_lamp_maker.py b/archimesh/achm_lamp_maker.py index ea661d5f752105c3d61fff6e069d0d312699c415..09e30747d5635f31062ecdc4873e9fc4e42cc9af 100644 --- a/archimesh/achm_lamp_maker.py +++ b/archimesh/achm_lamp_maker.py @@ -412,7 +412,7 @@ def create_light_mesh(self): # All custom values are passed using self container (self.myvariable) # ------------------------------------------------------------------------------ def generate_light(self): - location = bpy.context.scene.cursor_location + location = bpy.context.scene.cursor.location myloc = copy(location) # copy location to keep 3D cursor position # --------------------- # Lamp base diff --git a/archimesh/achm_main_panel.py b/archimesh/achm_main_panel.py index 47287a5806e603924661553d0c8f62030b611e32..0db6bbd416b55b1643a69d21bdf53fe1bdc23935 100644 --- a/archimesh/achm_main_panel.py +++ b/archimesh/achm_main_panel.py @@ -341,9 +341,9 @@ class ARCHIMESH_OT_Pencil(Operator): # ---------------------------- if len(mypoints) > 1 and len(clearangles) > 0: # Move cursor - bpy.context.scene.cursor_location.x = mypoints[0][0] - bpy.context.scene.cursor_location.y = mypoints[0][1] - bpy.context.scene.cursor_location.z = 0 # always on grid floor + bpy.context.scene.cursor.location.x = mypoints[0][0] + bpy.context.scene.cursor.location.y = mypoints[0][1] + bpy.context.scene.cursor.location.z = 0 # always on grid floor # Add room mesh bpy.ops.mesh.archimesh_room() diff --git a/archimesh/achm_roof_maker.py b/archimesh/achm_roof_maker.py index 7de38df7755997c1a4a618c3990591381879c21d..846b1f50665f06d0e723658c4824af39cae1de15 100644 --- a/archimesh/achm_roof_maker.py +++ b/archimesh/achm_roof_maker.py @@ -242,7 +242,7 @@ def create_roof(self): mymesh = bpy.data.meshes.new("Roof") myobject = bpy.data.objects.new("Roof", mymesh) - myobject.location = bpy.context.scene.cursor_location + myobject.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(myobject) mymesh.from_pydata(verts, [], faces) diff --git a/archimesh/achm_room_maker.py b/archimesh/achm_room_maker.py index 2cdd1510a97bda936aa9a1aa3707b86d3d953aaf..702f9c0d6347c3977ac2af6d672b3aecddd38707 100644 --- a/archimesh/achm_room_maker.py +++ b/archimesh/achm_room_maker.py @@ -354,7 +354,7 @@ def create_room(self, context): # we create main object and mesh for walls roommesh = bpy.data.meshes.new("Room") roomobject = bpy.data.objects.new("Room", roommesh) - roomobject.location = bpy.context.scene.cursor_location + roomobject.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(roomobject) roomobject.RoomGenerator.add() roomobject.RoomGenerator[0].walls.add() diff --git a/archimesh/achm_shelves_maker.py b/archimesh/achm_shelves_maker.py index 53595da25c1c6263d223b085babab7716f60716e..0f04124ed549ae6b129336e02dce4bf2554fdd1c 100644 --- a/archimesh/achm_shelves_maker.py +++ b/archimesh/achm_shelves_maker.py @@ -278,7 +278,7 @@ def create_shelves_mesh(self): def generate_shelves(self): boxes = [] - location = bpy.context.scene.cursor_location + location = bpy.context.scene.cursor.location myloc = copy(location) # copy location to keep 3D cursor position # Fit to floor if self.fitZ: diff --git a/archimesh/achm_stairs_maker.py b/archimesh/achm_stairs_maker.py index 9459d5d90f1d1127e0a7731876c80b9da110721c..b8688e73ddf9a67749133da3d462552856f0d37b 100644 --- a/archimesh/achm_stairs_maker.py +++ b/archimesh/achm_stairs_maker.py @@ -273,7 +273,7 @@ def create_stairs(self, objname): 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_tools.py b/archimesh/achm_tools.py index 3a7755168e7aef1ee9abb67809dfd4743e368854..78eae826c16bc6a3e73ea2b1450a5e01804ecbc7 100644 --- a/archimesh/achm_tools.py +++ b/archimesh/achm_tools.py @@ -922,7 +922,7 @@ def create_control_box(objname, x, y, z, tube=True): 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_venetian_maker.py b/archimesh/achm_venetian_maker.py index dbf769706d0dcc2dcb07e06d4acc59b0a527a809..5ef9a9bc4a81c3aa292dc37b0d5a9fa3a83e692c 100644 --- a/archimesh/achm_venetian_maker.py +++ b/archimesh/achm_venetian_maker.py @@ -76,7 +76,7 @@ def create_object(self, context): # we create main object and mesh mainmesh = bpy.data.meshes.new("VenetianFrane") mainobject = bpy.data.objects.new("VenetianFrame", mainmesh) - mainobject.location = bpy.context.scene.cursor_location + mainobject.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(mainobject) mainobject.VenetianObjectGenerator.add() @@ -517,7 +517,7 @@ def create_slat_mesh(objname, width, depth, height, angle, ratio): 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) @@ -643,7 +643,7 @@ def create_venetian_base(objname, x, y, z): 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) @@ -808,7 +808,7 @@ def get_venetian_stick(objname, 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) @@ -1374,7 +1374,7 @@ def get_venetian_strings(objname, 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) diff --git a/archimesh/achm_window_maker.py b/archimesh/achm_window_maker.py index bf16411d8c2fead4ff6d3810a80fe73ff9817a88..3e1b5ac9e4044c826a014c1b412f19857e72f15b 100644 --- a/archimesh/achm_window_maker.py +++ b/archimesh/achm_window_maker.py @@ -76,7 +76,7 @@ def create_object(self, context): # we create main object and mesh mainmesh = bpy.data.meshes.new("WindowFrane") mainobject = bpy.data.objects.new("WindowFrame", mainmesh) - mainobject.location = bpy.context.scene.cursor_location + mainobject.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(mainobject) mainobject.WindowObjectGenerator.add() @@ -526,7 +526,7 @@ class ARCHIMESH_PT_WindowObjectgenerator(Panel): # Generate rail windows # ------------------------------------------------------------------------------ def generate_rail_window(myframe, mp, mymesh): - myloc = bpy.context.scene.cursor_location + myloc = bpy.context.scene.cursor.location alummat = None if mp.crt_mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: @@ -617,7 +617,7 @@ def generate_rail_window(myframe, mp, mymesh): # Generate leaf windows # ------------------------------------------------------------------------------ def generate_leaf_window(myframe, mp, mymesh): - myloc = bpy.context.scene.cursor_location + myloc = bpy.context.scene.cursor.location alummat = None if mp.crt_mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: @@ -1750,7 +1750,7 @@ def create_leaf_handle(objname, mat): 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) @@ -2091,7 +2091,7 @@ def create_rail_handle(objname, mat): 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) @@ -2129,7 +2129,7 @@ def create_sill(objname, x, y, z, mat): 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) @@ -2167,7 +2167,7 @@ def create_blind_box(objname, x, y, z): 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_window_panel.py b/archimesh/achm_window_panel.py index faf183853b42d07ea900148e60ddca215ebfe156..30429070bc01aa76811a9520cc29c6440fa35ab7 100644 --- a/archimesh/achm_window_panel.py +++ b/archimesh/achm_window_panel.py @@ -239,7 +239,7 @@ def create_window(): # Link object to scene bpy.context.collection.objects.link(window_object) window_object.WindowPanelGenerator.add() - window_object.location = bpy.context.scene.cursor_location + window_object.location = bpy.context.scene.cursor.location # Shape the mesh. do_mesh(window_object, window_mesh) @@ -1540,7 +1540,7 @@ def create_ctrl_box(parentobj, objname): mymesh = bpy.data.meshes.new(objname) myobj = bpy.data.objects.new(objname, mymesh) - myobj.location = bpy.context.scene.cursor_location + myobj.location = bpy.context.scene.cursor.location bpy.context.collection.objects.link(myobj) mymesh.from_pydata(myvertex, [], myfaces) diff --git a/archipack/archipack_autoboolean.py b/archipack/archipack_autoboolean.py index 8e4df558b97445fadd931d19042d8765aaff4d7b..7d8a90a62ae4510b816eab534897b7382d184829 100644 --- a/archipack/archipack_autoboolean.py +++ b/archipack/archipack_autoboolean.py @@ -422,7 +422,7 @@ class ArchipackBoolManager(ArchipackCollectionManager): # parenting childs to wall reference point if wall.parent is None: x, y, z = wall.bound_box[0] - context.scene.cursor_location = wall.matrix_world @ Vector((x, y, z)) + context.scene.cursor.location = wall.matrix_world @ Vector((x, y, z)) # fix issue #9 context.view_layer.objects.active = wall bpy.ops.archipack.reference_point() @@ -505,7 +505,7 @@ class ArchipackBoolManager(ArchipackCollectionManager): # parenting childs to wall reference point if wall.parent is None: x, y, z = wall.bound_box[0] - context.scene.cursor_location = wall.matrix_world @ Vector((x, y, z)) + context.scene.cursor.location = wall.matrix_world @ Vector((x, y, z)) # fix issue #9 context.view_layer.objects.active = wall bpy.ops.archipack.reference_point() diff --git a/archipack/archipack_door.py b/archipack/archipack_door.py index 03e3d5e1e14d346adacf81b9d81214c13f822683..98ca10689524516aabd0e248d767bf4a27d42e92 100644 --- a/archipack/archipack_door.py +++ b/archipack/archipack_door.py @@ -1624,7 +1624,7 @@ class ARCHIPACK_OT_door(ArchipackCreateTool, Operator): if self.mode == 'CREATE': bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = bpy.context.scene.cursor_location + o.location = bpy.context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() diff --git a/archipack/archipack_fence.py b/archipack/archipack_fence.py index 7af93df3ff38dfe06e64b84e165da20ecbbf7252..3630e00e6ef8315ba8eaadb15f7fea865f1b73d7 100644 --- a/archipack/archipack_fence.py +++ b/archipack/archipack_fence.py @@ -1631,7 +1631,7 @@ class ARCHIPACK_OT_fence(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() diff --git a/archipack/archipack_floor.py b/archipack/archipack_floor.py index 5a5bc66fb8e579f49cf2fbdf0e5c9521ddd439d7..23a10b32a89264a0d6a95d7055c66f777ed0c156 100644 --- a/archipack/archipack_floor.py +++ b/archipack/archipack_floor.py @@ -1830,7 +1830,7 @@ class ARCHIPACK_OT_floor(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location # activate manipulators at creation time o.select_set(state=True) context.view_layer.objects.active = o @@ -1978,7 +1978,7 @@ class ARCHIPACK_OT_floor_cutter(ArchipackCreateTool, Operator): pd = archipack_floor.datablock(parent) pd.boundary = o.name else: - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location # make manipulators selectable d.manipulable_selectable = True self.link_object_to_scene(context, o) diff --git a/archipack/archipack_reference_point.py b/archipack/archipack_reference_point.py index 0b0c03481c4d25364b49cafa9e4f7d01a3103adc..99acf9d86c41b5f5c057ed88b497ba9107a7ce41 100644 --- a/archipack/archipack_reference_point.py +++ b/archipack/archipack_reference_point.py @@ -230,7 +230,7 @@ class ARCHIPACK_OT_reference_point(ArchipackCollectionManager, Operator): row.label(text="Use Properties panel (N) to define parms", icon='INFO') def create(self, context): - x, y, z = context.scene.cursor_location + x, y, z = context.scene.cursor.location # bpy.ops.object.empty_add(type='ARROWS', radius=0.5, location=Vector((x, y, 0))) m = bpy.data.meshes.new(name="Reference") o = bpy.data.objects.new("Reference", m) diff --git a/archipack/archipack_roof.py b/archipack/archipack_roof.py index 477a3ce64df986284cf87a711f437113b4befd51..4e8b9471e5c3e391f83b2c7eff710ffb7aed7ec6 100644 --- a/archipack/archipack_roof.py +++ b/archipack/archipack_roof.py @@ -5049,7 +5049,7 @@ class ARCHIPACK_OT_roof(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() @@ -5101,7 +5101,7 @@ class ARCHIPACK_OT_roof_cutter(ArchipackCreateTool, Operator): pd = archipack_roof.datablock(parent) pd.boundary = o.name else: - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location # make manipulators selectable d.manipulable_selectable = True self.link_object_to_scene(context, o) diff --git a/archipack/archipack_slab.py b/archipack/archipack_slab.py index 3c0d513cb312391ddae5417cd6ac081a2651b572..897686daf67607f7ab025f33969957aca780bb3f 100644 --- a/archipack/archipack_slab.py +++ b/archipack/archipack_slab.py @@ -1466,7 +1466,7 @@ class ARCHIPACK_OT_slab(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = bpy.context.scene.cursor_location + o.location = bpy.context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() @@ -1578,7 +1578,7 @@ class ARCHIPACK_OT_slab_from_wall(Operator): # parenting childs to wall reference point if wall.parent is None: x, y, z = wall.bound_box[0] - context.scene.cursor_location = wall.matrix_world @ Vector((x, y, z)) + context.scene.cursor.location = wall.matrix_world @ Vector((x, y, z)) # fix issue #9 context.view_layer.objects.active = wall bpy.ops.archipack.reference_point() @@ -1651,7 +1651,7 @@ class ARCHIPACK_OT_slab_cutter(ArchipackCreateTool, Operator): pd = archipack_slab.datablock(parent) pd.boundary = o.name else: - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location # make manipulators selectable d.manipulable_selectable = True self.link_object_to_scene(context, o) diff --git a/archipack/archipack_stair.py b/archipack/archipack_stair.py index 5f3fcf1ff7fbbfafb5b231487e90f8ff451728f7..9fbcdfe2436af965505f968ffe4184788b40603c 100644 --- a/archipack/archipack_stair.py +++ b/archipack/archipack_stair.py @@ -2768,7 +2768,7 @@ class ARCHIPACK_OT_stair(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = context.scene.cursor_location + o.location = context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() diff --git a/archipack/archipack_truss.py b/archipack/archipack_truss.py index 2931717a7ccd1e9e7d1b2bcceaeca03538e12aeb..04cc0d96acd2f397c31ea37ad10d1a0b8e0e5f51 100644 --- a/archipack/archipack_truss.py +++ b/archipack/archipack_truss.py @@ -333,7 +333,7 @@ class ARCHIPACK_OT_truss(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = bpy.context.scene.cursor_location + o.location = bpy.context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() diff --git a/archipack/archipack_wall2.py b/archipack/archipack_wall2.py index 1eb3ff804fa2c1b59a74af5dd01554d58be9d2b8..8e3bfb43cd98a0c5097aeff3246444c726e2b902 100644 --- a/archipack/archipack_wall2.py +++ b/archipack/archipack_wall2.py @@ -449,7 +449,7 @@ def update_t_part(self, context): if o.parent is None: # create a reference point and make it active x, y, z = w.bound_box[0] - context.scene.cursor_location = w.matrix_world @ Vector((x, y, z)) + context.scene.cursor.location = w.matrix_world @ Vector((x, y, z)) # fix issue #9 context.view_layer.objects.active = o bpy.ops.archipack.reference_point() @@ -1781,7 +1781,7 @@ class ARCHIPACK_OT_wall2(ArchipackCreateTool, Operator): if context.mode == "OBJECT": bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = bpy.context.scene.cursor_location + o.location = bpy.context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() @@ -1886,7 +1886,7 @@ class ARCHIPACK_OT_wall2_from_slab(Operator): # parenting childs to wall reference point if o.parent is None: x, y, z = o.bound_box[0] - context.scene.cursor_location = o.matrix_world @ Vector((x, y, z)) + context.scene.cursor.location = o.matrix_world @ Vector((x, y, z)) # fix issue #9 context.view_layer.objects.active = o bpy.ops.archipack.reference_point() diff --git a/archipack/archipack_window.py b/archipack/archipack_window.py index 74d687dcd5167e2cb9d4759e6f3ef4e0391a835b..7788eafeaa00f38c82a22fdcfe09f2e81f6efb84 100644 --- a/archipack/archipack_window.py +++ b/archipack/archipack_window.py @@ -1815,7 +1815,7 @@ class ARCHIPACK_OT_window(ArchipackCreateTool, Operator): if self.mode == 'CREATE': bpy.ops.object.select_all(action="DESELECT") o = self.create(context) - o.location = bpy.context.scene.cursor_location + o.location = bpy.context.scene.cursor.location o.select_set(state=True) context.view_layer.objects.active = o self.manipulate() diff --git a/camera_turnaround.py b/camera_turnaround.py index 0a30d922852597d82b884e3cb9c33c2f98ea4b37..e5581b35356756d9b3b9c13f7e24df8d09f26adb 100644 --- a/camera_turnaround.py +++ b/camera_turnaround.py @@ -59,7 +59,7 @@ class CAMERATURN_OT_RunAction(Operator): turn_camera = scene.turn_camera selectobject = context.active_object camera = context.scene.camera - savedcursor = bpy.context.scene.cursor_location.copy() # cursor position + savedcursor = bpy.context.scene.cursor.location.copy() # cursor position savedframe = scene.frame_current if turn_camera.use_cursor is False: bpy.ops.view3d.snap_cursor_to_selected() @@ -166,7 +166,7 @@ class CAMERATURN_OT_RunAction(Operator): # back previous configuration context.preferences.edit.keyframe_new_interpolation_type = savedinterpolation - bpy.context.scene.cursor_location = savedcursor + bpy.context.scene.cursor.location = savedcursor # ------------------------- # Back to old selection diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 26e7ee861a954d056f327d22ae5248880aaee32f..fdff36032c925245af8caec375937d7620dfad40 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -1072,7 +1072,7 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper): elif self.size_mode == 'CAMERA': x, y = compute_camera_size( - context, context.scene.cursor_location, + context, context.scene.cursor.location, self.fill_mode, px / py ) diff --git a/io_scene_ms3d/ms3d_import.py b/io_scene_ms3d/ms3d_import.py index 01019a1284379b4d6d7901ee3ff9a9804b2fbe69..ae6f16476192f7c7b6586c94c7b76a3e088d6d6f 100644 --- a/io_scene_ms3d/ms3d_import.py +++ b/io_scene_ms3d/ms3d_import.py @@ -239,7 +239,7 @@ class Ms3dImporter(): FORMAT_GROUP.format(ms3d_model.name)) blender_empty_object = blender_context.blend_data.objects.new( FORMAT_EMPTY_OBJECT.format(ms3d_model.name), None) - blender_empty_object.location = blender_scene.cursor_location + blender_empty_object.location = blender_scene.cursor.location blender_collection.objects.link(blender_empty_object) blender_group.objects.link(blender_empty_object) @@ -288,7 +288,7 @@ class Ms3dImporter(): blender_collection = blender_context.collection blender_view_layer = blender_context.view_layer blender_collection.objects.link(blender_mesh_object) - #blender_mesh_object.location = blender_scene.cursor_location + #blender_mesh_object.location = blender_scene.cursor.location enable_edit_mode(False, blender_context) select_all(False) blender_mesh_object.select_set(True) @@ -699,7 +699,7 @@ class Ms3dImporter(): blender_armature_object = blender_context.blend_data.objects.new( ms3d_armature_object_name, blender_armature) blender_collection.objects.link(blender_armature_object) - #blender_armature_object.location = blender_scene.cursor_location + #blender_armature_object.location = blender_scene.cursor.location blender_armature_object.show_in_front = True ########################## diff --git a/magic_uv/op/align_uv_cursor.py b/magic_uv/op/align_uv_cursor.py index 86d13179f553a7270caea8963040bc69f01e1b6d..24c111d0f82279d19697fc64a30e1bfa509cc828 100644 --- a/magic_uv/op/align_uv_cursor.py +++ b/magic_uv/op/align_uv_cursor.py @@ -60,7 +60,7 @@ class _Properties: bd_size = common.get_uvimg_editor_board_size(area) else: bd_size = [1.0, 1.0] - loc = space.cursor_location + loc = space.cursor.location if bd_size[0] < 0.000001: cx = 0.0 @@ -84,7 +84,7 @@ class _Properties: bd_size = [1.0, 1.0] cx = bd_size[0] * value[0] cy = bd_size[1] * value[1] - space.cursor_location = Vector((cx, cy)) + space.cursor.location = Vector((cx, cy)) scene.muv_align_uv_cursor_enabled = BoolProperty( name="Align UV Cursor Enabled", @@ -264,6 +264,6 @@ class MUV_OT_AlignUVCursor(bpy.types.Operator): cx = cx * bd_size[0] cy = cy * bd_size[1] - space.cursor_location = Vector((cx, cy)) + space.cursor.location = Vector((cx, cy)) return {'FINISHED'} diff --git a/measureit/measureit_main.py b/measureit/measureit_main.py index d6e14dc7d74a89bb62f899a15cd8f105db0479e4..43ae6d223adac711a86581675ae7c7b14c5f9384 100644 --- a/measureit/measureit_main.py +++ b/measureit/measureit_main.py @@ -1824,7 +1824,7 @@ class MEASUREIT_OT_AddNote(Operator): if context.area.type == 'VIEW_3D': bpy.ops.object.empty_add(type='PLAIN_AXES') myempty = bpy.data.objects[bpy.context.active_object.name] - myempty.location = bpy.context.scene.cursor_location + myempty.location = bpy.context.scene.cursor.location myempty.empty_display_size = 0.01 myempty.name = "Annotation" # Add properties diff --git a/mesh_auto_mirror.py b/mesh_auto_mirror.py index c17838d5a57ed16e7e0aa72a0004e0563e547433..68193c1a44a1e135af032e39276fab68d5c92a29 100644 --- a/mesh_auto_mirror.py +++ b/mesh_auto_mirror.py @@ -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'} diff --git a/mesh_carver.py b/mesh_carver.py index d920ee9adccfb973628a6ae185edee61868b0166..1ee3755ee42dfffd0f5a8550778ca4fc063af33f 100644 --- a/mesh_carver.py +++ b/mesh_carver.py @@ -1332,7 +1332,7 @@ def CreateCutSquare(self, context): depthLocation = region_2d_to_vector_3d(region, rv3d, coord) self.ViewVector = depthLocation if self.snapCursor: - PlanePoint = context.scene.cursor_location + PlanePoint = context.scene.cursor.location else: PlanePoint = self.OpsObj.location if self.OpsObj is not None else Vector((0.0, 0.0, 0.0)) @@ -1402,7 +1402,7 @@ def CreateCutLine(self, context): depthLocation = region_2d_to_vector_3d(region, rv3d, coord) self.ViewVector = depthLocation - PlanePoint = context.scene.cursor_location if self.snapCursor else Vector((0.0, 0.0, 0.0)) + PlanePoint = context.scene.cursor.location if self.snapCursor else Vector((0.0, 0.0, 0.0)) PlaneNormal = depthLocation PlaneNormalised = PlaneNormal.normalized() @@ -1501,7 +1501,7 @@ def CreateCutCircle(self, context): depthLocation = region_2d_to_vector_3d(region, rv3d, coord) self.ViewVector = depthLocation - PlanePoint = context.scene.cursor_location if self.snapCursor else Vector((0.0, 0.0, 0.0)) + PlanePoint = context.scene.cursor.location if self.snapCursor else Vector((0.0, 0.0, 0.0)) PlaneNormal = depthLocation PlaneNormalised = PlaneNormal.normalized() @@ -1740,14 +1740,14 @@ def Picking(context, event): hit_world = matrix * hit length_squared = (hit_world - ray_origin).length_squared if best_obj is None or length_squared < best_length_squared: - scene.cursor_location = hit_world + scene.cursor.location = hit_world best_length_squared = length_squared best_obj = obj else: if best_obj is None: depthLocation = region_2d_to_vector_3d(region, rv3d, coord) loc = region_2d_to_location_3d(region, rv3d, coord, depthLocation) - scene.cursor_location = loc + scene.cursor.location = loc def CreatePrimitive(self, _AngleStep, _radius): @@ -3168,13 +3168,13 @@ class Carver(bpy.types.Operator): bpy.ops.mesh.normals_make_consistent() bpy.ops.object.mode_set(mode='OBJECT') - saved_location_0 = context.scene.cursor_location.copy() + saved_location_0 = context.scene.cursor.location.copy() bpy.ops.view3d.snap_cursor_to_active() - saved_location = context.scene.cursor_location.copy() + saved_location = context.scene.cursor.location.copy() bpy.ops.object.transform_apply(location=True, rotation=True, scale=True) - context.scene.cursor_location = saved_location + context.scene.cursor.location = saved_location bpy.ops.object.origin_set(type='ORIGIN_CURSOR') - context.scene.cursor_location = saved_location_0 + context.scene.cursor.location = saved_location_0 bpy.data.objects[self.CurrentObj.name].select_set(True) bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY') @@ -3203,7 +3203,7 @@ class Carver(bpy.types.Operator): bpy.ops.view3d.localview() # Save cursor position - CursorLocation = context.scene.cursor_location.copy() + CursorLocation = context.scene.cursor.location.copy() ActiveObjList = [] if (self.ObjectMode is False) and (self.ProfileMode is False): @@ -3250,7 +3250,7 @@ class Carver(bpy.types.Operator): lastSelected = [] for ActiveObj in ActiveObjList: - context.scene.cursor_location = CursorLocation + context.scene.cursor.location = CursorLocation if len(context.selected_objects) > 0: bpy.ops.object.select_all(action='TOGGLE') @@ -3322,12 +3322,12 @@ class Carver(bpy.types.Operator): CreateBevel(context, context.selected_objects[0]) UndoAdd(self, "REBOOL", context.selected_objects[0]) - context.scene.cursor_location = ActiveObj.location + context.scene.cursor.location = ActiveObj.location bpy.ops.object.origin_set(type='ORIGIN_CURSOR') else: bpy.ops.object.delete(use_global=False) - context.scene.cursor_location = CursorLocation + context.scene.cursor.location = CursorLocation if self.ObjectMode: context.view_layer.objects.active = self.ObjectBrush @@ -3351,7 +3351,7 @@ class Carver(bpy.types.Operator): # Get the last object selected lastSelected.append(context.selected_objects[0]) - context.scene.cursor_location = CursorLocation + context.scene.cursor.location = CursorLocation if self.DontApply is False: # Remove cut object diff --git a/mesh_extra_tools/mesh_edge_roundifier.py b/mesh_extra_tools/mesh_edge_roundifier.py index 3199624534e9a45fbc07638509f0b1941a0d286f..6304f7b67076c39ac27143923bd7bda572930e8f 100644 --- a/mesh_extra_tools/mesh_edge_roundifier.py +++ b/mesh_extra_tools/mesh_edge_roundifier.py @@ -1065,7 +1065,7 @@ class EdgeRoundifier(Operator): if parameters["refObject"] == "ORG": refObjectLocation = [0, 0, 0] elif parameters["refObject"] == "CUR": - refObjectLocation = bpy.context.scene.cursor_location - objectLocation + refObjectLocation = bpy.context.scene.cursor.location - objectLocation else: refObjectLocation = self.calc.getEdgeReference(edge, edgeCenter, parameters["plane"]) diff --git a/mesh_extra_tools/mesh_select_tools/mesh_index_select.py b/mesh_extra_tools/mesh_select_tools/mesh_index_select.py index 16c912db34cb904ba2537e694d3c42e402207526..a9e14dfe2190f87e5abb13b3df1902f9b5b18d58 100644 --- a/mesh_extra_tools/mesh_select_tools/mesh_index_select.py +++ b/mesh_extra_tools/mesh_select_tools/mesh_index_select.py @@ -93,7 +93,7 @@ class SelVertEdgeFace(Operator): if self.select_type == 'VERT': bpy.context.tool_settings.mesh_select_mode = [True, False, False] ver = obj.data.vertices - loc = context.scene.cursor_location + loc = context.scene.cursor.location sel = [] for v in ver: d = v.co - loc diff --git a/mesh_tiny_cad/CCEN.py b/mesh_tiny_cad/CCEN.py index 48e484a6e18e739e8a48d8cf9caa2a579fab2a49..24604e8f191e61039ee2f394e49524c698a51420 100644 --- a/mesh_tiny_cad/CCEN.py +++ b/mesh_tiny_cad/CCEN.py @@ -90,7 +90,7 @@ def generate_3PT(pts, obj, nv, mode=1): if r: p1, _ = r cp = mw @ p1 - bpy.context.scene.cursor_location = cp + bpy.context.scene.cursor.location = cp if mode == 0: pass diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index 30515f594e6c615b20af3b460cf2ded9f85530ec..15a6f8f21e0a9a0ac8c6d64b7baf855328c584ec 100644 --- a/object_fracture/fracture_ops.py +++ b/object_fracture/fracture_ops.py @@ -468,7 +468,7 @@ def import_object(obname): instance_groups=True) for ob in bpy.context.selected_objects: - ob.location = bpy.context.scene.cursor_location + ob.location = bpy.context.scene.cursor.location class ImportFractureRecorder(bpy.types.Operator): diff --git a/object_fracture_cell/__init__.py b/object_fracture_cell/__init__.py index 75da5e2822158392884f2b0e077951f8311c288f..e1fcb41f838a6545407e1c5ce126bd1bf406df04 100644 --- a/object_fracture_cell/__init__.py +++ b/object_fracture_cell/__init__.py @@ -110,7 +110,7 @@ def main_object(context, obj, level, **kw): if recursion_chance_select == 'SIZE_MAX': objects_recurse_input.reverse() elif recursion_chance_select in {'CURSOR_MIN', 'CURSOR_MAX'}: - c = scene.cursor_location.copy() + c = scene.cursor.location.copy() objects_recurse_input.sort(key=lambda ob_pair: (ob_pair[1].location - c).length_squared) if recursion_chance_select == 'CURSOR_MAX': diff --git a/render_povray/primitives.py b/render_povray/primitives.py index da7105bf38433450c809f3d016f07b2e363012b0..ffdd6cd968e87e4115bbb569db341e3de39a7b1e 100644 --- a/render_povray/primitives.py +++ b/render_povray/primitives.py @@ -69,7 +69,7 @@ class POVRAY_OT_lathe_add(bpy.types.Operator): layers=[False]*20 layers[0]=True bpy.ops.curve.primitive_bezier_curve_add( - location=context.scene.cursor_location, + location=context.scene.cursor.location, rotation=(0, 0, 0), layers=layers, ) @@ -634,7 +634,7 @@ class POVRAY_OT_box_add(bpy.types.Operator): def pov_cylinder_define(context, op, ob, radius, loc, loc_cap): if op: R = op.R - loc = bpy.context.scene.cursor_location + loc = bpy.context.scene.cursor.location loc_cap[0] = loc[0] loc_cap[1] = loc[1] loc_cap[2] = (loc[2]+2) @@ -697,7 +697,7 @@ class POVRAY_OT_cylinder_add(bpy.types.Operator): LOC_CAP = ob.pov.imported_cyl_loc_cap else: if not props.imported_cyl_loc: - LOC_CAP = LOC = bpy.context.scene.cursor_location + LOC_CAP = LOC = bpy.context.scene.cursor.location LOC_CAP[2] += 2.0 else: LOC = props.imported_cyl_loc @@ -738,7 +738,7 @@ class POVRAY_OT_cylinder_update(bpy.types.Operator): def pov_sphere_define(context, op, ob, loc): if op: R = op.R - loc = bpy.context.scene.cursor_location + loc = bpy.context.scene.cursor.location else: assert(ob) R = ob.pov.sphere_radius @@ -799,7 +799,7 @@ class POVRAY_OT_sphere_add(bpy.types.Operator): LOC = ob.pov.imported_loc else: if not props.imported_loc: - LOC = bpy.context.scene.cursor_location + LOC = bpy.context.scene.cursor.location else: LOC = props.imported_loc @@ -1327,7 +1327,7 @@ def pov_parametric_define(context, op, ob): obrot = ob.rotation_euler # In radians #Parametric addon has no loc rot, some extra work is needed #in case cursor has moved - curloc = bpy.context.scene.cursor_location + curloc = bpy.context.scene.cursor.location bpy.ops.object.mode_set(mode="EDIT") diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py index d4acda2f8b0b463130cee3cad968e3c38e95f6ce..0490a5ceb0982d179558c2df0fc96f6303abdb1b 100644 --- a/space_view3d_math_vis/draw.py +++ b/space_view3d_math_vis/draw.py @@ -112,13 +112,13 @@ def draw_callback_px(): offset_y = 20 if data_quat: - loc = context.scene.cursor_location.copy() + loc = context.scene.cursor.location.copy() for key, mat in data_quat.items(): draw_text(key, loc, dy=-offset_y) offset_y += 20 if data_euler: - loc = context.scene.cursor_location.copy() + loc = context.scene.cursor.location.copy() for key, mat in data_euler.items(): draw_text(key, loc, dy=-offset_y) offset_y += 20 @@ -143,7 +143,7 @@ def draw_callback_view(): draw_matrices(list(data_matrix.values()), scale, with_bounding_box) if data_euler or data_quat: - cursor = bpy.context.scene.cursor_location.copy() + cursor = bpy.context.scene.cursor.location.copy() derived_matrices = [] for quat in data_quat.values(): matrix = quat.to_matrix().to_4x4() diff --git a/space_view3d_pie_menus/pie_cursor.py b/space_view3d_pie_menus/pie_cursor.py index 337c0c12b19bdbdd943ed55b90dad9f1c22b2439..05550eb3c0c3b1aa3c5ba6cec62a7f7163744857 100644 --- a/space_view3d_pie_menus/pie_cursor.py +++ b/space_view3d_pie_menus/pie_cursor.py @@ -49,7 +49,7 @@ class Snap_CursSelToCenter1(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) diff --git a/space_view3d_pie_menus/pie_origin.py b/space_view3d_pie_menus/pie_origin.py index 58f22d419a05f751a8ea9bfaff0e9305b2d424bc..12e477f4cf952b4bf715230865b22b6153967126 100644 --- a/space_view3d_pie_menus/pie_origin.py +++ b/space_view3d_pie_menus/pie_origin.py @@ -49,11 +49,11 @@ class PivotToSelection(Operator): return context.active_object is not None def execute(self, context): - saved_location = context.scene.cursor_location.copy() + saved_location = context.scene.cursor.location.copy() bpy.ops.view3d.snap_cursor_to_selected() bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.origin_set(type='ORIGIN_CURSOR') - context.scene.cursor_location = saved_location + context.scene.cursor.location = saved_location return {'FINISHED'} diff --git a/space_view3d_spacebar_menu.py b/space_view3d_spacebar_menu.py index 18acb9420610b10bffe986ccf7595a7381aec35f..be900c42652cddb22bba37352f731d2a5c9c5bb5 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'} diff --git a/uv_texture_atlas.py b/uv_texture_atlas.py index 5e527874918e9f34ca27fac5804788781376c3f7..50adb3c881af6d13f37e2bdeb27c8deb9e2daaa8 100644 --- a/uv_texture_atlas.py +++ b/uv_texture_atlas.py @@ -618,7 +618,7 @@ class TexAtl_MergeObjects(Operator): me = bpy.data.meshes.new(self.group_name + '_mergedObject') ob_merge = bpy.data.objects.new(self.group_name + '_mergedObject', me) - ob_merge.location = scene.cursor_location # position object at 3d-cursor + ob_merge.location = scene.cursor.location # position object at 3d-cursor collection.objects.link(ob_merge) # Link object to collection me.update() ob_merge.select_set(False)