Skip to content

Commit

Permalink
Fade and highlight - refactor visual editor export HTML settings #710
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 8, 2023
1 parent e5d4dc6 commit e29413f
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 36 deletions.
2 changes: 1 addition & 1 deletion builds/linux/obs/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.6.3320
pkgver=2.4.6.3321
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.6.3320
pkgver=2.4.6.3321
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/alldeps/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.6.3320) debian; urgency=medium
lpub3d (2.4.6.3321) debian; urgency=medium

* LPub3D version 2.4.6.209.3320_20230508 for Linux
* LPub3D version 2.4.6.210.3321_20230508 for Linux

-- Trevor SANDY <[email protected]> Mon, 08 May 2023 15:05:33 +0200
-- Trevor SANDY <[email protected]> Mon, 08 May 2023 15:05:57 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.6.3320
Version: 2.4.6.3321
Maintainer: Trevor SANDY <[email protected]>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/alldeps/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.6.3320
Version: 2.4.6.3321
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -797,7 +797,7 @@ update-desktop-database || true
%endif

%changelog
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3320
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3321
- LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details

* Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.6.3320) debian; urgency=medium
lpub3d (2.4.6.3321) debian; urgency=medium

* LPub3D version 2.4.6.209.3320_20230508 for Linux
* LPub3D version 2.4.6.210.3321_20230508 for Linux

-- Trevor SANDY <[email protected]> Mon, 08 May 2023 15:05:34 +0200
-- Trevor SANDY <[email protected]> Mon, 08 May 2023 15:05:58 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.6.3320
Version: 2.4.6.3321
Maintainer: Trevor SANDY <[email protected]>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.6.3320
Version: 2.4.6.3321
Release: 1%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -313,7 +313,7 @@ update-desktop-database || true
%endif

%changelog
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3320
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3321
- LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details

* Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670
Expand Down
2 changes: 1 addition & 1 deletion builds/utilities/version.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2 4 6 209 3320 5a4444dff
2 4 6 210 3321 e5d4dc62d
6 changes: 3 additions & 3 deletions gitversion.pri
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ equals(GIT_DIR, undefined) {

# Check if we do not have a valid version number (i.e. no version tag found)
isEmpty(GIT_VERSION) {
GIT_REVISION = 209
GIT_REVISION = 210
GIT_SHA = $$system($$GIT_BASE_COMMAND rev-parse --short HEAD 2> $$NULL_DEVICE)
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
GIT_VERSION = v$${VERSION}-$${GIT_REVISION}-$${GIT_SHA}
Expand Down Expand Up @@ -69,7 +69,7 @@ equals(GIT_DIR, undefined) {
# Get commit count
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
isEmpty(GIT_COMMIT) {
GIT_COMMIT = 3320
GIT_COMMIT = 3321
message("~~~ ERROR! GIT_COMMIT NOT DEFINED, USING $$GIT_COMMIT ~~~")
}

Expand Down Expand Up @@ -117,7 +117,7 @@ if (equals(USE_GIT_VER_FILE, true)|equals(USE_VERSION_INFO_VAR, true)) {
GIT_VERSION = $$cat($$GIT_VER_FILE, lines)
} else {
message("~~~ ERROR! $$GIT_DIR_ENV VERSION_INFO FILE $$GIT_VER_FILE NOT FOUND ~~~")
GIT_VERSION = $${VERSION}.209.3320.5a4444dff
GIT_VERSION = $${VERSION}.210.3321.e5d4dc62d
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
13 changes: 7 additions & 6 deletions lclib/common/lc_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1371,16 +1371,17 @@ void lcModel::GetScene(lcScene* Scene, const lcCamera* ViewCamera, bool AllowHig
{
if (Piece->IsVisible(mCurrentStep))
{
const lcStep StepShow = Piece->GetStepShow();
/*** LPub3D Mod - lpub fade highlight ***/
bool LPubFade = false;
if (gApplication->LPubFadeHighlight())
LPubFade = Piece->GetLPubFade();
if (false /*For future use - Visual Editor Edit Mode*/)
/*** LPub3D Mod - export ***/
if (lcGetActiveProject()->IsExportingHTML())
{
const lcStep StepShow = Piece->GetStepShow();
AllowHighlight &= StepShow == mCurrentStep;
AllowFade &= StepShow < mCurrentStep;
}
/*** LPub3D Mod end ***/
/*** LPub3D Mod - lpub fade highlight ***/
bool LPubFade = gApplication->LPubFadeHighlight();
LPubFade &= Piece->GetLPubFade();
Piece->AddMainModelRenderMeshes(Scene, AllowHighlight, AllowFade, LPubFade);
/*** LPub3D Mod end ***/
}
Expand Down
12 changes: 7 additions & 5 deletions lclib/common/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@ Project::Project(bool IsPreview, bool IsRenderImage)
mActiveModel->CreatePieceInfo(this);
mActiveModel->SetSaved();
mModels.Add(mActiveModel);
/*** LPub3D Mod - lpub fade highlight ***/
mLPubFadeParts = false;
mLPubHighlightParts = false;
mLPubFadeHighlight = gApplication->mPreferences.mLPubFadeHighlight;
/*** LPub3D Mod - export ***/
mExportingHTML = false;
/*** LPub3D Mod end ***/
if (!mIsPreview && gMainWindow)
QObject::connect(&mFileWatcher, SIGNAL(fileChanged(const QString&)), gMainWindow, SLOT(ProjectFileChanged(const QString&)));
Expand Down Expand Up @@ -1807,8 +1805,10 @@ lcInstructions* Project::GetInstructions()

/*** LPub3D Mod - export ***/
bool Project::ExportHTML(const lcHTMLExportOptions& Options)
/*** LPub3D Mod end ***/
{
mExportingHTML = true;
/*** LPub3D Mod end ***/

QDir Dir(Options.PathName);
Dir.mkpath(QLatin1String("."));

Expand Down Expand Up @@ -2042,6 +2042,8 @@ bool Project::ExportHTML(const lcHTMLExportOptions& Options)
}

/*** LPub3D Mod - export ***/
mExportingHTML = false;

return true;
/*** LPub3D Mod end ***/
}
Expand Down
9 changes: 9 additions & 0 deletions lclib/common/project.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class Project
mTimelineTopItem = TimelineTitle;
}
/*** LPub3D Mod end ***/
/*** LPub3D Mod - export ***/
bool IsExportingHTML() const
{
return mExportingHTML;
}
/*** LPub3D Mod end ***/
/*** LPub3D Mod - Camera Globe and Image Export ***/
void SetRenderAttributes(
const int Renderer,
Expand Down Expand Up @@ -222,6 +228,9 @@ class Project
float mResolution;
bool mViewerLoaded;
/*** LPub3D Mod end ***/
/*** LPub3D Mod - export ***/
bool mExportingHTML;
/*** LPub3D Mod end ***/
/*** LPub3D Mod - set Timeline top item ***/
QString mTimelineTopItem;
/*** LPub3D Mod end ***/
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LPub3D 2.4.6.209.3320 (08 05 2023 15:05:35)
LPub3D 2.4.6.210.3321 (08 05 2023 15:05:58)

Features, enhancements, fixes and changes
------------
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/RELEASE_NOTES.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.209.3320 (08 05 2023 15:05:35)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.210.3321 (08 05 2023 15:05:58)</h4>
<hr>
<p>
<span class="tg-1pky">LPub3D Official release.</span><br>
Expand Down
4 changes: 2 additions & 2 deletions mainApp/extras/LPub3D_Npp_UDL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
;;
;; Author......: Trevor SANDY
;; Name........: LPub3D_Npp_UDL.xml
;; Version.....: 2.4.6.209.3320
;; Last Update.: Mon, 08 May 2023 15:05:34 +0200
;; Version.....: 2.4.6.210.3321
;; Last Update.: Mon, 08 May 2023 15:05:58 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
4 changes: 2 additions & 2 deletions mainApp/lpub_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ bool LPub::OpenProject(const NativeOptions* Options, int Type/*NATIVE_VIEW*/, bo

lcPreferences& Preferences = lcGetPreferences();

Preferences.mLPubFadeHighlight = Options->LPubFadeHighlight;
Preferences.mFadeStepsColor = lcGetProfileInt(LC_PROFILE_FADE_STEPS_COLOR);
Preferences.mHighlightNewPartsColor = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR);

Expand All @@ -318,15 +319,14 @@ bool LPub::OpenProject(const NativeOptions* Options, int Type/*NATIVE_VIEW*/, bo
{
Preferences.mFadeSteps = Options->FadeParts;
Preferences.mHighlightNewParts = Options->HighlightParts;
Preferences.mLPubFadeHighlight = Options->LPubFadeHighlight;

if (Options->FadeParts)
{
if (Preferences::fadeStepsUseColour)
{
QColor FC = LDrawColor::color(Preferences::validFadeStepsColour);
if (FC.isValid())
Preferences.mFadeStepsColor = LC_RGBA(FC.red(), FC.green(), FC.blue(), FC.alpha());;
Preferences.mFadeStepsColor = LC_RGBA(FC.red(), FC.green(), FC.blue(), FC.alpha());
}
}

Expand Down
3 changes: 2 additions & 1 deletion mainApp/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3769,7 +3769,7 @@ bool Render::NativeExport(const NativeOptions *Options) {
lcQHTMLDialog Dialog(gui, &HTMLOptions);

if (Dialog.exec() == QDialog::Accepted)
emit gui->messageSig(LOG_INFO_STATUS, QObject::tr("%1 export completed.").arg(mode));
emit gui->messageSig(LOG_INFO_STATUS, QObject::tr("%1 export configuration completed.").arg(mode));
else {
emit gui->messageSig(LOG_NOTICE, QObject::tr("%1 export cancelled!").arg(mode));
return !Exported;
Expand All @@ -3790,6 +3790,7 @@ bool Render::NativeExport(const NativeOptions *Options) {
}

Exported = lpub->OpenProject(Options, NATIVE_EXPORT, true/*UseFile*/);

if (!Exported) {
emit gui->messageSig(LOG_ERROR, QObject::tr("Could not open Loader for ViewerStepKey: '%1', Export: %2, FileName: '%3', [Use File]")
.arg(Options->ViewerStepKey)
Expand Down

0 comments on commit e29413f

Please sign in to comment.