Skip to content

Commit

Permalink
Blender LDraw Render - add addon settings to Preferences #416
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 8, 2023
1 parent 3f87304 commit 8f6c632
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 31 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.3361
pkgver=2.4.6.3362
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.3361
pkgver=2.4.6.3362
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.3361) debian; urgency=medium
lpub3d (2.4.6.3362) debian; urgency=medium

* LPub3D version 2.4.6.250.3361_20230509 for Linux
* LPub3D version 2.4.6.251.3362_20230509 for Linux

-- Trevor SANDY <[email protected]> Tue, 09 May 2023 01:15:56 +0200
-- Trevor SANDY <[email protected]> Tue, 09 May 2023 01:16:20 +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.3361
Version: 2.4.6.3362
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.3361
Version: 2.4.6.3362
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 May 09 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3361
* Tue May 09 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3362
- 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.3361) debian; urgency=medium
lpub3d (2.4.6.3362) debian; urgency=medium

* LPub3D version 2.4.6.250.3361_20230509 for Linux
* LPub3D version 2.4.6.251.3362_20230509 for Linux

-- Trevor SANDY <[email protected]> Tue, 09 May 2023 01:15:58 +0200
-- Trevor SANDY <[email protected]> Tue, 09 May 2023 01:16:21 +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.3361
Version: 2.4.6.3362
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.3361
Version: 2.4.6.3362
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 May 09 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3361
* Tue May 09 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3362
- 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 250 3361 d96c48185
2 4 6 251 3362 3f873046d
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 = 250
GIT_REVISION = 251
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 = 3361
GIT_COMMIT = 3362
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}.250.3361.d96c48185
GIT_VERSION = $${VERSION}.251.3362.3f873046d
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.250.3361 (09 05 2023 01:15:58)
LPub3D 2.4.6.251.3362 (09 05 2023 01:16:21)

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.250.3361 (09 05 2023 01:15:58)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.251.3362 (09 05 2023 01:16:21)</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.250.3361
;; Last Update.: Tue, 09 May 2023 01:15:58 +0200
;; Version.....: 2.4.6.251.3362
;; Last Update.: Tue, 09 May 2023 01:16:21 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
31 changes: 27 additions & 4 deletions mainApp/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="NativeTab">
<attribute name="title">
Expand Down Expand Up @@ -2343,6 +2343,20 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="BlenderTab">
<attribute name="title">
<string>Blender</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QGroupBox" name="blenderGrpBox">
<property name="title">
<string>Blender LDraw Addon Is Installed</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
Expand Down Expand Up @@ -3379,7 +3393,7 @@ Check if LSynth parts exist in LDraw folder but not included in search paths -e.
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabUpdates">
<attribute name="title">
Expand Down Expand Up @@ -3780,6 +3794,7 @@ p, li { white-space: pre-wrap; }
<tabstop>applyCARendererRadio</tabstop>
<tabstop>optionsButton</tabstop>
<tabstop>preferredRenderer</tabstop>
<tabstop>projectionCombo</tabstop>
<tabstop>rendererTimeout</tabstop>
<tabstop>antiAliasing</tabstop>
<tabstop>antiAliasingSamples</tabstop>
Expand All @@ -3789,6 +3804,7 @@ p, li { white-space: pre-wrap; }
<tabstop>MeshLODSlider</tabstop>
<tabstop>ShadingMode</tabstop>
<tabstop>studStyleCombo</tabstop>
<tabstop>HighContrastButton</tabstop>
<tabstop>LPubFadeHighlight</tabstop>
<tabstop>ConditionalLinesCheckBox</tabstop>
<tabstop>FadeSteps</tabstop>
Expand All @@ -3797,7 +3813,6 @@ p, li { white-space: pre-wrap; }
<tabstop>HighlightNewParts</tabstop>
<tabstop>HighlightNewPartsColor</tabstop>
<tabstop>ResetHighlightNewPartsButton</tabstop>
<tabstop>HighContrastButton</tabstop>
<tabstop>AutomateEdgeColor</tabstop>
<tabstop>AutomateEdgeColorButton</tabstop>
<tabstop>ViewpointsCombo</tabstop>
Expand Down Expand Up @@ -3869,10 +3884,17 @@ p, li { white-space: pre-wrap; }
<tabstop>includeAllLogAttribBox</tabstop>
<tabstop>logLevelGrpBox</tabstop>
<tabstop>logLevelCombo</tabstop>
<tabstop>suppressFPrintBox</tabstop>
<tabstop>logLevelsGrpBox</tabstop>
<tabstop>fatalLevelBox</tabstop>
<tabstop>errorLevelBox</tabstop>
<tabstop>statusLevelBox</tabstop>
<tabstop>warningLevelBox</tabstop>
<tabstop>allLogLevelsBox</tabstop>
<tabstop>infoLevelBox</tabstop>
<tabstop>noticeLevelBox</tabstop>
<tabstop>traceLevelBox</tabstop>
<tabstop>debugLevelBox</tabstop>
<tabstop>commandList</tabstop>
<tabstop>KeyboardFilterEdit</tabstop>
<tabstop>shortcutsImport</tabstop>
Expand All @@ -3881,9 +3903,9 @@ p, li { white-space: pre-wrap; }
<tabstop>shortcutEdit</tabstop>
<tabstop>shortcutAssign</tabstop>
<tabstop>shortcutRemove</tabstop>
<tabstop>othersTabWidget</tabstop>
<tabstop>lineEditIniFile</tabstop>
<tabstop>textEditSearchDirs</tabstop>
<tabstop>othersTabWidget</tabstop>
<tabstop>checkUpdateFrequency_Combo</tabstop>
<tabstop>moduleVersion_Combo</tabstop>
<tabstop>showAllNotificstions_Chk</tabstop>
Expand All @@ -3894,6 +3916,7 @@ p, li { white-space: pre-wrap; }
<tabstop>autoUpdateChangeLogBox</tabstop>
<tabstop>updateChangeLogBtn</tabstop>
<tabstop>changeLog_txbr</tabstop>
<tabstop>renderersTabWidget</tabstop>
</tabstops>
<resources/>
<connections>
Expand Down
55 changes: 50 additions & 5 deletions mainApp/preferencesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "application.h"
#include "updatecheck.h"
#include "commonmenus.h"
#include "blenderpreferences.h"

