Skip to content

Commit 3ec9b8d

Browse files
authored
Merge pull request #819 from mdeweerd/fix/818
fix #818 (3D models): update 3D variant aspect mechanism to check for PCB_TEXT
2 parents 2e16503 + 603674b commit 3ec9b8d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kibot/out_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def apply_list_of_3D_models(self, enable, slots, m, var):
712712

713713
def apply_3D_variant_aspect(self, board, enable=False):
714714
""" Disable/Enable the 3D models that aren't for this variant.
715-
This mechanism uses the MTEXT attributes. """
715+
This mechanism uses the MTEXT or PCB_TEXT attributes. """
716716
# The magic text is %variant:slot1,slot2...%
717717
field_regex = re.compile(r'\%([^:]+):([\d,]*)\%') # Generic (by name)
718718
field_regex_sp = re.compile(r'\$([^:]*):([\d,]*)\$') # Variant specific
@@ -728,7 +728,7 @@ def apply_3D_variant_aspect(self, board, enable=False):
728728
matched = False
729729
# Look for text objects
730730
for gi in m.GraphicalItems():
731-
if gi.GetClass() == 'MTEXT':
731+
if gi.GetClass() in ['MTEXT', 'PCB_TEXT']:
732732
# Check if the text matches the magic style
733733
text = gi.GetText().strip()
734734
match = field_regex.match(text)

0 commit comments

Comments
 (0)