diff options
author | Antonioya <blendergit@gmail.com> | 2019-01-27 19:34:37 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-01-27 21:17:52 +0300 |
commit | 00fe1f9d27ef81d535c4ebfea11e7793a41fe373 (patch) | |
tree | caf550d252e478ac29140b781f4d5133bb7c57a3 /archimesh/achm_shelves_maker.py | |
parent | 117b36e1b5ade3d81dfacbb4da5377ca3aabc92d (diff) |
Archimesh: Conversion to 2.80
Adapt the script to new Blender version
Task T60910
Diffstat (limited to 'archimesh/achm_shelves_maker.py')
-rw-r--r-- | archimesh/achm_shelves_maker.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/archimesh/achm_shelves_maker.py b/archimesh/achm_shelves_maker.py index e6e01ddb..53595da2 100644 --- a/archimesh/achm_shelves_maker.py +++ b/archimesh/achm_shelves_maker.py @@ -70,11 +70,11 @@ bpy.utils.register_class(ShelvesProperties) # Define UI class # Shelves # ------------------------------------------------------------------ -class AchmShelves(Operator): +class ARCHIMESH_OT_Shelves(Operator): bl_idname = "mesh.archimesh_shelves" bl_label = "Shelves" bl_description = "Shelves Generator" - bl_category = 'Archimesh' + bl_category = 'View' bl_options = {'REGISTER', 'UNDO'} thickness: FloatProperty( @@ -174,7 +174,7 @@ class AchmShelves(Operator): add_shelves(self, box, idx + 1, self.shelves[idx]) box = layout.box() - if not context.scene.render.engine == 'CYCLES': + if not context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: box.enabled = False box.prop(self, 'crt_mat') else: @@ -262,7 +262,7 @@ def add_shelves(self, box, num, sh): def create_shelves_mesh(self): # deactivate others for o in bpy.data.objects: - if o.select is True: + if o.select_get() is True: o.select_set(False) bpy.ops.object.select_all(False) # Create units @@ -311,14 +311,14 @@ def generate_shelves(self): # deactivate others for o in bpy.data.objects: - if o.select is True: + if o.select_get() is True: o.select_set(False) boxes[0].select_set(True) - bpy.context.scene.objects.active = boxes[0] + bpy.context.view_layer.objects.active = boxes[0] # Create materials - if self.crt_mat and bpy.context.scene.render.engine == 'CYCLES': + if self.crt_mat and bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: mat = create_diffuse_material("Shelves_material", False, 0.8, 0.8, 0.8) for box in boxes: set_material(box, mat) @@ -462,7 +462,7 @@ def create_unit(stype, objname, thickness, sthickness, sx, sy, sz, px, py, pz, l myobject.location[0] = px myobject.location[1] = py myobject.location[2] = pz - bpy.context.scene.objects.link(myobject) + bpy.context.collection.objects.link(myobject) mymesh.from_pydata(myvertex, [], myfaces) mymesh.update(calc_edges=True) |