Skip to content

Commit

Permalink
Blender LDraw Render - Matthew Morrison import #416
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Mar 14, 2023
1 parent 6aa0594 commit a6664fc
Show file tree
Hide file tree
Showing 20 changed files with 1,353 additions and 575 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.3173
pkgver=2.4.6.3174
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.3173
pkgver=2.4.6.3174
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.3173) debian; urgency=medium
lpub3d (2.4.6.3174) debian; urgency=medium

* LPub3D version 2.4.6.62.3173_20230314 for Linux
* LPub3D version 2.4.6.63.3174_20230314 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Tue, 14 Mar 2023 15:52:54 +0100
-- Trevor SANDY <trevor.sandy@gmail.com> Tue, 14 Mar 2023 15:54:33 +0100
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.3173
Version: 2.4.6.3174
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.3173
Version: 2.4.6.3174
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
* Tue Mar 14 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3173
* Tue Mar 14 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3174
- 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.3173) debian; urgency=medium
lpub3d (2.4.6.3174) debian; urgency=medium

* LPub3D version 2.4.6.62.3173_20230314 for Linux
* LPub3D version 2.4.6.63.3174_20230314 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Tue, 14 Mar 2023 15:52:55 +0100
-- Trevor SANDY <trevor.sandy@gmail.com> Tue, 14 Mar 2023 15:54:34 +0100
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.3173
Version: 2.4.6.3174
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.3173
Version: 2.4.6.3174
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
* Tue Mar 14 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3173
* Tue Mar 14 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3174
- 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 62 3173 8f515541e
2 4 6 63 3174 6aa059413
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 = 62
GIT_REVISION = 63
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 = 3173
GIT_COMMIT = 3174
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}.62.3173.8f515541e
GIT_VERSION = $${VERSION}.63.3174.6aa059413
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
5 changes: 3 additions & 2 deletions mainApp/declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ enum ThemeColorType {
#define FINDREPLACEWINDOW "FindReplaceWindow"
#define UPDATES "Updates"
#define LOGGING "Logging"
#define IMPORTLDRAW "importldraw"
#define IMPORTDEFAULT "DEFAULT"
#define IMPORTLDRAW "ImportLDraw"
#define IMPORTLDRAWMM "ImportLDrawMM"
#define THEMECOLORS "ThemeColors"
#define KEYBOARDSHORTCUTS "KeyboardShortcuts"
#define TABLAYOUTS "TabLayouts"
Expand Down Expand Up @@ -759,6 +759,7 @@ enum ThemeColorType {
#define DEFAULT_SUBMODEL_CAMERA_LATITUDE 23
#define DEFAULT_SUBMODEL_CAMERA_LONGITUDE -45

#define DEFAULT_BLENDER_IMPORT_MODULE "TN"

#define DEFAULT_SUBMODEL_COLOR_01 "#FFFFFF"
#define DEFAULT_SUBMODEL_COLOR_02 "#FFFFCC"
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.62.3173 (14 03 2023 15:52:55)
LPub3D 2.4.6.63.3174 (14 03 2023 15:54:34)

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 @@ -17,7 +17,7 @@
<body id="preview">
<table class="tg">
<tr>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.62.3173 (14 03 2023 15:52:55)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.63.3174 (14 03 2023 15:54:34)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.36.3379 (26 01 2023 01:22:34)</h4>
<hr>
<p>
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.62.3173
;; Last Update.: Tue, 14 Mar 2023 15:52:55 +0100
;; Version.....: 2.4.6.63.3174
;; Last Update.: Tue, 14 Mar 2023 15:54:34 +0100
;; 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.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6834,7 +6834,7 @@ void Gui::createMenus()
editorMenu->addSeparator();
if (Preferences::blenderInstalled)
editorMenu->addAction(getAct("editBlenderParametersAct.1"));
if (Preferences::blenderInstalled && !Preferences::blenderRenderConfigFile.isEmpty())
if (Preferences::blenderInstalled && !Preferences::blenderLDrawConfigFile.isEmpty())
editorMenu->addAction(getAct("editBlenderPreferencesAct.1"));
editorMenu->addAction(getAct("editNativePOVIniAct.1"));
editorMenu->addAction(getAct("editLdgliteIniAct.1"));
Expand Down Expand Up @@ -7131,7 +7131,7 @@ void Gui::createToolBars()
#endif
if (!Preferences::blenderExe.isEmpty())
editParamsToolBar->addAction(getAct("editBlenderParametersAct.1"));
if (Preferences::blenderInstalled && !Preferences::blenderRenderConfigFile.isEmpty())
if (Preferences::blenderInstalled && !Preferences::blenderLDrawConfigFile.isEmpty())
editParamsToolBar->addAction(getAct("editBlenderPreferencesAct.1"));
editParamsToolBar->addAction(getAct("editNativePOVIniAct.1"));
editParamsToolBar->addAction(getAct("editLdgliteIniAct.1"));
Expand Down
100 changes: 69 additions & 31 deletions mainApp/lpub_preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,9 @@ QString Preferences::systemEditor;
QString Preferences::currentLibrarySave = EMPTY_STRING_DEFAULT;

QString Preferences::blenderVersion;
QString Preferences::blenderRenderConfigFile;
QString Preferences::blenderDocumentConfigFile;
QString Preferences::blenderLDrawConfigFile;
QString Preferences::blenderPreferencesFile;
QString Preferences::blenderImportModule = DEFAULT_BLENDER_IMPORT_MODULE;
QString Preferences::blenderExe;

QStringList Preferences::ldSearchDirs;
Expand Down Expand Up @@ -2742,38 +2743,38 @@ void Preferences::rendererPreferences()
updatePOVRayConfFile(SkipExisting);
updatePOVRayIniFile(SkipExisting);

// Blender config files
// Blender config file path
QString const blenderConfigDir = QString("%1/Blender/config").arg(lpub3d3rdPartyConfigDir);

// Individual render config file
QString const blenderRenderConfigFileKey("BlenderConfigFile");
if ( ! Settings.contains(QString("%1/%2").arg(SETTINGS,blenderRenderConfigFileKey))) {
blenderRenderConfigFile = QString("%1/%2").arg(blenderConfigDir,VER_BLENDER_RENDER_CONFIG_FILE);
if (QFileInfo(blenderRenderConfigFile).exists())
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderRenderConfigFileKey),QVariant(blenderRenderConfigFile));
// Blender LDraw config file
QString const blenderLDrawConfigFileKey("BlenderLDrawConfigFile");
if ( ! Settings.contains(QString("%1/%2").arg(SETTINGS,blenderLDrawConfigFileKey))) {
blenderLDrawConfigFile = QString("%1/%2").arg(blenderConfigDir,VER_BLENDER_RENDER_CONFIG_FILE);
if (QFileInfo(blenderLDrawConfigFile).exists())
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderLDrawConfigFileKey),QVariant(blenderLDrawConfigFile));
else
blenderRenderConfigFile.clear();
blenderLDrawConfigFile.clear();
} else {
blenderRenderConfigFile = Settings.value(QString("%1/%2").arg(SETTINGS,blenderRenderConfigFileKey)).toString();
if (!QFileInfo(blenderRenderConfigFile).exists()) {
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderRenderConfigFileKey));
blenderRenderConfigFile.clear();
blenderLDrawConfigFile = Settings.value(QString("%1/%2").arg(SETTINGS,blenderLDrawConfigFileKey)).toString();
if (!QFileInfo(blenderLDrawConfigFile).exists()) {
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderLDrawConfigFileKey));
blenderLDrawConfigFile.clear();
}
}