#include <LDVQt/LDVWidget.h>

Expand Down Expand Up @@ -394,6 +395,8 @@ void PreferencesDialog::setPreferences()

// end preferred renderer

setBlenderAddonPreferences();

ui.fadeStepsUseColourGrpBox->setTitle( fadeStepsColorTitle);
ui.pliControlEdit->setText( Preferences::pliControlFile);
ui.altLDConfigPath->setText( Preferences::altLDConfigPath);
Expand Down Expand Up @@ -760,6 +763,48 @@ void PreferencesDialog::installRenderer()
}
}

void PreferencesDialog::setBlenderAddonPreferences()
{
ui.blenderGrpBox->setTitle(tr("Blender Render Settings"));
blenderAddonPreferences =
new BlenderPreferences(
RENDER_DEFAULT_WIDTH,
RENDER_DEFAULT_HEIGHT,
1.0,
false,
ui.blenderGrpBox);

QDialogButtonBox *buttonBox;
buttonBox = new QDialogButtonBox(this);
QPushButton *applyBtn = new QPushButton(tr("Apply"));
buttonBox->addButton(applyBtn,QDialogButtonBox::ActionRole);
connect(applyBtn,SIGNAL(clicked()),this,SLOT(applyBlenderAddonPreferences()));

blenderAddonPathsBtn = new QPushButton(tr("Show Paths"));
buttonBox->addButton(blenderAddonPathsBtn,QDialogButtonBox::ActionRole);
connect(blenderAddonPathsBtn,SIGNAL(clicked()),this,SLOT(showBlenderAddonPaths()));

QPushButton *resetBtn = new QPushButton(tr("Reset"));
buttonBox->addButton(resetBtn,QDialogButtonBox::ActionRole);
QObject::connect(resetBtn,SIGNAL(clicked()),blenderAddonPreferences,SLOT(resetSettings()));

ui.blenderGrpBox->layout()->addWidget(buttonBox);
}

void PreferencesDialog::applyBlenderAddonPreferences()
{
blenderAddonPreferences->apply(QDialog::Accepted);
}

void PreferencesDialog::showBlenderAddonPaths()
{
if(blenderAddonPathsBtn->text().startsWith("Hide"))
blenderAddonPathsBtn->setText(tr("Show Paths"));
else
blenderAddonPathsBtn->setText(tr("Hide Paths"));
blenderAddonPreferences->showPathsGroup();
}

void PreferencesDialog::sceneColorButtonClicked()
{
QObject *button = sender();
Expand All @@ -771,31 +816,31 @@ void PreferencesDialog::sceneColorButtonClicked()
{
oldColor = QColor(sceneBackgroundColorStr);
title = tr("Select Scene Background Color");
dialogOptions = nullptr;
dialogOptions = QColorDialog::ShowAlphaChannel;
}
else if (button == ui.sceneGridColorButton)
{
oldColor = QColor(sceneGridColorStr);
title = tr("Select Scene Grid Color");
dialogOptions = nullptr;
dialogOptions = QColorDialog::ShowAlphaChannel;
}
else if (button == ui.sceneRulerTickColorButton)
{
oldColor = QColor(sceneRulerTickColorStr);
title = tr("Select Scene Ruler Tick Color");
dialogOptions = nullptr;
dialogOptions = QColorDialog::ShowAlphaChannel;
}
else if (button == ui.sceneRulerTrackingColorButton)
{
oldColor = QColor(sceneRulerTrackingColorStr);
title = tr("Select Ruler Tracking Color");
dialogOptions = nullptr;
dialogOptions = QColorDialog::ShowAlphaChannel;
}
else if (button == ui.sceneGuideColorButton)
{
oldColor = QColor(sceneGuideColorStr);
title = tr("Select Scene Guide Color");
dialogOptions = nullptr;
dialogOptions = QColorDialog::ShowAlphaChannel;
}
else
return;
Expand Down
9 changes: 9 additions & 0 deletions mainApp/preferencesdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace Ui{
class PreferencesDialog;
}

class BlenderPreferences;
class ThemeColorsDialog;
class PreferencesDialog : public QDialog
{
Expand Down Expand Up @@ -277,6 +278,9 @@ class PreferencesDialog : public QDialog
void shortcutEditReset();
void enableShortcutEditReset(const QString &displayText);

void applyBlenderAddonPreferences();
void showBlenderAddonPaths();

bool maybeSave();
void closeEvent(QCloseEvent *event) override;

Expand All @@ -292,6 +296,11 @@ class PreferencesDialog : public QDialog
bool isValidKeyboardShortcut(const QString &ObjectName, const QString &NewShortcut);
bool isValidKeyboardShortcut(const QString &ObjectName, const QString &NewShortcut, QString &Result, bool Loading);

void setBlenderAddonPreferences();

QPushButton *blenderAddonPathsBtn;
BlenderPreferences *blenderAddonPreferences;

QDialog *messageDialog;
QToolButton *parseErrorTBtn;
QLabel *parseErrorLbl;
Expand Down

0 comments on commit 8f6c632

Please sign in to comment.