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:
Ian McInerney 2020-01-22 22:48:20 +00:00
parent 183bbf6914
commit c5a9479953
2 changed files with 8 additions and 3 deletions

View File

@ -677,11 +677,12 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
SFVEC3F layerColor;
if( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) )
{
if( layer_id == B_Mask )
layerColor = m_settings.m_SolderMaskColorBot;
else
layerColor = m_settings.m_SolderMaskColorTop;
}
else
layerColor = m_settings.GetLayerColor( layer_id );

View File

@ -308,8 +308,12 @@ void EDA_3D_VIEWER::CreateMenuBar()
colorSubmenu->AddItem( ID_MENU3D_PCB_BODY_COLOR, _( "Board Body Color..." ), "",
setcolor_board_body_xpm, SELECTION_CONDITIONS::ShowAlways );
// Only allow the stackup to be used in the PCB editor, since it isn't editable in the other frames
if( Parent()->IsType( FRAME_PCB_EDITOR ) )
{
colorSubmenu->AddItem( ID_MENU3D_STACKUP_COLORS, _( "Get colors from physical stackup" ), "",
nullptr, SELECTION_CONDITIONS::ShowAlways );
}
prefsMenu->AddMenu( colorSubmenu );