Only get 3D viewer colors when launched from the PCb editor
When launched from CVPCB or the footprint editor/viewer the stackup isn't user-editable, so it just gives its default colors.
This commit is contained in:
parent
183bbf6914
commit
c5a9479953
|
@ -677,11 +677,12 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
|
||||||
|
|
||||||
SFVEC3F layerColor;
|
SFVEC3F layerColor;
|
||||||
if( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) )
|
if( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) )
|
||||||
|
{
|
||||||
if( layer_id == B_Mask )
|
if( layer_id == B_Mask )
|
||||||
layerColor = m_settings.m_SolderMaskColorBot;
|
layerColor = m_settings.m_SolderMaskColorBot;
|
||||||
else
|
else
|
||||||
layerColor = m_settings.m_SolderMaskColorTop;
|
layerColor = m_settings.m_SolderMaskColorTop;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
layerColor = m_settings.GetLayerColor( layer_id );
|
layerColor = m_settings.GetLayerColor( layer_id );
|
||||||
|
|
||||||
|
|
|
@ -308,8 +308,12 @@ void EDA_3D_VIEWER::CreateMenuBar()
|
||||||
colorSubmenu->AddItem( ID_MENU3D_PCB_BODY_COLOR, _( "Board Body Color..." ), "",
|
colorSubmenu->AddItem( ID_MENU3D_PCB_BODY_COLOR, _( "Board Body Color..." ), "",
|
||||||
setcolor_board_body_xpm, SELECTION_CONDITIONS::ShowAlways );
|
setcolor_board_body_xpm, SELECTION_CONDITIONS::ShowAlways );
|
||||||
|
|
||||||
colorSubmenu->AddItem( ID_MENU3D_STACKUP_COLORS, _( "Get colors from physical stackup" ), "",
|
// Only allow the stackup to be used in the PCB editor, since it isn't editable in the other frames
|
||||||
nullptr, SELECTION_CONDITIONS::ShowAlways );
|
if( Parent()->IsType( FRAME_PCB_EDITOR ) )
|
||||||
|
{
|
||||||
|
colorSubmenu->AddItem( ID_MENU3D_STACKUP_COLORS, _( "Get colors from physical stackup" ), "",
|
||||||
|
nullptr, SELECTION_CONDITIONS::ShowAlways );
|
||||||
|
}
|
||||||
|
|
||||||
prefsMenu->AddMenu( colorSubmenu );
|
prefsMenu->AddMenu( colorSubmenu );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue