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:
authorNBurn <7nburn@gmail.com>2019-01-29 04:04:35 +0300
committerNBurn <7nburn@gmail.com>2019-01-29 04:04:35 +0300
commitedd2de62eb13284f7e02256701fec1483973018d (patch)
tree02a6ab0c10b9131e346d2e55b36bfd14873fafa3 /add_mesh_extra_objects
parentbdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff)
addons: view_layer.objects.active syntax update
Diffstat (limited to 'add_mesh_extra_objects')
-rw-r--r--add_mesh_extra_objects/add_mesh_beam_builder.py2
-rw-r--r--add_mesh_extra_objects/add_mesh_round_brilliant.py2
-rw-r--r--add_mesh_extra_objects/add_mesh_triangles.py2
-rw-r--r--add_mesh_extra_objects/geodesic_domes/third_domes_panel_271.py2
-rw-r--r--add_mesh_extra_objects/geodesic_domes/vefm_271.py2
-rw-r--r--add_mesh_extra_objects/mesh_discombobulator.py14
6 files changed, 12 insertions, 12 deletions
diff --git a/add_mesh_extra_objects/add_mesh_beam_builder.py b/add_mesh_extra_objects/add_mesh_beam_builder.py
index c77842a6..b4865c6d 100644
--- a/add_mesh_extra_objects/add_mesh_beam_builder.py
+++ b/add_mesh_extra_objects/add_mesh_beam_builder.py
@@ -664,7 +664,7 @@ def addBeamObj(sRef, context):
beamMesh = bpy.data.meshes.new("Beam")
beamObj = bpy.data.objects.new("Beam", beamMesh)
context.scene.objects.link(beamObj)
- context.scene.objects.active = beamObj
+ context.view_layer.objects.active = beamObj
beamObj.select_set(True)
beamMesh.from_pydata(verts, [], faces)
diff --git a/add_mesh_extra_objects/add_mesh_round_brilliant.py b/add_mesh_extra_objects/add_mesh_round_brilliant.py
index 2d653f9e..90673ed4 100644
--- a/add_mesh_extra_objects/add_mesh_round_brilliant.py
+++ b/add_mesh_extra_objects/add_mesh_round_brilliant.py
@@ -224,7 +224,7 @@ def addBrilliant(context, s, table_w, crown_h, girdle_t, pavi_d, bezel_f,
scene = bpy.context.scene
# deactivate possible active Objects
- bpy.context.scene.objects.active = None
+ bpy.context.view_layer.objects.active = None
# create actual mesh and object based on Verts and Faces given
dmesh = bpy.data.meshes.new("dmesh")
diff --git a/add_mesh_extra_objects/add_mesh_triangles.py b/add_mesh_extra_objects/add_mesh_triangles.py
index 17f11e9c..bdede2c5 100644
--- a/add_mesh_extra_objects/add_mesh_triangles.py
+++ b/add_mesh_extra_objects/add_mesh_triangles.py
@@ -283,7 +283,7 @@ class MakeTriangle(Operator):
exitEditMode()
bpy.ops.object.select_all(action="DESELECT")
NewObj.select_set(True)
- context.scene.objects.active = NewObj
+ context.view_layer.objects.active = NewObj
if self.at_3Dcursor is True:
# we'll need to be sure there is actually an object selected
diff --git a/add_mesh_extra_objects/geodesic_domes/third_domes_panel_271.py b/add_mesh_extra_objects/geodesic_domes/third_domes_panel_271.py
index 0e557be5..5b51c1f2 100644
--- a/add_mesh_extra_objects/geodesic_domes/third_domes_panel_271.py
+++ b/add_mesh_extra_objects/geodesic_domes/third_domes_panel_271.py
@@ -1121,7 +1121,7 @@ class GenerateGeodesicDome(Operator):
vefm_271.vefm_add_object(mesh)
last_generated_object = context.active_object
last_generated_object.location = (0, 0, 0)
- context.scene.objects.active = last_generated_object
+ context.view_layer.objects.active = last_generated_object
elif self.geodesic_types == 'Grid':
basegeodesic = forms_271.grid(self.grxres, self.gryres,
self.grxsz, self.grysz, 1.0, 1.0, 0, 0, 0,
diff --git a/add_mesh_extra_objects/geodesic_domes/vefm_271.py b/add_mesh_extra_objects/geodesic_domes/vefm_271.py
index 4b5f68e7..4c7fc19d 100644
--- a/add_mesh_extra_objects/geodesic_domes/vefm_271.py
+++ b/add_mesh_extra_objects/geodesic_domes/vefm_271.py
@@ -833,7 +833,7 @@ class importmesh(mesh):
mesh.__init__(self)
obj = bpy.data.objects[meshname]
- bpy.context.scene.objects.active = obj
+ bpy.context.view_layer.objects.active = obj
obj.select_set(True)
impmesh = None
if not breakquadflag:
diff --git a/add_mesh_extra_objects/mesh_discombobulator.py b/add_mesh_extra_objects/mesh_discombobulator.py
index 82d50e07..f19f1927 100644
--- a/add_mesh_extra_objects/mesh_discombobulator.py
+++ b/add_mesh_extra_objects/mesh_discombobulator.py
@@ -338,7 +338,7 @@ def doodads(object1, mesh1, dmin, dmax):
# First we have to apply scaling and rotation to the mesh
bpy.ops.object.select_pattern(pattern=bpy.context.scene.discomb.DISC_doodads[type_dood], extend=False)
- bpy.context.scene.objects.active = bpy.data.objects[bpy.context.scene.discomb.DISC_doodads[type_dood]]
+ bpy.context.view_layer.objects.active = bpy.data.objects[bpy.context.scene.discomb.DISC_doodads[type_dood]]
bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
for polygon in bpy.data.objects[bpy.context.scene.discomb.DISC_doodads[type_dood]].data.polygons:
@@ -382,7 +382,7 @@ def protusions_repeat(object1, mesh1, r_prot):
def setMatProt(discObj, origObj, sideProtMat, topProtMat):
# First we put the materials in their slots
bpy.ops.object.select_pattern(pattern=discObj.name, extend=False)
- bpy.context.scene.objects.active = bpy.data.objects[discObj.name]
+ bpy.context.view_layer.objects.active = bpy.data.objects[discObj.name]
try:
origObj.material_slots[topProtMat]
origObj.material_slots[sideProtMat]
@@ -405,7 +405,7 @@ def setMatProt(discObj, origObj, sideProtMat, topProtMat):
def setMatDood(doodObj):
# First we add the materials slots
bpy.ops.object.select_pattern(pattern=doodObj.name, extend=False)
- bpy.context.scene.objects.active = doodObj
+ bpy.context.view_layer.objects.active = doodObj
for name in bpy.context.scene.discomb.DISC_doodads:
try:
bpy.ops.object.material_slot_add()
@@ -477,7 +477,7 @@ def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4,
# Reload the datas
bpy.ops.object.select_all(action="DESELECT")
bpy.ops.object.select_pattern(pattern=object.name, extend=False)
- bpy.context.scene.objects.active = bpy.data.objects[object.name]
+ bpy.context.view_layer.objects.active = bpy.data.objects[object.name]
obverts = bpy.context.active_object.data.vertices
obpolygons = bpy.context.active_object.data.polygons
@@ -494,7 +494,7 @@ def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4,
setMatProt(object1, origObj, sideProtMat, topProtMat)
bpy.ops.object.select_pattern(pattern=object1.name, extend=False)
- bpy.context.scene.objects.active = bpy.data.objects[object1.name]
+ bpy.context.view_layer.objects.active = bpy.data.objects[object1.name]
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.normals_make_consistent(inside=False)
bpy.ops.mesh.select_all(action='DESELECT')
@@ -516,11 +516,11 @@ def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4,
object2.scale = to_scale
bpy.ops.object.select_pattern(pattern=object.name, extend=False)
- bpy.context.scene.objects.active = bpy.data.objects[object.name]
+ bpy.context.view_layer.objects.active = bpy.data.objects[object.name]
bpy.ops.object.delete()
bpy.ops.object.select_pattern(pattern=object1.name, extend=False)
- bpy.context.scene.objects.active = bpy.data.objects[object1.name]
+ bpy.context.view_layer.objects.active = bpy.data.objects[object1.name]
bpy.context.scene.update()
# translate, scale and rotate discombobulated results