Added option to fade previous steps.

This commit is contained in:
Leonardo Zide 2020-01-01 17:06:17 -08:00
parent 587207b7cf
commit cbf534fcdf
17 changed files with 116 additions and 78 deletions

View file

@ -21,6 +21,7 @@ void lcPreferences::LoadDefaults()
mDrawEdgeLines = lcGetProfileInt(LC_PROFILE_DRAW_EDGE_LINES); mDrawEdgeLines = lcGetProfileInt(LC_PROFILE_DRAW_EDGE_LINES);
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH); mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD); mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD);
mFadeSteps = lcGetProfileInt(LC_PROFILE_FADE_STEPS);
mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS); mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS);
mGridStudColor = lcGetProfileInt(LC_PROFILE_GRID_STUD_COLOR); mGridStudColor = lcGetProfileInt(LC_PROFILE_GRID_STUD_COLOR);
mDrawGridLines = lcGetProfileInt(LC_PROFILE_GRID_LINES); mDrawGridLines = lcGetProfileInt(LC_PROFILE_GRID_LINES);
@ -32,6 +33,7 @@ void lcPreferences::LoadDefaults()
mViewSphereTextColor = lcGetProfileInt(LC_PROFILE_VIEW_SPHERE_TEXT_COLOR); mViewSphereTextColor = lcGetProfileInt(LC_PROFILE_VIEW_SPHERE_TEXT_COLOR);
mViewSphereHighlightColor = lcGetProfileInt(LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR); mViewSphereHighlightColor = lcGetProfileInt(LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR);
mAutoLoadMostRecent = lcGetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT); mAutoLoadMostRecent = lcGetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT);
mRestoreTabLayout = lcGetProfileInt(LC_PROFILE_RESTORE_TAB_LAYOUT);
} }
void lcPreferences::SaveDefaults() void lcPreferences::SaveDefaults()
@ -43,6 +45,7 @@ void lcPreferences::SaveDefaults()
lcSetProfileInt(LC_PROFILE_DRAW_EDGE_LINES, mDrawEdgeLines); lcSetProfileInt(LC_PROFILE_DRAW_EDGE_LINES, mDrawEdgeLines);
lcSetProfileFloat(LC_PROFILE_LINE_WIDTH, mLineWidth); lcSetProfileFloat(LC_PROFILE_LINE_WIDTH, mLineWidth);
lcSetProfileInt(LC_PROFILE_ALLOW_LOD, mAllowLOD); lcSetProfileInt(LC_PROFILE_ALLOW_LOD, mAllowLOD);
lcSetProfileInt(LC_PROFILE_FADE_STEPS, mFadeSteps);
lcSetProfileInt(LC_PROFILE_GRID_STUDS, mDrawGridStuds); lcSetProfileInt(LC_PROFILE_GRID_STUDS, mDrawGridStuds);
lcSetProfileInt(LC_PROFILE_GRID_STUD_COLOR, mGridStudColor); lcSetProfileInt(LC_PROFILE_GRID_STUD_COLOR, mGridStudColor);
lcSetProfileInt(LC_PROFILE_GRID_LINES, mDrawGridLines); lcSetProfileInt(LC_PROFILE_GRID_LINES, mDrawGridLines);
@ -54,6 +57,7 @@ void lcPreferences::SaveDefaults()
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_TEXT_COLOR, mViewSphereTextColor); lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_TEXT_COLOR, mViewSphereTextColor);
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR, mViewSphereHighlightColor); lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR, mViewSphereHighlightColor);
lcSetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT, mAutoLoadMostRecent); lcSetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT, mAutoLoadMostRecent);
lcSetProfileInt(LC_PROFILE_RESTORE_TAB_LAYOUT, mRestoreTabLayout);
} }
lcApplication::lcApplication(int& Argc, char** Argv) lcApplication::lcApplication(int& Argc, char** Argv)

View file

