diff --git a/booleans/swap_solver.py b/booleans/swap_solver.py index 47b1a34..db34d96 100644 --- a/booleans/swap_solver.py +++ b/booleans/swap_solver.py @@ -80,28 +80,28 @@ def invoke(self, context, event): self.dirty = False self.solve_mode = None - - self.all_objects = [obj for obj in bpy.data.objects if obj.type == 'MESH'] - self.reference_object_names = [obj.name for obj in context.selected_objects] self.boolean_mods = [] - self.fast_solver_count = 0 - self.exact_solver_count = 0 - for obj in self.all_objects: + all_scene_objects = [obj for obj in bpy.data.objects if obj.type == 'MESH'] + selected_object_names = [obj.name for obj in context.selected_objects] + fast_solver_count = 0 + exact_solver_count = 0 + + for obj in all_scene_objects: mods = [mod for mod in obj.modifiers if mod.type == 'BOOLEAN'] for mod in mods: - if mod.object.name in self.reference_object_names: + if mod.object.name in selected_object_names: self.boolean_mods.append(mod) for mod in self.boolean_mods: if mod.solver == 'FAST': - self.fast_solver_count += 1 + fast_solver_count += 1 elif mod.solver == 'EXACT': - self.exact_solver_count += 1 + exact_solver_count += 1 - if self.fast_solver_count == len(self.boolean_mods): + if fast_solver_count == len(self.boolean_mods): self.solve_mode = 'FAST' - elif self.exact_solver_count == len(self.boolean_mods): + elif exact_solver_count == len(self.boolean_mods): self.solve_mode = 'EXACT' capture_modifier_keys(self)