From 184f7341bd171d411a326de6b4804b61c9903ad2 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 17 Jul 2019 10:10:40 +0200 Subject: Archimesh: fix usages of bpy.ops.object.select_all Fixes T67048: Adding archimesh stairs object to the scene flips normals of all other objects in scene Reviewers: antoniov, brecht Maniphest Tasks: T67048 Differential Revision: https://developer.blender.org/D5282 --- archimesh/achm_books_maker.py | 2 +- archimesh/achm_column_maker.py | 18 +++++++++--------- archimesh/achm_curtain_maker.py | 4 ++-- archimesh/achm_kitchen_maker.py | 2 +- archimesh/achm_lamp_maker.py | 2 +- archimesh/achm_roof_maker.py | 4 ++-- archimesh/achm_shelves_maker.py | 2 +- archimesh/achm_stairs_maker.py | 4 ++-- archimesh/achm_tools.py | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/archimesh/achm_books_maker.py b/archimesh/achm_books_maker.py index 87373030..da66bff8 100644 --- a/archimesh/achm_books_maker.py +++ b/archimesh/achm_books_maker.py @@ -172,7 +172,7 @@ def create_book_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') generate_books(self) return diff --git a/archimesh/achm_column_maker.py b/archimesh/achm_column_maker.py index fdb30303..ac7ca2e6 100644 --- a/archimesh/achm_column_maker.py +++ b/archimesh/achm_column_maker.py @@ -359,7 +359,7 @@ def create_column_mesh(self): if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') radio_top = self.rad_top if self.keep_size is True: @@ -380,7 +380,7 @@ def create_column_mesh(self): # Create circular column # ------------------------ if self.model == "1": - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') mycolumn = create_circular_column(self, "Column", radio_top, radio_mid, radio_bottom, height) mycolumn.select_set(True) bpy.context.view_layer.objects.active = mycolumn @@ -392,7 +392,7 @@ def create_column_mesh(self): # ------------------------ if self.model == "2": mycolumn = create_rectangular_base(self, "Column", self.col_sx, self.col_sy, height) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') mycolumn.select_set(True) bpy.context.view_layer.objects.active = mycolumn set_normals(mycolumn) @@ -401,7 +401,7 @@ def create_column_mesh(self): # ------------------------ if self.cir_base is True: cir_bottom = create_torus("Column_cir_bottom", radio_bottom, self.cir_base_r, self.cir_base_z) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') cir_bottom.select_set(True) bpy.context.view_layer.objects.active = cir_bottom set_modifier_subsurf(cir_bottom) @@ -417,7 +417,7 @@ def create_column_mesh(self): if self.box_base is True: box_bottom = create_rectangular_base(self, "Column_box_bottom", self.box_base_x, self.box_base_y, self.box_base_z) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') box_bottom.select_set(True) bpy.context.view_layer.objects.active = box_bottom box_bottom.parent = mycolumn @@ -433,7 +433,7 @@ def create_column_mesh(self): # ------------------------ if self.cir_top is True: cir_top = create_torus("Column_cir_top", radio_top, self.cir_top_r, self.cir_top_z) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') cir_top.select_set(True) bpy.context.view_layer.objects.active = cir_top set_modifier_subsurf(cir_top) @@ -449,7 +449,7 @@ def create_column_mesh(self): if self.box_top is True: box_top = create_rectangular_base(self, "Column_box_top", self.box_top_x, self.box_top_y, self.box_top_z, self.ramp) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') box_top.select_set(True) bpy.context.view_layer.objects.active = box_top set_normals(box_top) @@ -465,7 +465,7 @@ def create_column_mesh(self): myarc = create_arc("Column_arch", self.arc_radio, self.arc_gap, self.arc_width, self.array_space_factor) myarc.parent = mycolumn - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') myarc.select_set(True) bpy.context.view_layer.objects.active = myarc set_normals(myarc) @@ -555,7 +555,7 @@ def create_column_mesh(self): mat = create_diffuse_material("Column_arch", False, 0.8, 0.8, 0.8) set_material(myarc, mat) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') mycolumn.select_set(True) bpy.context.view_layer.objects.active = mycolumn diff --git a/archimesh/achm_curtain_maker.py b/archimesh/achm_curtain_maker.py index e0c9cc46..5c1e41e2 100644 --- a/archimesh/achm_curtain_maker.py +++ b/archimesh/achm_curtain_maker.py @@ -166,7 +166,7 @@ def create_japan_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') # Create units generate_japan(self) @@ -252,7 +252,7 @@ def create_roller_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') generate_roller(self) return diff --git a/archimesh/achm_kitchen_maker.py b/archimesh/achm_kitchen_maker.py index ad3e1123..bf17a554 100644 --- a/archimesh/achm_kitchen_maker.py +++ b/archimesh/achm_kitchen_maker.py @@ -614,7 +614,7 @@ def create_kitchen_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') # Create cabinets generate_cabinets(self) diff --git a/archimesh/achm_lamp_maker.py b/archimesh/achm_lamp_maker.py index 09e30747..a5c6621b 100644 --- a/archimesh/achm_lamp_maker.py +++ b/archimesh/achm_lamp_maker.py @@ -401,7 +401,7 @@ def create_light_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') generate_light(self) return diff --git a/archimesh/achm_roof_maker.py b/archimesh/achm_roof_maker.py index 846b1f50..1b446779 100644 --- a/archimesh/achm_roof_maker.py +++ b/archimesh/achm_roof_maker.py @@ -160,7 +160,7 @@ def create_roof_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') mydata = create_roof(self) myroof = mydata[0] @@ -210,7 +210,7 @@ def create_roof_mesh(self): mat = create_diffuse_material("Roof_material", False, 0.482, 0.061, 0.003, 0.581, 0.105, 0.068, 0.01) set_material(myroof, mat) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') myroof.select_set(True) bpy.context.view_layer.objects.active = myroof return diff --git a/archimesh/achm_shelves_maker.py b/archimesh/achm_shelves_maker.py index 0f04124e..59a2bfc7 100644 --- a/archimesh/achm_shelves_maker.py +++ b/archimesh/achm_shelves_maker.py @@ -264,7 +264,7 @@ def create_shelves_mesh(self): for o in bpy.data.objects: if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') # Create units generate_shelves(self) diff --git a/archimesh/achm_stairs_maker.py b/archimesh/achm_stairs_maker.py index b8688e73..af727101 100644 --- a/archimesh/achm_stairs_maker.py +++ b/archimesh/achm_stairs_maker.py @@ -209,7 +209,7 @@ def create_stairs_mesh(self): if o.select_get() is True: o.select_set(False) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') # ------------------------ # Create stairs @@ -245,7 +245,7 @@ def create_stairs_mesh(self): mat = create_diffuse_material("Stairs_material", False, 0.8, 0.8, 0.8) set_material(mystairs, mat) - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') mystairs.select_set(True) bpy.context.view_layer.objects.active = mystairs diff --git a/archimesh/achm_tools.py b/archimesh/achm_tools.py index 78eae826..2078801f 100644 --- a/archimesh/achm_tools.py +++ b/archimesh/achm_tools.py @@ -101,7 +101,7 @@ def set_modifier_subsurf(myobject): # Add modifier (mirror) # -------------------------------------------------------------------- def set_modifier_mirror(myobject, axis="Y"): - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') myobject.select_set(True) bpy.context.view_layer.objects.active = myobject if bpy.context.view_layer.objects.active.name == myobject.name: @@ -130,7 +130,7 @@ def set_modifier_mirror(myobject, axis="Y"): # Add modifier (array) # -------------------------------------------------------------------- def set_modifier_array(myobject, axis, move, repeat, fix=False, fixmove=0, zmove=0): - bpy.ops.object.select_all(False) + bpy.ops.object.select_all(action='DESELECT') myobject.select_set(True) bpy.context.view_layer.objects.active = myobject if bpy.context.view_layer.objects.active.name == myobject.name: -- cgit v1.2.3