@ -34,6 +34,7 @@ public:
bool mDrawEdgeLines; bool mDrawEdgeLines;
float mLineWidth; float mLineWidth;
bool mAllowLOD; bool mAllowLOD;
bool mFadeSteps;
bool mDrawGridStuds; bool mDrawGridStuds;
quint32 mGridStudColor; quint32 mGridStudColor;
bool mDrawGridLines; bool mDrawGridLines;
@ -46,6 +47,7 @@ public:
quint32 mViewSphereTextColor; quint32 mViewSphereTextColor;
quint32 mViewSphereHighlightColor; quint32 mViewSphereHighlightColor;
bool mAutoLoadMostRecent; bool mAutoLoadMostRecent;
bool mRestoreTabLayout;
}; };
class lcApplication : public QApplication class lcApplication : public QApplication

View file

@ -1252,13 +1252,18 @@ void lcModel::DuplicateSelectedPieces()
SaveCheckpoint(tr("Duplicating Pieces")); SaveCheckpoint(tr("Duplicating Pieces"));
} }
void lcModel::GetScene(lcScene& Scene, lcCamera* ViewCamera, bool Highlight) const void lcModel::GetScene(lcScene& Scene, lcCamera* ViewCamera, bool AllowHighlight, bool AllowFade) const
{ {
mPieceInfo->AddRenderMesh(Scene); mPieceInfo->AddRenderMesh(Scene);
for (lcPiece* Piece : mPieces) for (const lcPiece* Piece : mPieces)
{
if (Piece->IsVisible(mCurrentStep)) if (Piece->IsVisible(mCurrentStep))
Piece->AddMainModelRenderMeshes(Scene, Highlight && Piece->GetStepShow() == mCurrentStep); {
lcStep StepShow = Piece->GetStepShow();
Piece->AddMainModelRenderMeshes(Scene, AllowHighlight && StepShow == mCurrentStep, AllowFade && StepShow < mCurrentStep);
}
}
if (Scene.GetDrawInterface() && !Scene.GetActiveSubmodelInstance()) if (Scene.GetDrawInterface() && !Scene.GetActiveSubmodelInstance())
{ {

View file

@ -225,7 +225,7 @@ public:
void Paste(); void Paste();
void DuplicateSelectedPieces(); void DuplicateSelectedPieces();
void GetScene(lcScene& Scene, lcCamera* ViewCamera, bool Highlight) const; void GetScene(lcScene& Scene, lcCamera* ViewCamera, bool AllowHighlight, bool AllowFade) const;
void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const; void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const;
void DrawBackground(lcGLWidget* Widget); void DrawBackground(lcGLWidget* Widget);
QImage GetStepImage(bool Zoom, bool Highlight, int Width, int Height, lcStep Step); QImage GetStepImage(bool Zoom, bool Highlight, int Width, int Height, lcStep Step);

View file

@ -424,7 +424,7 @@ void lcPartSelectionListModel::DrawPreview(int InfoIndex)
Scene.SetAllowLOD(false); Scene.SetAllowLOD(false);
Scene.Begin(ViewMatrix); Scene.Begin(ViewMatrix);
Info->AddRenderMeshes(Scene, lcMatrix44Identity(), mColorIndex, lcRenderMeshState::NORMAL, false); Info->AddRenderMeshes(Scene, lcMatrix44Identity(), mColorIndex, lcRenderMeshState::Default, false);
Scene.End(); Scene.End();

View file

@ -58,6 +58,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
lcProfileEntry("Settings", "FixedAxes", false), // LC_PROFILE_FIXED_AXES lcProfileEntry("Settings", "FixedAxes", false), // LC_PROFILE_FIXED_AXES
lcProfileEntry("Settings", "LineWidth", 1.0f), // LC_PROFILE_LINE_WIDTH lcProfileEntry("Settings", "LineWidth", 1.0f), // LC_PROFILE_LINE_WIDTH
lcProfileEntry("Settings", "AllowLOD", true), // LC_PROFILE_ALLOW_LOD lcProfileEntry("Settings", "AllowLOD", true), // LC_PROFILE_ALLOW_LOD
lcProfileEntry("Settings", "FadeSteps", false), // LC_PROFILE_FADE_STEPS
lcProfileEntry("Settings", "ShadingMode", LC_SHADING_DEFAULT_LIGHTS), // LC_PROFILE_SHADING_MODE lcProfileEntry("Settings", "ShadingMode", LC_SHADING_DEFAULT_LIGHTS), // LC_PROFILE_SHADING_MODE
lcProfileEntry("Settings", "DrawAxes", 0), // LC_PROFILE_DRAW_AXES lcProfileEntry("Settings", "DrawAxes", 0), // LC_PROFILE_DRAW_AXES
lcProfileEntry("Settings", "DrawEdgeLines", 1), // LC_PROFILE_DRAW_EDGE_LINES lcProfileEntry("Settings", "DrawEdgeLines", 1), // LC_PROFILE_DRAW_EDGE_LINES
@ -88,6 +89,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
lcProfileEntry("Settings", "RecentFile3", ""), // LC_PROFILE_RECENT_FILE3 lcProfileEntry("Settings", "RecentFile3", ""), // LC_PROFILE_RECENT_FILE3
lcProfileEntry("Settings", "RecentFile4", ""), // LC_PROFILE_RECENT_FILE4 lcProfileEntry("Settings", "RecentFile4", ""), // LC_PROFILE_RECENT_FILE4
lcProfileEntry("Settings", "AutoLoadMostRecent", false), // LC_PROFILE_AUTOLOAD_MOSTRECENT lcProfileEntry("Settings", "AutoLoadMostRecent", false), // LC_PROFILE_AUTOLOAD_MOSTRECENT
lcProfileEntry("Settings", "RestoreTabLayout", true), // LC_PROFILE_RESTORE_TAB_LAYOUT
lcProfileEntry("Settings", "AutosaveInterval", 10), // LC_PROFILE_AUTOSAVE_INTERVAL lcProfileEntry("Settings", "AutosaveInterval", 10), // LC_PROFILE_AUTOSAVE_INTERVAL
lcProfileEntry("Settings", "MouseSensitivity", 11), // LC_PROFILE_MOUSE_SENSITIVITY lcProfileEntry("Settings", "MouseSensitivity", 11), // LC_PROFILE_MOUSE_SENSITIVITY
lcProfileEntry("Settings", "ImageWidth", 1280), // LC_PROFILE_IMAGE_WIDTH lcProfileEntry("Settings", "ImageWidth", 1280), // LC_PROFILE_IMAGE_WIDTH

View file

@ -6,6 +6,7 @@ enum LC_PROFILE_KEY
LC_PROFILE_FIXED_AXES, LC_PROFILE_FIXED_AXES,
LC_PROFILE_LINE_WIDTH, LC_PROFILE_LINE_WIDTH,
LC_PROFILE_ALLOW_LOD, LC_PROFILE_ALLOW_LOD,
LC_PROFILE_FADE_STEPS,
LC_PROFILE_SHADING_MODE, LC_PROFILE_SHADING_MODE,
LC_PROFILE_DRAW_AXES, LC_PROFILE_DRAW_AXES,
LC_PROFILE_DRAW_EDGE_LINES, LC_PROFILE_DRAW_EDGE_LINES,
@ -36,6 +37,7 @@ enum LC_PROFILE_KEY
LC_PROFILE_RECENT_FILE3, LC_PROFILE_RECENT_FILE3,
LC_PROFILE_RECENT_FILE4, LC_PROFILE_RECENT_FILE4,
LC_PROFILE_AUTOLOAD_MOSTRECENT, LC_PROFILE_AUTOLOAD_MOSTRECENT,
LC_PROFILE_RESTORE_TAB_LAYOUT,
LC_PROFILE_AUTOSAVE_INTERVAL, LC_PROFILE_AUTOSAVE_INTERVAL,
LC_PROFILE_MOUSE_SENSITIVITY, LC_PROFILE_MOUSE_SENSITIVITY,
LC_PROFILE_IMAGE_WIDTH, LC_PROFILE_IMAGE_WIDTH,

View file

@ -166,20 +166,20 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
switch (RenderMesh.State) switch (RenderMesh.State)
{ {
case lcRenderMeshState::NORMAL: case lcRenderMeshState::Default:
case lcRenderMeshState::HIGHLIGHT: case lcRenderMeshState::Highlighted:
Context->SetColorIndex(ColorIndex); Context->SetColorIndex(ColorIndex);
break; break;
case lcRenderMeshState::SELECTED: case lcRenderMeshState::Selected:
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_SELECTED, 0.5f); Context->SetColorIndexTinted(ColorIndex, LC_COLOR_SELECTED, 0.5f);
break; break;
case lcRenderMeshState::FOCUSED: case lcRenderMeshState::Focused:
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_FOCUSED, 0.5f); Context->SetColorIndexTinted(ColorIndex, LC_COLOR_FOCUSED, 0.5f);
break; break;
case lcRenderMeshState::DISABLED: case lcRenderMeshState::Faded:
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f); Context->SetColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f);
break; break;
} }
@ -188,26 +188,26 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
{ {
switch (RenderMesh.State) switch (RenderMesh.State)
{ {
case lcRenderMeshState::NORMAL: case lcRenderMeshState::Default:
if (ColorIndex == gEdgeColor) if (ColorIndex == gEdgeColor)
Context->SetEdgeColorIndex(RenderMesh.ColorIndex); Context->SetEdgeColorIndex(RenderMesh.ColorIndex);
else else
Context->SetColorIndex(ColorIndex); Context->SetColorIndex(ColorIndex);
break; break;
case lcRenderMeshState::SELECTED: case lcRenderMeshState::Selected:
Context->SetInterfaceColor(LC_COLOR_SELECTED); Context->SetInterfaceColor(LC_COLOR_SELECTED);
break; break;
case lcRenderMeshState::FOCUSED: case lcRenderMeshState::Focused:
Context->SetInterfaceColor(LC_COLOR_FOCUSED); Context->SetInterfaceColor(LC_COLOR_FOCUSED);
break; break;
case lcRenderMeshState::HIGHLIGHT: case lcRenderMeshState::Highlighted:
Context->SetInterfaceColor(LC_COLOR_HIGHLIGHT); Context->SetInterfaceColor(LC_COLOR_HIGHLIGHT);
break; break;
case lcRenderMeshState::DISABLED: case lcRenderMeshState::Faded:
Context->SetInterfaceColor(LC_COLOR_DISABLED); Context->SetInterfaceColor(LC_COLOR_DISABLED);
break; break;
} }
@ -324,20 +324,20 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit) const
switch (RenderMesh.State) switch (RenderMesh.State)
{ {
case lcRenderMeshState::NORMAL: case lcRenderMeshState::Default:
case lcRenderMeshState::HIGHLIGHT: case lcRenderMeshState::Highlighted:
Context->SetColorIndex(ColorIndex); Context->SetColorIndex(ColorIndex);
break; break;
case lcRenderMeshState::SELECTED: case lcRenderMeshState::Selected:
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_SELECTED, 0.5f); Context->SetColorIndexTinted(ColorIndex, LC_COLOR_SELECTED, 0.5f);
break; break;
case lcRenderMeshState::FOCUSED: case lcRenderMeshState::Focused:
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_FOCUSED, 0.5f); Context->SetColorIndexTinted(ColorIndex, LC_COLOR_FOCUSED, 0.5f);
break; break;
case lcRenderMeshState::DISABLED: case lcRenderMeshState::Faded:
Context->SetColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f); Context->SetColorIndexTinted(ColorIndex, LC_COLOR_DISABLED, 0.25f);
break; break;
} }

