Skip to content

Commit

Permalink
Fade and highlight - always create fade part #710
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 8, 2023
1 parent 603cfb0 commit 28d2810
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 53 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.3335
pkgver=2.4.6.3336
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.3335
pkgver=2.4.6.3336
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.3335) debian; urgency=medium
lpub3d (2.4.6.3336) debian; urgency=medium

* LPub3D version 2.4.6.224.3335_20230508 for Linux
* LPub3D version 2.4.6.225.3336_20230508 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:12:22 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:12:48 +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.3335
Version: 2.4.6.3336
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
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.3335
Version: 2.4.6.3336
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.3335
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3336
- 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.3335) debian; urgency=medium
lpub3d (2.4.6.3336) debian; urgency=medium

* LPub3D version 2.4.6.224.3335_20230508 for Linux
* LPub3D version 2.4.6.225.3336_20230508 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:12:24 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:12:50 +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.3335
Version: 2.4.6.3336
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
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.3335
Version: 2.4.6.3336
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.3335
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3336
- 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 224 3335 bd07866e8
2 4 6 225 3336 603cfb074
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 = 224
GIT_REVISION = 225
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 = 3335
GIT_COMMIT = 3336
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}.224.3335.bd07866e8
GIT_VERSION = $${VERSION}.225.3336.603cfb074
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
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.224.3335 (08 05 2023 15:12:24)
LPub3D 2.4.6.225.3336 (08 05 2023 15:12:50)

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.224.3335 (08 05 2023 15:12:24)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.225.3336 (08 05 2023 15:12:50)</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.224.3335
;; Last Update.: Mon, 08 May 2023 15:12:24 +0200
;; Version.....: 2.4.6.225.3336
;; Last Update.: Mon, 08 May 2023 15:12:50 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
2 changes: 1 addition & 1 deletion mainApp/openclose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ void Gui::setupFadeOrHighlight(bool enableFadeSteps, bool enableHighlightStep)
if (Preferences::enableImageMatting)
LDVImageMatte::clearMatteCSIImages();
partWorkerLDSearchDirs.setDoFadeStep(true);
processFadeColourParts(false/*overwrite*/, enableFadeSteps);
processFadeColourParts(true/*overwrite*/, enableFadeSteps);
m_fadeStepsSetup = true;
}

