Skip to content

Commit

Permalink
Blender LDraw Render - detached process error and warning checks #416
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Jun 4, 2023
1 parent a3685c8 commit 9cfc1e7
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 38 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.3407
pkgver=2.4.6.3408
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.3407
pkgver=2.4.6.3408
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.3407) debian; urgency=medium
lpub3d (2.4.6.3408) debian; urgency=medium

* LPub3D version 2.4.6.296.3407_20230604 for Linux
* LPub3D version 2.4.6.297.3408_20230604 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sun, 04 Jun 2023 02:30:13 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sun, 04 Jun 2023 02:32:12 +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.3407
Version: 2.4.6.3408
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.3407
Version: 2.4.6.3408
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
* Sun Jun 04 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3407
* Sun Jun 04 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3408
- 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.3407) debian; urgency=medium
lpub3d (2.4.6.3408) debian; urgency=medium

* LPub3D version 2.4.6.296.3407_20230604 for Linux
* LPub3D version 2.4.6.297.3408_20230604 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sun, 04 Jun 2023 02:30:15 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sun, 04 Jun 2023 02:32:13 +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.3407
Version: 2.4.6.3408
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.3407
Version: 2.4.6.3408
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
* Sun Jun 04 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3407
* Sun Jun 04 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3408
- 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 296 3407 42f75898d
2 4 6 297 3408 a3685c890
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 = 296
GIT_REVISION = 297
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 = 3407
GIT_COMMIT = 3408
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}.296.3407.42f75898d
GIT_VERSION = $${VERSION}.297.3408.a3685c890
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.296.3407 (04 06 2023 02:30:15)
LPub3D 2.4.6.297.3408 (04 06 2023 02:32:13)

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.296.3407 (04 06 2023 02:30:15)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.297.3408 (04 06 2023 02:32:13)</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.296.3407
;; Last Update.: Sun, 04 Jun 2023 02:30:15 +0200
;; Version.....: 2.4.6.297.3408
;; Last Update.: Sun, 04 Jun 2023 02:32:13 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
47 changes: 31 additions & 16 deletions mainApp/renderdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@ void RenderDialog::on_RenderButton_clicked()
emit gui->messageSig(LOG_INFO, message);
#endif
if (mImportOnly) {
QFileInfo info(GetLogFileName(true/*stdOut*/));
if (info.exists())
QFile::remove(info.absoluteFilePath());
#ifdef Q_OS_WIN
mProcess->startDetached(shellProgram, QStringList() << "/C" << script.fileName());
#else
Expand All @@ -675,6 +678,29 @@ void RenderDialog::on_RenderButton_clicked()
CloseProcess();
if (mStdOutList.size())
WriteStdOut();
if (info.exists())
{
QFile log(info.absoluteFilePath());
QTime waiting = QTime::currentTime().addSecs(3);
while (!log.size() || QTime::currentTime() < waiting)
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
if (log.size()) {
if (log.open(QFile::ReadOnly | QFile::Text))
{
QByteArray ba = log.readAll();
bool const error = QString(ba).contains(QRegExp("(?:\\w)*ERROR: ", Qt::CaseInsensitive));
bool const warning = QString(ba).contains(QRegExp("(?:\\w)*WARNING: ", Qt::CaseInsensitive));
if (error || warning)
{
QMessageBox::Icon icon = error ? QMessageBox::Critical : QMessageBox::Warning;
QString const &items = error ? tr("errors%1").arg(warning ? tr(" and warnings") : "") : warning ? tr("warnings") : "";
QString const &title = tr("Open in Blender standard output");
QString const &body = tr("Open in Blender encountered %1. See Show Details...").arg(items);
BlenderPreferences::showMessage(body, title, QString(), QString(ba), 0, icon);
}
}
}
}
close();
return;
}
Expand Down Expand Up @@ -923,22 +949,10 @@ void RenderDialog::ShowResult()
ui->RenderLabel->setText(tr("Image generation failed."));
ui->RenderProgress->setRange(0,1);
ui->RenderProgress->setValue(0);
QMessageBoxResizable box;
box.setTextFormat (Qt::RichText);
box.setIcon (QMessageBox::Critical);
box.setStandardButtons (QMessageBox::Ok);
box.setDefaultButton (QMessageBox::Ok);
box.setWindowFlags (Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
box.setWindowTitle(mRenderType == BLENDER_RENDER ? tr("Blender Render") : tr("POV-Ray Render"));

QString header = "<b>" + tr ("Render Error.") + "</b>";
QString body = tr ("An error occurred while rendering. See Show Details...");
box.setText (header);
box.setInformativeText (body);
box.setDetailedText(StdErrLog);
box.exec();
QString const &title = mRenderType == BLENDER_RENDER ? tr("Blender Render") : tr("POV-Ray Render");
QString const &body = tr ("An error occurred while rendering. See Show Details...");
BlenderPreferences::showMessage(body, title, QString(), StdErrLog, 0, QMessageBox::Critical);
return;

} else {
ui->RenderProgress->setValue(ui->RenderProgress->maximum());
}
Expand Down Expand Up @@ -1063,7 +1077,8 @@ void RenderDialog::CloseProcess()
emit gui->messageSig(LOG_INFO, tr("Blender process closed"));
}

ui->RenderButton->setText(mImportOnly ? tr("Import") : tr("Render"));
if (!mImportOnly)
ui->RenderButton->setText(tr("Render"));
}

bool RenderDialog::PromptCancel()
Expand Down

0 comments on commit 9cfc1e7

Please sign in to comment.