pcbnew - missing colors when exporting STEP model

Description

When exporting a PCB file as a STEP, none of the components retain the color from their original 3D model, as seen in the 3D viewer.

Steps to reproduce

  1. Create a new project (make sure libraries, footprnts, symbols and packages3d are installed)
  2. Open Schematic Editor, add the following components with the following footprints:
    • Resistor, Resistor_SMD:R_0402_1005Metric
    • Capacitor, Capacitor_SMD:C_0402_1005Metric
    • Generic Connector 1x04, Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical
    • Any N-Channel Mosfet, Package_TO_SOT_SMD:SOT-23
  3. Open PCB Editor, update PCB from Schematic (F8)
  4. Arrange the components in any way
  5. Draw a rectangle around the components in the Edge.Cuts layer
  6. Open 3D Viewer (F3), notice the components have colors: image
  7. Close 3D viewer and go back to PCB Editor
  8. Select File -> Export -> STEP / ...
  9. Select format "STEP" in the dropdown
  10. Select an appropriate path for the output file
  11. Mark all checkboxes and select "All Components" in the "Board Options" group
  12. Mark "Export tracks and vias", "Export pads" and "Export zones" in the "Conductor options" group
  13. Click "Export"
  14. Open the exported STEP file in FreeCAD (or any other 3D viewer) and notice the lack of colors in the 3D components. image

Individual components' STEP files have correct colors when viewed in FreeCAD or other 3D viewers, so it is likely not a 3d library issue.

The components used to reproduce are just some examples, but I could not find a single 3D model that, when the board is exported as STEP, retains its original color.

KiCad Version

Application: KiCad x86_64 on x86_64
Version: 9.0.4-9.0.4-0~ubuntu24.04.1, release build
Libraries:
    wxWidgets 3.2.4
    FreeType 2.13.2
    HarfBuzz 8.3.0
    FontConfig 2.15.0
    libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
Platform: Ubuntu 24.04.3 LTS, 64 bit, Little endian, wxGTK, X11, , wayland
OpenGL: Intel, Mesa Intel(R) Iris(R) Xe Graphics (TGL GT2), 4.6 (Compatibility Profile) Mesa 25.0.7-0ubuntu0.24.04.2
Build Info:
    Date: Aug 18 2025 02:17:55
    wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
    Boost: 1.83.0
    OCC: 7.6.3
    Curl: 8.5.0
    ngspice: 42
    Compiler: GCC 13.3.0 with C++ ABI 1018
    KICAD_IPC_API=ON
Locale: 
    Lang: pt_BR
    Enc: UTF-8
    Num: 1.234,5
    Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)
Edited by Carlos Aurelio