diff --git a/CHANGELOG.md b/CHANGELOG.md index 61859747..d85696ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - SubParts filter: - iBoM and Schematic print didn't take it into account (#716) - - 3D outputs also ignored them (#729) + - Any output filtering by reference ignored them (#729) - BoM - The field name `Reference` was accepted, but didn't work - Do Not Fit footprint crosses: diff --git a/docs/source/Changelog.rst b/docs/source/Changelog.rst index dba82e62..be1e3369 100644 --- a/docs/source/Changelog.rst +++ b/docs/source/Changelog.rst @@ -73,7 +73,7 @@ Fixed - SubParts filter: - iBoM and Schematic print didn’t take it into account (#716) - - 3D outputs also ignored them (#729) + - Any output filtering by reference ignored them (#729) - BoM diff --git a/kibot/out_base.py b/kibot/out_base.py index 54f8ef2d..380b17a0 100644 --- a/kibot/out_base.py +++ b/kibot/out_base.py @@ -876,6 +876,8 @@ def filter_pcb_components(self, do_3D=False, do_2D=True, highlight=None): if not self.will_filter_pcb_components(): return False self._comps_hash = self.get_refs_hash() + # As we will be comparing the reference split components won't match, so include their parents + self._comps_hash = self.include_parents(self._comps_hash) if self._sub_pcb: self._sub_pcb.apply(self._comps_hash) if self._comps: @@ -893,8 +895,7 @@ def filter_pcb_components(self, do_3D=False, do_2D=True, highlight=None): # Disable the models that aren't for this variant self.apply_3D_variant_aspect(GS.board) # Remove the 3D models for not fitted components (also rename) - comps_hash = self.include_parents(self._comps_hash) - self.remove_3D_models(GS.board, comps_hash) + self.remove_3D_models(GS.board, self._comps_hash) # Highlight selected components self.highlight_3D_models(GS.board, highlight) return True @@ -911,8 +912,7 @@ def unfilter_pcb_components(self, do_3D=False, do_2D=True): self.restore_sch_fields_to_pcb(GS.board) if do_3D and self._comps_hash: # Undo the removing (also rename) - comps_hash = self.include_parents(self._comps_hash) - self.restore_3D_models(GS.board, comps_hash) + self.restore_3D_models(GS.board, self._comps_hash) # Re-enable the modules that aren't for this variant self.apply_3D_variant_aspect(GS.board, enable=True) # Remove the highlight 3D object