// Document render config file
QString const blenderDocumentConfigFileKey("BlenderConfigFile");
if ( ! Settings.contains(QString("%1/%2").arg(SETTINGS,blenderDocumentConfigFileKey))) {
blenderDocumentConfigFile = QString("%1/%2").arg(blenderConfigDir,VER_BLENDER_DOCUMENT_CONFIG_FILE);
if (QFileInfo(blenderDocumentConfigFile).exists())
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderDocumentConfigFileKey),QVariant(blenderDocumentConfigFile));
QString const blenderPreferencesFileKey("BlenderPreferencesFile");
if ( ! Settings.contains(QString("%1/%2").arg(SETTINGS,blenderPreferencesFileKey))) {
blenderPreferencesFile = QString("%1/%2").arg(blenderConfigDir,VER_BLENDER_DOCUMENT_CONFIG_FILE);
if (QFileInfo(blenderPreferencesFile).exists())
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderPreferencesFileKey),QVariant(blenderPreferencesFile));
else
blenderDocumentConfigFile.clear();
blenderPreferencesFile.clear();
} else {
blenderDocumentConfigFile = Settings.value(QString("%1/%2").arg(SETTINGS,blenderDocumentConfigFileKey)).toString();
if (!QFileInfo(blenderDocumentConfigFile).exists()) {
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderDocumentConfigFileKey));
blenderDocumentConfigFile.clear();
blenderPreferencesFile = Settings.value(QString("%1/%2").arg(SETTINGS,blenderPreferencesFileKey)).toString();
if (!QFileInfo(blenderPreferencesFile).exists()) {
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderPreferencesFileKey));
blenderPreferencesFile.clear();
}
}