View file

@ -5,11 +5,11 @@
enum class lcRenderMeshState : int enum class lcRenderMeshState : int
{ {
NORMAL, Default,
SELECTED, Selected,
FOCUSED, Focused,
DISABLED, Faded,
HIGHLIGHT Highlighted
}; };
struct lcRenderMesh struct lcRenderMesh

View file

@ -389,7 +389,7 @@ void MinifigWizard::OnDraw()
for (int PieceIdx = 0; PieceIdx < LC_MFW_NUMITEMS; PieceIdx++) for (int PieceIdx = 0; PieceIdx < LC_MFW_NUMITEMS; PieceIdx++)
if (mMinifig.Parts[PieceIdx]) if (mMinifig.Parts[PieceIdx])
mMinifig.Parts[PieceIdx]->AddRenderMeshes(Scene, mMinifig.Matrices[PieceIdx], mMinifig.Colors[PieceIdx], lcRenderMeshState::NORMAL, true); mMinifig.Parts[PieceIdx]->AddRenderMeshes(Scene, mMinifig.Matrices[PieceIdx], mMinifig.Colors[PieceIdx], lcRenderMeshState::Default, true);
Scene.End(); Scene.End();

View file

@ -649,31 +649,34 @@ void lcPiece::RemoveKeyFrames()
ChangeKey(mRotationKeys, lcMatrix33(mModelWorld), 1, true); ChangeKey(mRotationKeys, lcMatrix33(mModelWorld), 1, true);
} }
void lcPiece::AddMainModelRenderMeshes(lcScene& Scene, bool Highlight) const void lcPiece::AddMainModelRenderMeshes(lcScene& Scene, bool Highlight, bool Fade) const
{ {
lcRenderMeshState RenderMeshState = lcRenderMeshState::NORMAL; lcRenderMeshState RenderMeshState = lcRenderMeshState::Default;
bool ParentActive = false; bool ParentActive = false;
if (Fade)
RenderMeshState = lcRenderMeshState::Faded;
if (Scene.GetDrawInterface()) if (Scene.GetDrawInterface())
{ {
lcPiece* ActiveSubmodelInstance = Scene.GetActiveSubmodelInstance(); lcPiece* ActiveSubmodelInstance = Scene.GetActiveSubmodelInstance();
if (!ActiveSubmodelInstance) if (!ActiveSubmodelInstance)
RenderMeshState = IsFocused() ? lcRenderMeshState::FOCUSED : (IsSelected() ? lcRenderMeshState::SELECTED : lcRenderMeshState::NORMAL); RenderMeshState = IsFocused() ? lcRenderMeshState::Focused : (IsSelected() ? lcRenderMeshState::Selected : RenderMeshState);
else if (ActiveSubmodelInstance == this) else if (ActiveSubmodelInstance == this)
ParentActive = true; ParentActive = true;
else else
RenderMeshState = lcRenderMeshState::DISABLED; RenderMeshState = lcRenderMeshState::Faded;
} }
else if (Highlight) else if (Highlight)
RenderMeshState = lcRenderMeshState::HIGHLIGHT; RenderMeshState = lcRenderMeshState::Highlighted;
if (!mMesh) if (!mMesh)
mPieceInfo->AddRenderMeshes(Scene, mModelWorld, mColorIndex, RenderMeshState, ParentActive); mPieceInfo->AddRenderMeshes(Scene, mModelWorld, mColorIndex, RenderMeshState, ParentActive);
else else
Scene.AddMesh(mMesh, mModelWorld, mColorIndex, RenderMeshState); Scene.AddMesh(mMesh, mModelWorld, mColorIndex, RenderMeshState);
if (RenderMeshState == lcRenderMeshState::FOCUSED || RenderMeshState == lcRenderMeshState::SELECTED) if (RenderMeshState == lcRenderMeshState::Focused || RenderMeshState == lcRenderMeshState::Selected)
Scene.AddInterfaceObject(this); Scene.AddInterfaceObject(this);
} }
@ -687,16 +690,16 @@ void lcPiece::AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMat
lcPiece* ActiveSubmodelInstance = Scene.GetActiveSubmodelInstance(); lcPiece* ActiveSubmodelInstance = Scene.GetActiveSubmodelInstance();
if (ActiveSubmodelInstance == this) if (ActiveSubmodelInstance == this)
RenderMeshState = lcRenderMeshState::NORMAL; RenderMeshState = lcRenderMeshState::Default;
else if (ParentActive) else if (ParentActive)
RenderMeshState = IsFocused() ? lcRenderMeshState::FOCUSED : (IsSelected() ? lcRenderMeshState::SELECTED : lcRenderMeshState::NORMAL); RenderMeshState = IsFocused() ? lcRenderMeshState::Focused : (IsSelected() ? lcRenderMeshState::Selected : lcRenderMeshState::Default);
if (!mMesh) if (!mMesh)
mPieceInfo->AddRenderMeshes(Scene, lcMul(mModelWorld, WorldMatrix), ColorIndex, RenderMeshState, ActiveSubmodelInstance == this); mPieceInfo->AddRenderMeshes(Scene, lcMul(mModelWorld, WorldMatrix), ColorIndex, RenderMeshState, ActiveSubmodelInstance == this);
else else
Scene.AddMesh(mMesh, lcMul(mModelWorld, WorldMatrix), ColorIndex, RenderMeshState); Scene.AddMesh(mMesh, lcMul(mModelWorld, WorldMatrix), ColorIndex, RenderMeshState);
if (ParentActive && (RenderMeshState == lcRenderMeshState::FOCUSED || RenderMeshState == lcRenderMeshState::SELECTED)) if (ParentActive && (RenderMeshState == lcRenderMeshState::Focused || RenderMeshState == lcRenderMeshState::Selected))
Scene.AddInterfaceObject(this); Scene.AddInterfaceObject(this);
} }

