From ea5ae7cc5d392f5cf501423eb3a257607142a7ed Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 22 Nov 2025 09:59:03 -0500 Subject: [PATCH] API: Fix serialization of footprint rule overrides; add missing allow_soldermask_bridges attribute Fixes https://gitlab.com/kicad/code/kicad/-/issues/21674 --- api/proto/board/board_types.proto | 3 +++ pcbnew/footprint.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/proto/board/board_types.proto b/api/proto/board/board_types.proto index 711f53088f..761c72bd73 100644 --- a/api/proto/board/board_types.proto +++ b/api/proto/board/board_types.proto @@ -846,6 +846,9 @@ message FootprintAttributes bool exempt_from_courtyard_requirement = 6; bool do_not_populate = 7; FootprintMountingStyle mounting_style = 8; + + // Since: 9.0.7 + bool allow_soldermask_bridges = 9; } message NetTieDefinition diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 263f301073..e44647b4ad 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -309,6 +309,7 @@ void FOOTPRINT::Serialize( google::protobuf::Any &aContainer ) const attrs->set_exclude_from_bill_of_materials( IsExcludedFromBOM() ); attrs->set_exempt_from_courtyard_requirement( AllowMissingCourtyard() ); attrs->set_do_not_populate( IsDNP() ); + attrs->set_allow_soldermask_bridges( GetAttributes() & FP_ALLOW_SOLDERMASK_BRIDGES ); if( m_attributes & FP_THROUGH_HOLE ) attrs->set_mounting_style( types::FootprintMountingStyle::FMS_THROUGH_HOLE ); @@ -326,7 +327,7 @@ void FOOTPRINT::Serialize( google::protobuf::Any &aContainer ) const // TODO: serialize library mandatory fields - types::FootprintDesignRuleOverrides* overrides = def->mutable_overrides(); + types::FootprintDesignRuleOverrides* overrides = footprint.mutable_overrides(); if( GetLocalClearance().has_value() ) overrides->mutable_copper_clearance()->set_value_nm( *GetLocalClearance() ); @@ -394,6 +395,7 @@ void FOOTPRINT::Serialize( google::protobuf::Any &aContainer ) const modelMsg.set_opacity( model.m_Opacity ); itemMsg->PackFrom( modelMsg ); } + kiapi::common::PackSheetPath( *footprint.mutable_symbol_path(), m_path ); footprint.set_symbol_sheet_name( m_sheetname.ToUTF8() ); @@ -475,6 +477,9 @@ bool FOOTPRINT::Deserialize( const google::protobuf::Any &aContainer ) SetAllowMissingCourtyard( footprint.attributes().exempt_from_courtyard_requirement() ); SetDNP( footprint.attributes().do_not_populate() ); + if( footprint.attributes().allow_soldermask_bridges() ) + m_attributes |= FP_ALLOW_SOLDERMASK_BRIDGES; + // Definition SetFPID( kiapi::common::LibIdFromProto( footprint.definition().id() ) ); // TODO: how should anchor be handled?