Skip to content

Commit 892cd6a

Browse files
committed
fix(out_base): update 3D variant aspect matching logic
- Correct logic to select default 3D slot selection (added `any_matched`); - Renamed `default` to `default_slots` for clarity.
1 parent f6508d2 commit 892cd6a

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

kibot/out_base.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,13 +741,15 @@ def apply_3D_variant_aspect(self, board, enable=False):
741741
var = match.group(1)
742742
slots = match.group(2).split(',') if match.group(2) else []
743743
# Do the match
744+
matched_gi = False
744745
if var == '_default_':
745746
default = slots
746747
if self.extra_debug:
747748
logger.debug('- Found defaults: {}'.format(slots))
748749
else:
749-
matched = var == variant_name
750-
if matched:
750+
matched_gi = var == variant_name
751+
if matched_gi:
752+
matched = True
751753
self.apply_list_of_3D_models(enable, slots, m, var)
752754
break
753755
else:
@@ -758,13 +760,15 @@ def apply_3D_variant_aspect(self, board, enable=False):
758760
logger.debug(f" - Variant specific: {text}")
759761
var = match.group(1)
760762
slots = match.group(2).split(',') if match.group(2) else []
763+
761764
# Do the match
762-
matched = self.variant.matches_variant(var)
763-
if matched:
765+
matched_gi = self.variant.matches_variant(var)
766+
if matched_gi:
767+
matched = True
764768
self.apply_list_of_3D_models(enable, slots, m, var)
765769
break
766770
if not matched and default is not None:
767-
self.apply_list_of_3D_models(enable, slots, m, '_default_')
771+
self.apply_list_of_3D_models(enable, default, m, '_default_')
768772

769773
def create_3D_highlight_file(self):
770774
if self._highlight_3D_file:

0 commit comments

Comments
 (0)