View file

@ -346,7 +346,7 @@ public:
virtual void DrawInterface(lcContext* Context, const lcScene& Scene) const override; virtual void DrawInterface(lcContext* Context, const lcScene& Scene) const override;
virtual void RemoveKeyFrames() override; virtual void RemoveKeyFrames() override;
void AddMainModelRenderMeshes(lcScene& Scene, bool Highlight) const; void AddMainModelRenderMeshes(lcScene& Scene, bool Highlight, bool Fade) const;
void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const; void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const;
void InsertTime(lcStep Start, lcStep Time); void InsertTime(lcStep Start, lcStep Time);

View file

@ -302,7 +302,7 @@ void PieceInfo::ZoomExtents(float FoV, float AspectRatio, lcMatrix44& Projection
void PieceInfo::AddRenderMesh(lcScene& Scene) void PieceInfo::AddRenderMesh(lcScene& Scene)
{ {
if (mMesh) if (mMesh)
Scene.AddMesh(mMesh, lcMatrix44Identity(), gDefaultColor, lcRenderMeshState::NORMAL); Scene.AddMesh(mMesh, lcMatrix44Identity(), gDefaultColor, lcRenderMeshState::Default);
} }
void PieceInfo::AddRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const void PieceInfo::AddRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const

View file

@ -1583,7 +1583,7 @@ QImage Project::CreatePartsListImage(lcModel* Model, lcStep Step)
Scene.SetAllowLOD(false); Scene.SetAllowLOD(false);
Scene.Begin(ViewMatrix); Scene.Begin(ViewMatrix);
Image.Info->AddRenderMeshes(Scene, lcMatrix44Identity(), Image.ColorIndex, lcRenderMeshState::NORMAL, true); Image.Info->AddRenderMeshes(Scene, lcMatrix44Identity(), Image.ColorIndex, lcRenderMeshState::Default, true);
Scene.End(); Scene.End();
@ -1973,7 +1973,7 @@ void Project::ExportHTML(const lcHTMLExportOptions& Options)
Scene.SetAllowLOD(false); Scene.SetAllowLOD(false);
Scene.Begin(ViewMatrix); Scene.Begin(ViewMatrix);
Info->AddRenderMeshes(Scene, lcMatrix44Identity(), Options.PartImagesColor, lcRenderMeshState::NORMAL, true); Info->AddRenderMeshes(Scene, lcMatrix44Identity(), Options.PartImagesColor, lcRenderMeshState::Default, true);
Scene.End(); Scene.End();

View file

@ -814,7 +814,7 @@ void View::OnDraw()
mScene.SetActiveSubmodelInstance(mActiveSubmodelInstance, mActiveSubmodelTransform); mScene.SetActiveSubmodelInstance(mActiveSubmodelInstance, mActiveSubmodelTransform);
mScene.SetDrawInterface(DrawInterface); mScene.SetDrawInterface(DrawInterface);
mModel->GetScene(mScene, mCamera, mHighlight); mModel->GetScene(mScene, mCamera, mHighlight, Preferences.mFadeSteps);
if (DrawInterface && mTrackTool == LC_TRACKTOOL_INSERT) if (DrawInterface && mTrackTool == LC_TRACKTOOL_INSERT)
{ {
@ -827,7 +827,7 @@ void View::OnDraw()
if (GetActiveModel() != mModel) if (GetActiveModel() != mModel)
WorldMatrix = lcMul(WorldMatrix, mActiveSubmodelTransform); WorldMatrix = lcMul(WorldMatrix, mActiveSubmodelTransform);
Info->AddRenderMeshes(mScene, WorldMatrix, gMainWindow->mColorIndex, lcRenderMeshState::FOCUSED, true); Info->AddRenderMeshes(mScene, WorldMatrix, gMainWindow->mColorIndex, lcRenderMeshState::Focused, true);
} }
} }

