From 358fb4f81647d4ab77c468567c57f2c63d660324 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 28 Dec 2021 18:04:20 -0300 Subject: [PATCH] Added message about problems with 3D Viewer on KiCad 6.0.0. --- kibot/misc.py | 1 + kibot/out_render_3d.py | 8 +++++++- tests/test_plot/test_step.py | 7 +++++-- tests/utils/context.py | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/kibot/misc.py b/kibot/misc.py index a490d4b0..e717d2ba 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -84,6 +84,7 @@ URL_PCBDRAW = 'https://github.com/INTI-CMNB/pcbdraw' EXAMPLE_CFG = 'example_template.kibot.yaml' AUTO_SCALE = 0 KICAD_VERSION_5_99 = 5099000 +KICAD_VERSION_6_0_0 = 6000000 # Internal filter names IFILT_MECHANICAL = '_mechanical' diff --git a/kibot/out_render_3d.py b/kibot/out_render_3d.py index 66d5d54b..1da3c577 100644 --- a/kibot/out_render_3d.py +++ b/kibot/out_render_3d.py @@ -7,7 +7,7 @@ import os from glob import glob from shutil import rmtree -from .misc import CMD_PCBNEW_3D, URL_PCBNEW_3D, RENDER_3D_ERR +from .misc import CMD_PCBNEW_3D, URL_PCBNEW_3D, RENDER_3D_ERR, KICAD_VERSION_6_0_0 from .gs import (GS) from .kiplot import check_script, exec_with_retry, add_extra_options from .out_base_3d import Base3DOptions, Base3D @@ -87,6 +87,12 @@ class Render3DOptions(Base3DOptions): def run(self, output): super().run(output) + if GS.ki6(): + logger.error("3D Viewer not supported for KiCad 6.0.0\n" + "KiCad blindly tries to set the swap interval for non-GL surfaces and crashes.\n" + "Should be fixed in KiCad 6.0.1\n" + "For more information: https://gitlab.com/kicad/code/kicad/-/issues/9890") + return check_script(CMD_PCBNEW_3D, URL_PCBNEW_3D, '1.5.14') # Base command with overwrite cmd = [CMD_PCBNEW_3D, '--rec_w', str(self.width+2), '--rec_h', str(self.height+85), diff --git a/tests/test_plot/test_step.py b/tests/test_plot/test_step.py index 1cf7386e..984c7d96 100644 --- a/tests/test_plot/test_step.py +++ b/tests/test_plot/test_step.py @@ -70,6 +70,9 @@ def test_render_3d_variant_1(test_dir): prj = 'kibom-variant_3' ctx = context.TestContext(test_dir, 'test_render_3d_variant_1', prj, 'render_3d_variant_1', '') ctx.run(extra_debug=True) - # Check all outputs are there - ctx.expect_out_file(prj+'-3D_top.png') + if context.ki6(): + ctx.search_err(['3D Viewer not supported']) + else: + # Check all outputs are there + ctx.expect_out_file(prj+'-3D_top.png') ctx.clean_up(keep_project=True) diff --git a/tests/utils/context.py b/tests/utils/context.py index 4b0c9d82..3f23df1b 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -18,6 +18,7 @@ from kibot.misc import (error_level_to_name) COVERAGE_SCRIPT = 'python3-coverage' KICAD_PCB_EXT = '.kicad_pcb' KICAD_VERSION_5_99 = 5099000 +KICAD_VERSION_6_0_0 = 6000000 KICAD_VERSION_5_1_7 = 5001007 MODE_SCH = 1 MODE_PCB = 0