Expand Down
50 changes: 20 additions & 30 deletions mainApp/threadworkers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ bool PartWorker::loadLDrawSearchDirs(){
foundUnofficialRootDir = ldrawSearchDir.toLower() == unofficialRootDir.toLower();

bool excludeSearchDir = false;
Q_FOREACH (QString excludedDir, _excludedSearchDirs){
Q_FOREACH (QString const &excludedDir, _excludedSearchDirs){
if ((excludeSearchDir =
ldrawSearchDir.toLower().contains(excludedDir.toLower()))) {
break;
Expand Down Expand Up @@ -725,7 +725,7 @@ void PartWorker::processCustomColourParts(PartType partType, bool overwrite, boo
colourPartList << fileString;
emit gui->messageSig(LOG_NOTICE, tr("01 SUBMIT COLOUR PART INFO: %1 Line: %2").arg(fileString.replace(":::", " ")).arg(i));
} else {
emit gui->messageSig(LOG_NOTICE, tr("01 COLOUR PART EXIST - IGNORING:").arg(fileString.replace(":::", " ")));
emit gui->messageSig(LOG_NOTICE, tr("01 COLOUR PART EXIST - IGNORING: %1").arg(fileString.replace(":::", " ")));
}
}
}
Expand Down Expand Up @@ -894,7 +894,9 @@ bool PartWorker::processColourParts(const QStringList &colourPartList, const Par

QuaZip zip(unOffLib ? unofficialLib : officialLib);
if (!zip.open(QuaZip::mdUnzip)) {
emit gui->messageSig(LOG_ERROR, tr("Failed to open archive: %1 @ %2").arg(zip.getZipError()).arg(unOffLib ? unofficialLib : officialLib));
emit gui->messageSig(LOG_ERROR, tr("Could not open archive to add content. Return code %1.<br>"
"Archive file %2 may be open in another program.")
.arg(zip.getZipError()).arg(QFileInfo(unOffLib ? unofficialLib : officialLib).fileName()));
return false;
}

Expand Down Expand Up @@ -966,9 +968,9 @@ bool PartWorker::processColourParts(const QStringList &colourPartList, const Par
// add chile part entry to list
if (!entryExists) {
childrenColourParts << childFileString;
emit gui->messageSig(LOG_NOTICE, tr("03 SUBMIT CHILD COLOUR PART INFO:").arg(childFileString.replace(":::", " ")));
emit gui->messageSig(LOG_NOTICE, tr("03 SUBMIT CHILD COLOUR PART INFO: %1").arg(childFileString.replace(":::", " ")));
} else {
emit gui->messageSig(LOG_NOTICE, tr("03 CHILD COLOUR PART EXIST - IGNORING:").arg(childFileString.replace(":::", " ")));
emit gui->messageSig(LOG_NOTICE, tr("03 CHILD COLOUR PART EXIST - IGNORING: %1").arg(childFileString.replace(":::", " ")));
}
}
}
Expand Down Expand Up @@ -996,13 +998,13 @@ bool PartWorker::processColourParts(const QStringList &colourPartList, const Par

} else if (libPartFile.fileName().toLower() == libPartName && partAlreadyInList(libPartName)) {
partFound = true;
emit gui->messageSig(LOG_TRACE, tr("Part already in list:").arg(libPartName));
emit gui->messageSig(LOG_TRACE, tr("Part already in list: %1").arg(libPartName));
break;
}
}

if (!partFound) {
QString lib = Preferences::usingDefaultLibrary ? "Unofficial" : "Custom Parts";
QString const lib = Preferences::usingDefaultLibrary ? QLatin1String("Unofficial") : QLatin1String("Custom Parts");
fileStatus = tr("Part file %1 not found in %2. Be sure the %3 fadeStepColorParts.lst file is up to date.")
.arg(cpPartEntry.replace(":::", " "))
.arg(unOffLib ? tr("%1 Library").arg(lib) : QLatin1String("Official Library"))
Expand All @@ -1013,7 +1015,7 @@ bool PartWorker::processColourParts(const QStringList &colourPartList, const Par
zip.close();

if (zip.getZipError() != UNZ_OK) {
emit gui->messageSig(LOG_ERROR, tr("zip close error: %1").arg(zip.getZipError()));
emit gui->messageSig(LOG_ERROR, tr("zip close error. Return code %1.").arg(zip.getZipError()));
return false;
}
}
Expand All @@ -1023,9 +1025,9 @@ bool PartWorker::processColourParts(const QStringList &colourPartList, const Par
if (childrenColourParts.size() > 0)
processColourParts(childrenColourParts, partType);

QString message = tr("%1 Color %2 content processed.")
.arg(partsProcessed)
.arg(partsProcessed > 1 ? "parts" : "part");
QString const message = tr("%1 Color %2 content processed.")
.arg(partsProcessed)
.arg(partsProcessed > 1 ? tr("parts") : tr("part"));
emit gui->messageSig(LOG_INFO,message);

return true;
Expand Down Expand Up @@ -1131,23 +1133,11 @@ bool PartWorker::createCustomPartFiles(const PartType partType, bool overwriteC
tokens[0] >= "1" && tokens[0] <= "5") &&
(tokens[1] != LDRAW_MAIN_MATERIAL_COLOUR) &&
(tokens[1] != LDRAW_EDGE_MATERIAL_COLOUR)) {
//QString oldColour(tokens[1]); //logging only: show color lines
QString colourCode;
// Insert color code for fade part
if (partType == FADE_PART){
// generate custom color entry - if fadeStepsUseColour, set color to material color (16), without prefix
colourCode = Preferences::fadeStepsUseColour ? LDRAW_MAIN_MATERIAL_COLOUR : tokens[1];
// add color line to local list - if fadeStepsUseColour, no need to create entry
if (!Preferences::fadeStepsUseColour && !gui->colourEntryExist(customPartColourList,colourCode,partType))
customPartColourList << gui->createColourEntry(colourCode,partType);
// set custom color - if fadeStepsUseColour, do not add custom color prefix
tokens[1] = Preferences::fadeStepsUseColour ? colourCode : QString("%1%2").arg(colourPrefix).arg(colourCode);
//logTrace() << "D. CHANGE CHILD PART COLOUR: " << fileNameStr << " NewColour: " << tokens[1] << " OldColour: " << oldColour;
}
// Insert color code for silhouette part
if (partType == HIGHLIGHT_PART){
// generate custom color entry - always
colourCode = tokens[1];
// QString oldColour(tokens[1]); // logging only: show color lines
// Insert color code for fade or silhouette part
if (partType == FADE_PART || partType == HIGHLIGHT_PART){
// generate custom color entry
QString const colourCode = tokens[1];
// add color line to local list - always request to create entry
if (!gui->colourEntryExist(customPartColourList,colourCode,partType))
customPartColourList << gui->createColourEntry(colourCode,partType);
Expand Down Expand Up @@ -1204,7 +1194,7 @@ bool PartWorker::createCustomPartFiles(const PartType partType, bool overwriteC
customPartContent.insert(++insertionPoint,"0");
}

//logTrace() << "04 SAVE CUSTGOM COLOUR PART: " << customPartFile;
//emit gui->messageSig(LOG_TRACE,tr("04 SAVE CUSTGOM COLOUR PART: %1").arg(customPartFile));
if(saveCustomFile(customPartFile, customPartContent))
_customParts++;

Expand Down Expand Up @@ -1237,7 +1227,7 @@ bool PartWorker::saveCustomFile(
out << customPartContent[i] << lpub_endl;
}
file.close();
emit gui->messageSig(LOG_NOTICE,tr("05 WRITE CUSTOM PART TO DISC:").arg(fileName));
emit gui->messageSig(LOG_NOTICE,tr("05 WRITE CUSTOM PART TO DISC: %1").arg(fileName));
return true;
}
}
Expand Down

0 comments on commit 28d2810

Please sign in to comment.