View file

@ -57,6 +57,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
ui->checkForUpdates->setCurrentIndex(mOptions->CheckForUpdates); ui->checkForUpdates->setCurrentIndex(mOptions->CheckForUpdates);
ui->fixedDirectionKeys->setChecked(mOptions->Preferences.mFixedAxes); ui->fixedDirectionKeys->setChecked(mOptions->Preferences.mFixedAxes);
ui->autoLoadMostRecent->setChecked(mOptions->Preferences.mAutoLoadMostRecent); ui->autoLoadMostRecent->setChecked(mOptions->Preferences.mAutoLoadMostRecent);
ui->RestoreTabLayout->setChecked(mOptions->Preferences.mRestoreTabLayout);
ui->antiAliasing->setChecked(mOptions->AASamples != 1); ui->antiAliasing->setChecked(mOptions->AASamples != 1);
if (mOptions->AASamples == 8) if (mOptions->AASamples == 8)
@ -68,6 +69,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
ui->edgeLines->setChecked(mOptions->Preferences.mDrawEdgeLines); ui->edgeLines->setChecked(mOptions->Preferences.mDrawEdgeLines);
ui->lineWidth->setText(lcFormatValueLocalized(mOptions->Preferences.mLineWidth)); ui->lineWidth->setText(lcFormatValueLocalized(mOptions->Preferences.mLineWidth));
ui->MeshLOD->setChecked(mOptions->Preferences.mAllowLOD); ui->MeshLOD->setChecked(mOptions->Preferences.mAllowLOD);
ui->FadeSteps->setChecked(mOptions->Preferences.mFadeSteps);
ui->gridStuds->setChecked(mOptions->Preferences.mDrawGridStuds); ui->gridStuds->setChecked(mOptions->Preferences.mDrawGridStuds);
ui->gridLines->setChecked(mOptions->Preferences.mDrawGridLines); ui->gridLines->setChecked(mOptions->Preferences.mDrawGridLines);
ui->gridLineSpacing->setText(QString::number(mOptions->Preferences.mGridLineSpacing)); ui->gridLineSpacing->setText(QString::number(mOptions->Preferences.mGridLineSpacing));
@ -175,6 +177,7 @@ void lcQPreferencesDialog::accept()
mOptions->CheckForUpdates = ui->checkForUpdates->currentIndex(); mOptions->CheckForUpdates = ui->checkForUpdates->currentIndex();
mOptions->Preferences.mFixedAxes = ui->fixedDirectionKeys->isChecked(); mOptions->Preferences.mFixedAxes = ui->fixedDirectionKeys->isChecked();
mOptions->Preferences.mAutoLoadMostRecent = ui->autoLoadMostRecent->isChecked(); mOptions->Preferences.mAutoLoadMostRecent = ui->autoLoadMostRecent->isChecked();
mOptions->Preferences.mRestoreTabLayout = ui->RestoreTabLayout->isChecked();
if (!ui->antiAliasing->isChecked()) if (!ui->antiAliasing->isChecked())
mOptions->AASamples = 1; mOptions->AASamples = 1;
@ -188,6 +191,7 @@ void lcQPreferencesDialog::accept()
mOptions->Preferences.mDrawEdgeLines = ui->edgeLines->isChecked(); mOptions->Preferences.mDrawEdgeLines = ui->edgeLines->isChecked();
mOptions->Preferences.mLineWidth = lcParseValueLocalized(ui->lineWidth->text()); mOptions->Preferences.mLineWidth = lcParseValueLocalized(ui->lineWidth->text());
mOptions->Preferences.mAllowLOD = ui->MeshLOD->isChecked(); mOptions->Preferences.mAllowLOD = ui->MeshLOD->isChecked();
mOptions->Preferences.mFadeSteps = ui->FadeSteps->isChecked();
mOptions->Preferences.mDrawGridStuds = ui->gridStuds->isChecked(); mOptions->Preferences.mDrawGridStuds = ui->gridStuds->isChecked();
mOptions->Preferences.mDrawGridLines = ui->gridLines->isChecked(); mOptions->Preferences.mDrawGridLines = ui->gridLines->isChecked();