Expand All @@ -2800,7 +2801,7 @@ void Preferences::rendererPreferences()

// Blender version
QString const blenderVersionKey("BlenderVersion");
if (blenderInstalled && !blenderRenderConfigFile.isEmpty()){
if (blenderInstalled && !blenderLDrawConfigFile.isEmpty()) {
if (Settings.contains(QString("%1/%2").arg(SETTINGS,blenderVersionKey))) {
blenderVersion = Settings.value(QString("%1/%2").arg(SETTINGS,blenderVersionKey)).toString();
logInfo() << QString("Blender version: %1").arg(blenderVersion);
Expand All @@ -2812,6 +2813,19 @@ void Preferences::rendererPreferences()
blenderVersion.clear();
}

// Blender import module
QString const blenderImportModuleKey("BlenderImportModule");
if (blenderInstalled && !blenderLDrawConfigFile.isEmpty()) {
if (Settings.contains(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey)))
blenderImportModule = Settings.value(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey)).toString();
else
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey),QVariant(blenderImportModule));
logInfo() << QString("Blender import module: %1").arg(blenderImportModule);
} else if (Settings.contains(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey))) {
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey));
blenderImportModule.clear();
}

// Populate POVRay Library paths
if (!povRayInstalled)
return;
Expand Down Expand Up @@ -4327,25 +4341,49 @@ void Preferences::setSceneGuideColorPreference(QString s)
void Preferences::setBlenderExePathPreference(QString s)
{
QSettings Settings;
blenderExe = s;
QVariant uValue(s);
blenderInstalled = true;
if (!QFileInfo(s).exists())
blenderInstalled = false;
else
blenderExe = QDir::toNativeSeparators(s);
QString const blenderExeKey("BlenderExeFile");
if (blenderExe.isEmpty())
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderExeKey));
else
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderExeKey),uValue);
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderExeKey),QVariant(s));
}

void Preferences::setBlenderVersionPreference(QString s)
{
QSettings Settings;
blenderVersion = s;
QVariant uValue(s);
QString const blenderVersionKey("BlenderVersion");
if (blenderVersion.isEmpty())
if (s.isEmpty())
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderVersionKey));
else
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderVersionKey),uValue);
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderVersionKey),QVariant(s));
}

void Preferences::setBlenderLDrawConfigPreference(QString s)
{
QSettings Settings;
blenderLDrawConfigFile = QDir::toNativeSeparators(s);
QString const blenderLDrawConfigKey("BlenderLDrawConfigFile");
if (s.isEmpty())
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderLDrawConfigKey));
else
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderLDrawConfigKey),QVariant(s));
}

void Preferences::setBlenderImportModule(QString s)
{
QSettings Settings;
blenderImportModule = s;
QString const blenderImportModuleKey("BlenderImportModule");
if (s.isEmpty())
Settings.remove(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey));
else
Settings.setValue(QString("%1/%2").arg(SETTINGS,blenderImportModuleKey),QVariant(s));
}

void Preferences::removeBuildModFormatPreference(bool i)
Expand Down
7 changes: 5 additions & 2 deletions mainApp/lpub_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class Preferences
static void setSceneGuideColorPreference(QString);
static void setBlenderExePathPreference(QString);
static void setBlenderVersionPreference(QString);
static void setBlenderLDrawConfigPreference(QString);
static void setBlenderImportModule(QString);

static void setInitFadeSteps();
static void setInitHighlightStep();
Expand Down Expand Up @@ -244,8 +246,9 @@ class Preferences
static QString ldrawColourPartsFile;

static QString blenderVersion;
static QString blenderRenderConfigFile;
static QString blenderDocumentConfigFile;
static QString blenderLDrawConfigFile;
static QString blenderPreferencesFile;
static QString blenderImportModule;
static QString blenderExe;

static QString blCodesFile;
Expand Down
Loading

0 comments on commit a6664fc

Please sign in to comment.