diff options
author | NBurn <7nburn@gmail.com> | 2019-01-29 18:54:49 +0300 |
---|---|---|
committer | NBurn <7nburn@gmail.com> | 2019-01-29 18:54:49 +0300 |
commit | d609009748a604c1df2d8babfa4098260666d01a (patch) | |
tree | 98150e04df48252889e2fc8e049c13115e0afe72 /add_mesh_extra_objects | |
parent | 5c994fde52196dfe8a7e0db03b6935bac001d353 (diff) |
addons: objects.link/unlink syntax update
Changed objects.link and objects.unlink from scene to collection
Diffstat (limited to 'add_mesh_extra_objects')
-rw-r--r-- | add_mesh_extra_objects/Wallfactory.py | 2 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_beam_builder.py | 2 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_triangles.py | 2 | ||||
-rw-r--r-- | add_mesh_extra_objects/mesh_discombobulator.py | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/add_mesh_extra_objects/Wallfactory.py b/add_mesh_extra_objects/Wallfactory.py index 1f36d884..fa006774 100644 --- a/add_mesh_extra_objects/Wallfactory.py +++ b/add_mesh_extra_objects/Wallfactory.py @@ -871,7 +871,7 @@ class add_mesh_wallb(Operator): mesh.update() ob_new = bpy.data.objects.new("Wall", mesh) - scene.objects.link(ob_new) + context.collection.objects.link(ob_new) # leave this out to prevent 'Tab key" going into edit mode :) # Use rmb click to select and still modify. context.view_layer.objects.active = ob_new diff --git a/add_mesh_extra_objects/add_mesh_beam_builder.py b/add_mesh_extra_objects/add_mesh_beam_builder.py index b4865c6d..04890507 100644 --- a/add_mesh_extra_objects/add_mesh_beam_builder.py +++ b/add_mesh_extra_objects/add_mesh_beam_builder.py @@ -663,7 +663,7 @@ def addBeamObj(sRef, context): beamMesh = bpy.data.meshes.new("Beam") beamObj = bpy.data.objects.new("Beam", beamMesh) - context.scene.objects.link(beamObj) + context.collection.objects.link(beamObj) context.view_layer.objects.active = beamObj beamObj.select_set(True) diff --git a/add_mesh_extra_objects/add_mesh_triangles.py b/add_mesh_extra_objects/add_mesh_triangles.py index bdede2c5..64a56ef2 100644 --- a/add_mesh_extra_objects/add_mesh_triangles.py +++ b/add_mesh_extra_objects/add_mesh_triangles.py @@ -277,7 +277,7 @@ class MakeTriangle(Operator): NewMesh.update() NewObj = bpy.data.objects.new("Triangle", NewMesh) - context.scene.objects.link(NewObj) + context.collection.objects.link(NewObj) # before doing the deselect make sure edit mode isn't active exitEditMode() diff --git a/add_mesh_extra_objects/mesh_discombobulator.py b/add_mesh_extra_objects/mesh_discombobulator.py index f19f1927..f31c3e62 100644 --- a/add_mesh_extra_objects/mesh_discombobulator.py +++ b/add_mesh_extra_objects/mesh_discombobulator.py @@ -444,7 +444,7 @@ def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4, # Create the discombobulated mesh mesh = bpy.data.meshes.new("tmp") object = bpy.data.objects.new("tmp", mesh) - bpy.context.scene.objects.link(object) + bpy.context.collection.objects.link(object) # init final verts and polygons tuple nPolygons = [] @@ -486,7 +486,7 @@ def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4, # Fill in the discombobulated mesh with the new polygons mesh1 = bpy.data.meshes.new("discombobulated_object") object1 = bpy.data.objects.new("discombobulated_mesh", mesh1) - bpy.context.scene.objects.link(object1) + bpy.context.collection.objects.link(object1) mesh1.from_pydata(Verts, [], Polygons) mesh1.update(calc_edges=True) @@ -507,7 +507,7 @@ def discombobulate(minHeight, maxHeight, minTaper, maxTaper, sf1, sf2, sf3, sf4, doodads(object1, mesh1, dmin, dmax) mesh2 = bpy.data.meshes.new("dood_mesh") object2 = bpy.data.objects.new("dood_obj", mesh2) - bpy.context.scene.objects.link(object2) + bpy.context.collection.objects.link(object2) mesh2.from_pydata(dVerts, [], dPolygons) mesh2.update(calc_edges=True) setMatDood(object2) |