View file

@ -282,6 +282,13 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="11" column="0" colspan="2">
<widget class="QCheckBox" name="RestoreTabLayout">
<property name="text">
<string>Restore tab layout</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabRendering"> <widget class="QWidget" name="tabRendering">
@ -292,17 +299,10 @@
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="4" column="0"> <item row="2" column="2">
<widget class="QCheckBox" name="axisIcon"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Axis icon</string> <string>width</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Shading Mode:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -335,13 +335,39 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="6" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>width</string> <string>Shading Mode:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QCheckBox" name="axisIcon">
<property name="text">
<string>Axis icon</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QComboBox" name="ShadingMode">
<item>
<property name="text">
<string>Wireframe</string>
</property>
</item>
<item>
<property name="text">
<string>Flat Shading</string>
</property>
</item>
<item>
<property name="text">
<string>Default Lights</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="antiAliasing"> <widget class="QCheckBox" name="antiAliasing">
<property name="text"> <property name="text">
@ -385,13 +411,6 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QCheckBox" name="edgeLines">
<property name="text">
<string>Edge lines</string>
</property>
</widget>
</item>
<item row="0" column="3"> <item row="0" column="3">
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
@ -405,23 +424,11 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="6" column="1" colspan="2"> <item row="2" column="0">
<widget class="QComboBox" name="ShadingMode"> <widget class="QCheckBox" name="edgeLines">
<item> <property name="text">
<property name="text"> <string>Edge lines</string>
<string>Wireframe</string> </property>
</property>
</item>
<item>
<property name="text">
<string>Flat Shading</string>
</property>
</item>
<item>
<property name="text">
<string>Default Lights</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
@ -431,6 +438,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="FadeSteps">
<property name="text">
<string>Fade Previous Steps</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -1169,6 +1183,7 @@
<tabstop>authorName</tabstop> <tabstop>authorName</tabstop>
<tabstop>fixedDirectionKeys</tabstop> <tabstop>fixedDirectionKeys</tabstop>
<tabstop>autoLoadMostRecent</tabstop> <tabstop>autoLoadMostRecent</tabstop>
<tabstop>RestoreTabLayout</tabstop>
<tabstop>antiAliasing</tabstop> <tabstop>antiAliasing</tabstop>
<tabstop>antiAliasingSamples</tabstop> <tabstop>antiAliasingSamples</tabstop>
<tabstop>studLogo</tabstop> <tabstop>studLogo</tabstop>
@ -1177,6 +1192,7 @@
<tabstop>lineWidth</tabstop> <tabstop>lineWidth</tabstop>
<tabstop>MeshLOD</tabstop> <tabstop>MeshLOD</tabstop>
<tabstop>axisIcon</tabstop> <tabstop>axisIcon</tabstop>
<tabstop>FadeSteps</tabstop>
<tabstop>ShadingMode</tabstop> <tabstop>ShadingMode</tabstop>
<tabstop>gridStuds</tabstop> <tabstop>gridStuds</tabstop>
<tabstop>gridStudColor</tabstop> <tabstop>gridStudColor</tabstop>