diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 6942b12b..e2abf7bd 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -695,6 +695,8 @@ def solve_project_file(): def look_for_used_layers(): + from .layer import Layer + Layer.reset() layers = set() components = {} # Look inside the modules @@ -721,7 +723,6 @@ def look_for_used_layers(): else: layers.add(e.GetLayer()) # Now filter the pads and vias potential layers - from .layer import Layer declared_layers = {la._id for la in Layer.solve('all')} layers = sorted(declared_layers.intersection(layers)) logger.debug('- Detected layers: {}'.format(layers)) diff --git a/kibot/layer.py b/kibot/layer.py index bcc3c287..004376b4 100644 --- a/kibot/layer.py +++ b/kibot/layer.py @@ -162,6 +162,11 @@ class Layer(Optionable): self.suffix = self.layer.replace('.', '_') self.clean_suffix() + @staticmethod + def reset(): + Layer._pcb_layers = None + Layer._plot_layers = None + def clean_suffix(self): filtered_suffix = ''.join(char for char in self.suffix if ord(char) < 128) if filtered_suffix != self.suffix: