diff --git a/CHANGELOG.md b/CHANGELOG.md index b4f7adff..34514be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `fixed_auto_camera`: to avoid adjusting the automatic camera on each frame - Camera option to set the clip start (#484) - Traceback dump when Blender output contains it +- KiKit + - Expand text variables and KiBot %X markers in text objects (see #497) - Populate: - Basic support for regular list items (#480) - Help for the error levels diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 939067e7..51e10435 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -1720,6 +1720,8 @@ outputs: drawtabfail: false # [boolean=false] Trace trace: false + # [boolean=true] Expand text variables and KiBot %X markers in text objects + expand_text: true # [string=''] A configuration to use as base for this one. Use the following format: `OUTPUT_NAME[CFG_NAME]` extends: '' # [dict] Used to add fiducial marks to the (rail/frame of) the panel diff --git a/docs/source/configuration/outputs/panelize.rst b/docs/source/configuration/outputs/panelize.rst index e5de111e..6c164e11 100644 --- a/docs/source/configuration/outputs/panelize.rst +++ b/docs/source/configuration/outputs/panelize.rst @@ -217,6 +217,7 @@ Parameters: - ``drawtabfail`` :index:`: ` [boolean=false] Draw tab fail. - ``trace`` :index:`: ` [boolean=false] Trace. + - ``expand_text`` :index:`: ` [boolean=true] Expand text variables and KiBot %X markers in text objects. - ``extends`` :index:`: ` [string=''] A configuration to use as base for this one. Use the following format: `OUTPUT_NAME[CFG_NAME]`. - ``name`` :index:`: ` [string=''] A name to identify this configuration. If empty will be the order in the list, starting with 1. Don't use just a number or it will be confused as an index. diff --git a/kibot/out_panelize.py b/kibot/out_panelize.py index e07ddc05..a1fb4800 100644 --- a/kibot/out_panelize.py +++ b/kibot/out_panelize.py @@ -361,6 +361,8 @@ class PanelizeText(PanelOptions): res = Layer.solve(self.layer) if len(res) > 1: raise KiPlotConfigurationError('Must select only one layer for the text ({})'.format(self.layer)) + if parent.expand_text: + self.text = parent.expand_filename_both(self.text, is_sch=False, make_safe=False) class PanelizeCopperfill(PanelOptions): @@ -523,6 +525,8 @@ class PanelizeConfig(PanelOptions): """ [dict] Debug options """ self.source = PanelizeSource """ [dict] Used to adjust details of which part of the PCB is panelized """ + self.expand_text = True + """ Expand text variables and KiBot %X markers in text objects """ super().__init__() def config(self, parent):