diff --git a/Builds/MSVC/Installer/FractoriumInstaller.wixproj b/Builds/MSVC/Installer/FractoriumInstaller.wixproj index 0c25e5c..5df449a 100644 --- a/Builds/MSVC/Installer/FractoriumInstaller.wixproj +++ b/Builds/MSVC/Installer/FractoriumInstaller.wixproj @@ -1,7 +1,7 @@ 3.7 - Fractorium_23.23.8.101 + Fractorium_23.23.8.102 $(SolutionDir)..\..\..\Bin\$(Platform)\$(Configuration)\ diff --git a/Builds/MSVC/Installer/Product.wxs b/Builds/MSVC/Installer/Product.wxs index c6f57a8..e3892de 100644 --- a/Builds/MSVC/Installer/Product.wxs +++ b/Builds/MSVC/Installer/Product.wxs @@ -1,5 +1,5 @@  - + @@ -12,7 +12,7 @@ - + diff --git a/Builds/MSVC/Solution/Ember.rc b/Builds/MSVC/Solution/Ember.rc index dd0f106..59d493f 100644 Binary files a/Builds/MSVC/Solution/Ember.rc and b/Builds/MSVC/Solution/Ember.rc differ diff --git a/Builds/MSVC/Solution/EmberAnimate.rc b/Builds/MSVC/Solution/EmberAnimate.rc index 00036d8..4ab8d77 100644 --- a/Builds/MSVC/Solution/EmberAnimate.rc +++ b/Builds/MSVC/Solution/EmberAnimate.rc @@ -49,8 +49,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 23, 23, 8, 101 - PRODUCTVERSION 23, 23, 8, 101 + FILEVERSION 23, 23, 8, 102 + PRODUCTVERSION 23, 23, 8, 102 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -67,12 +67,12 @@ BEGIN VALUE "CompanyName", "Open Source" VALUE "FileDescription", "Renders fractal flames as animations with motion blur" - VALUE "FileVersion", "23, 23, 8, 101" + VALUE "FileVersion", "23, 23, 8, 102" VALUE "InternalName", "EmberAnimate.exe" VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2021, GPL v3" VALUE "OriginalFilename", "EmberAnimate.exe" VALUE "ProductName", "Ember Animate" - VALUE "ProductVersion", "23, 23, 8, 101" + VALUE "ProductVersion", "23, 23, 8, 102" END END BLOCK "VarFileInfo" diff --git a/Builds/MSVC/Solution/EmberCL.rc b/Builds/MSVC/Solution/EmberCL.rc index c4a41d3..43e727a 100644 Binary files a/Builds/MSVC/Solution/EmberCL.rc and b/Builds/MSVC/Solution/EmberCL.rc differ diff --git a/Builds/MSVC/Solution/EmberGenome.rc b/Builds/MSVC/Solution/EmberGenome.rc index edaafe6..5e50567 100644 --- a/Builds/MSVC/Solution/EmberGenome.rc +++ b/Builds/MSVC/Solution/EmberGenome.rc @@ -49,8 +49,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 23, 23, 8, 101 - PRODUCTVERSION 23, 23, 8, 101 + FILEVERSION 23, 23, 8, 102 + PRODUCTVERSION 23, 23, 8, 102 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -67,12 +67,12 @@ BEGIN VALUE "CompanyName", "Open Source" VALUE "FileDescription", "Manipulates fractal flame parameter files" - VALUE "FileVersion", "23, 23, 8, 101" + VALUE "FileVersion", "23, 23, 8, 102" VALUE "InternalName", "EmberGenome.exe" VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2021, GPL v3" VALUE "OriginalFilename", "EmberGenome.exe" VALUE "ProductName", "Ember Genome" - VALUE "ProductVersion", "23, 23, 8, 101" + VALUE "ProductVersion", "23, 23, 8, 102" END END BLOCK "VarFileInfo" diff --git a/Builds/MSVC/Solution/EmberRender.rc b/Builds/MSVC/Solution/EmberRender.rc index 176df7a..1d77e64 100644 --- a/Builds/MSVC/Solution/EmberRender.rc +++ b/Builds/MSVC/Solution/EmberRender.rc @@ -49,8 +49,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 23, 23, 8, 101 - PRODUCTVERSION 23, 23, 8, 101 + FILEVERSION 23, 23, 8, 102 + PRODUCTVERSION 23, 23, 8, 102 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -67,12 +67,12 @@ BEGIN VALUE "CompanyName", "Open Source" VALUE "FileDescription", "Renders fractal flames as single images" - VALUE "FileVersion", "23, 23, 8, 101" + VALUE "FileVersion", "23, 23, 8, 102" VALUE "InternalName", "EmberRender.exe" VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2021, GPL v3" VALUE "OriginalFilename", "EmberRender.exe" VALUE "ProductName", "Ember Render" - VALUE "ProductVersion", "23, 23, 8, 101" + VALUE "ProductVersion", "23, 23, 8, 102" END END BLOCK "VarFileInfo" diff --git a/Builds/MSVC/Solution/Fractorium.rc b/Builds/MSVC/Solution/Fractorium.rc index ee4e668..9f28193 100644 Binary files a/Builds/MSVC/Solution/Fractorium.rc and b/Builds/MSVC/Solution/Fractorium.rc differ diff --git a/Source/Ember/EmberDefines.h b/Source/Ember/EmberDefines.h index e164125..a30a92e 100644 --- a/Source/Ember/EmberDefines.h +++ b/Source/Ember/EmberDefines.h @@ -37,7 +37,7 @@ static void sincos(float x, float* s, float* c) namespace EmberNs { -#define EMBER_VERSION "23.23.8.101" +#define EMBER_VERSION "23.23.8.102" //#define FLAM3_COMPAT 1//Uncomment this if you want full compatibility with flam3 regarding some of the trig-based variations in Variations01.h #define EPS6 T(1e-6) #define EPS std::numeric_limits::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way. diff --git a/Source/Fractorium/AboutDialog.ui b/Source/Fractorium/AboutDialog.ui index 52dec0b..1752bfd 100644 --- a/Source/Fractorium/AboutDialog.ui +++ b/Source/Fractorium/AboutDialog.ui @@ -61,7 +61,7 @@ QFrame::NoFrame - <html><head/><body><p align="center"><span style=" font-size:10pt;">Fractorium 23.23.8.101</span></p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">fractorium.com</span></a></p></body></html> + <html><head/><body><p align="center"><span style=" font-size:10pt;">Fractorium 23.23.8.102</span></p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">fractorium.com</span></a></p></body></html> Qt::RichText diff --git a/Source/Fractorium/EmberTreeWidgetItem.h b/Source/Fractorium/EmberTreeWidgetItem.h index bb4bb6d..9297835 100644 --- a/Source/Fractorium/EmberTreeWidgetItem.h +++ b/Source/Fractorium/EmberTreeWidgetItem.h @@ -2,6 +2,9 @@ #include "FractoriumPch.h" +#define INDEX_COL 0 +#define NAME_COL 1 + template class FractoriumEmberController; /// @@ -59,7 +62,7 @@ public: m_Image = QImage(width, height, QImage::Format_RGBA8888); memcpy(m_Image.scanLine(0), v.data(), SizeOf(v));//Memcpy the data in. m_Pixmap = QPixmap::fromImage(m_Image).scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);//Create a QPixmap out of the QImage, scaled to size. - setData(0, Qt::DecorationRole, m_Pixmap); + setData(NAME_COL, Qt::DecorationRole, m_Pixmap); } void SetRendered() @@ -92,7 +95,7 @@ public: m_Ember(ember) { setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled); - setCheckState(0, Qt::Unchecked); + setCheckState(NAME_COL, Qt::Unchecked); } /// @@ -106,18 +109,18 @@ public: m_Ember(ember) { setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled); - setCheckState(0, Qt::Unchecked); + setCheckState(NAME_COL, Qt::Unchecked); } /// /// Copy the text of the tree item to the name of the ember. /// - void UpdateEmberName() { m_Ember->m_Name = text(0).toStdString(); } + void UpdateEmberName() { m_Ember->m_Name = text(NAME_COL).toStdString(); } /// /// Set the text of the tree item. /// - void UpdateEditText() { setText(0, QString::fromStdString(m_Ember->m_Name)); } + void UpdateEditText() { setText(NAME_COL, QString::fromStdString(m_Ember->m_Name)); } /// /// Get a pointer to the ember held by the tree item. diff --git a/Source/Fractorium/FinalRenderDialog.cpp b/Source/Fractorium/FinalRenderDialog.cpp index 229a32a..adeaeeb 100644 --- a/Source/Fractorium/FinalRenderDialog.cpp +++ b/Source/Fractorium/FinalRenderDialog.cpp @@ -260,14 +260,18 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(QWidget* p, Qt::WindowF w = SetTabOrder(this, w, ui.FinalRenderSaveXmlCheckBox); w = SetTabOrder(this, w, ui.FinalRenderDoAllCheckBox); w = SetTabOrder(this, w, ui.FinalRenderDoSequenceCheckBox); + w = SetTabOrder(this, w, ui.FinalRenderUseNumbersForNames); + w = SetTabOrder(this, w, ui.FinalRenderStartAtCheckBox); w = SetTabOrder(this, w, ui.FinalRenderCurrentSpin); - w = SetTabOrder(this, w, ui.FinalRenderDeviceTable); w = SetTabOrder(this, w, ui.FinalRenderApplyToAllCheckBox); + w = SetTabOrder(this, w, ui.FinalRenderDeviceTable); w = SetTabOrder(this, w, ui.FinalRenderThreadCountSpin); w = SetTabOrder(this, w, ui.FinalRenderThreadPriorityComboBox); w = SetTabOrder(this, w, ui.FinalRenderOpenCLSubBatchPctSpin); w = SetTabOrder(this, w, m_WidthScaleSpin); + w = SetTabOrder(this, w, m_WidthSpin); w = SetTabOrder(this, w, m_HeightScaleSpin); + w = SetTabOrder(this, w, m_HeightSpin); w = SetTabOrder(this, w, ui.FinalRenderScaleNoneRadioButton); w = SetTabOrder(this, w, ui.FinalRenderScaleWidthRadioButton); w = SetTabOrder(this, w, ui.FinalRenderScaleHeightRadioButton); @@ -314,16 +318,16 @@ void FractoriumFinalRenderDialog::Show(bool fromSequence) /// /// GUI settings wrapper functions, getters only. /// - bool FractoriumFinalRenderDialog::EarlyClip() { return ui.FinalRenderEarlyClipCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::YAxisUp() { return ui.FinalRenderYAxisUpCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::Transparency() { return ui.FinalRenderTransparencyCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::OpenCL() { return ui.FinalRenderOpenCLCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::Double() { return ui.FinalRenderDoublePrecisionCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::SaveXml() { return ui.FinalRenderSaveXmlCheckBox->isChecked(); } -bool FractoriumFinalRenderDialog::DoAll() { return ui.FinalRenderDoAllCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::DoSequence() { return ui.FinalRenderDoSequenceCheckBox->isChecked(); } +bool FractoriumFinalRenderDialog::DoAll() { return ui.FinalRenderDoAllCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::Png16Bit() { return ui.FinalRenderPng16BitCheckBox->isChecked(); } +bool FractoriumFinalRenderDialog::UseNumbers() { return ui.FinalRenderUseNumbersForNames->isChecked(); } bool FractoriumFinalRenderDialog::KeepAspect() { return ui.FinalRenderKeepAspectCheckBox->isChecked(); } bool FractoriumFinalRenderDialog::ApplyToAll() { return ui.FinalRenderApplyToAllCheckBox->isChecked(); } QString FractoriumFinalRenderDialog::Ext() { return m_Tbcw->m_Combo->currentText(); } @@ -332,6 +336,7 @@ void FractoriumFinalRenderDialog::Path(const QString& s) { ui.FinalRenderParamsT QString FractoriumFinalRenderDialog::Prefix() { return m_PrefixEdit->text(); } QString FractoriumFinalRenderDialog::Suffix() { return m_SuffixEdit->text(); } uint FractoriumFinalRenderDialog::Current() { return ui.FinalRenderCurrentSpin->value(); } +uint FractoriumFinalRenderDialog::StartAt() { return ui.FinalRenderStartAtCheckBox->isChecked() ? Current() - 1 : 0; } uint FractoriumFinalRenderDialog::ThreadCount() { return ui.FinalRenderThreadCountSpin->value(); } #ifdef _WIN32 int FractoriumFinalRenderDialog::ThreadPriority() { return ui.FinalRenderThreadPriorityComboBox->currentIndex() - 2; } @@ -373,6 +378,8 @@ FinalRenderGuiState FractoriumFinalRenderDialog::State() state.m_DoSequence = DoSequence(); state.m_Png16Bit = Png16Bit(); state.m_KeepAspect = KeepAspect(); + state.m_UseNumbers = UseNumbers(); + state.m_StartAt = StartAt(); state.m_Scale = Scale(); state.m_Path = Path(); state.m_Ext = Ext(); diff --git a/Source/Fractorium/FinalRenderDialog.h b/Source/Fractorium/FinalRenderDialog.h index a45fda2..f83da57 100644 --- a/Source/Fractorium/FinalRenderDialog.h +++ b/Source/Fractorium/FinalRenderDialog.h @@ -60,8 +60,9 @@ public: bool Double(); bool SaveXml(); bool DoAll(); - bool DoSequence(); bool Png16Bit(); + bool DoSequence(); + bool UseNumbers(); bool KeepAspect(); bool ApplyToAll(); eScaleType Scale(); @@ -72,6 +73,7 @@ public: QString Prefix(); QString Suffix(); uint Current(); + uint StartAt(); uint ThreadCount(); int ThreadPriority(); double OpenCLSubBatchPct(); diff --git a/Source/Fractorium/FinalRenderDialog.ui b/Source/Fractorium/FinalRenderDialog.ui index ab56401..4e71a8d 100644 --- a/Source/Fractorium/FinalRenderDialog.ui +++ b/Source/Fractorium/FinalRenderDialog.ui @@ -131,28 +131,6 @@ - - - - - 0 - 0 - - - - - - - 1 - - - 999999999 - - - 1 - - - @@ -228,7 +206,7 @@ - Use temporal samples value to achieve motion blur effect between flames + <html><head/><body><p>Use temporal samples value to achieve motion blur effect between flames</p><p>This increases rendering time and is usually not needed when rendering at a higher frame rate such as 60fps</p></body></html> Render as Animation Sequence @@ -245,6 +223,52 @@ + + + + <html><head/><body><p>Use the numerical index of the flame in the file for the output filename instead of the specified filename</p></body></html> + + + Use Numbers for Names + + + + + + + + + + + + 0 + 0 + + + + + + + 1 + + + 999999999 + + + 1 + + + + + + + <html><head/><body><p>Start rendering at the index specified in the spinner below, rather than starting at the first flame in the file.</p><p>This is helpful when resuming a failed/stopped rendering session.</p></body></html> + + + Start at: + + + @@ -1322,7 +1346,6 @@ FinalRenderOpenCLCheckBox FinalRenderDoSequenceCheckBox FinalRenderPng16BitCheckBox - FinalRenderCurrentSpin FinalRenderThreadCountSpin FinalRenderThreadPriorityComboBox FinalRenderOpenCLSubBatchPctSpin diff --git a/Source/Fractorium/FinalRenderEmberController.cpp b/Source/Fractorium/FinalRenderEmberController.cpp index 014f628..57e1265 100644 --- a/Source/Fractorium/FinalRenderEmberController.cpp +++ b/Source/Fractorium/FinalRenderEmberController.cpp @@ -269,6 +269,9 @@ FinalRenderEmberController::FinalRenderEmberController(FractoriumFinalRenderD if (doAll) { m_ImageCount = m_EmberFile.Size(); + ostringstream os; + const auto padding = streamsize(std::log10(m_EmberFile.Size())) + 1; + os << setfill('0') << setprecision(0) << fixed; //Different action required for rendering as animation or not. if (m_GuiState.m_DoSequence && !m_Renderers.empty()) @@ -291,7 +294,7 @@ FinalRenderEmberController::FinalRenderEmberController(FractoriumFinalRenderD } else if (it.m_Time <= prev->m_Time) { - it.m_Time = prev->m_Time + 1; + it.m_Time = prev->m_Time + 1; } it.m_TemporalSamples = m_GuiState.m_TemporalSamples; @@ -303,7 +306,19 @@ FinalRenderEmberController::FinalRenderEmberController(FractoriumFinalRenderD //even when using double precision, which most cards at the time of this writing already exceed. m_GuiState.m_Strips = 1; CopyCont(embers, m_EmberFile.m_Embers); - std::atomic atomfTime(0); + + if (m_GuiState.m_UseNumbers) + { + auto i = 0; + + for (auto& it : embers) + { + it.m_Time = i++; + FormatName(it, os, padding); + } + } + + std::atomic atomfTime(m_GuiState.m_StartAt); vector threadVec; threadVec.reserve(m_Renderers.size()); @@ -320,13 +335,28 @@ FinalRenderEmberController::FinalRenderEmberController(FractoriumFinalRenderD else if (m_Renderer.get())//Make sure a renderer was created and render all images, but not as an animation sequence (without temporal samples motion blur). { //Render each image, cancelling if m_Run ever gets set to false. - for (auto& it : m_EmberFile.m_Embers) + auto i = m_GuiState.m_StartAt; + + while (auto ember = m_EmberFile.Get(i)) { if (!m_Run) break; - Output("Image " + ToString(m_FinishedImageCount.load() + 1) + ":\n" + ComposePath(QString::fromStdString(it.m_Name))); - RenderSingleEmber(it, true, currentStripForProgress); + std::string oldname; + + if (m_GuiState.m_UseNumbers) + { + oldname = ember->m_Name; + ember->m_Time = i; + FormatName(*ember, os, padding); + } + + Output("Image " + ToString(m_FinishedImageCount.load() + 1) + ":\n" + ComposePath(QString::fromStdString(ember->m_Name))); + RenderSingleEmber(*ember, true, currentStripForProgress); + i++; + + if (m_GuiState.m_UseNumbers) + ember->m_Name = oldname; } } else @@ -1003,6 +1033,7 @@ void FinalRenderEmberController::RenderComplete(Ember& ember, const EmberS m_Settings->FinalSaveXml(m_GuiState.m_SaveXml); m_Settings->FinalDoAll(m_GuiState.m_DoAll); m_Settings->FinalDoSequence(m_GuiState.m_DoSequence); + m_Settings->FinalUseNumbers(m_GuiState.m_UseNumbers); m_Settings->FinalPng16Bit(m_GuiState.m_Png16Bit); m_Settings->FinalKeepAspect(m_GuiState.m_KeepAspect); m_Settings->FinalScale(uint(m_GuiState.m_Scale)); diff --git a/Source/Fractorium/FinalRenderEmberController.h b/Source/Fractorium/FinalRenderEmberController.h index 0bcf75b..a82c521 100644 --- a/Source/Fractorium/FinalRenderEmberController.h +++ b/Source/Fractorium/FinalRenderEmberController.h @@ -22,7 +22,6 @@ struct FinalRenderGuiState { bool m_EarlyClip; bool m_YAxisUp; - bool m_AlphaChannel; bool m_Transparency; bool m_OpenCL; bool m_Double; @@ -31,12 +30,14 @@ struct FinalRenderGuiState bool m_Png16Bit; bool m_DoSequence; bool m_KeepAspect; + bool m_UseNumbers; eScaleType m_Scale; QString m_Path; QString m_Ext; QString m_Prefix; QString m_Suffix; QList m_Devices; + uint m_StartAt; uint m_ThreadCount; int m_ThreadPriority; double m_SubBatchPct; diff --git a/Source/Fractorium/Fractorium.ui b/Source/Fractorium/Fractorium.ui index 777fb70..68ea05e 100644 --- a/Source/Fractorium/Fractorium.ui +++ b/Source/Fractorium/Fractorium.ui @@ -6264,8 +6264,8 @@ 0 0 - 144 - 58 + 269 + 650 @@ -7485,6 +7485,11 @@ 27 + + + Index + + Current Flame File @@ -8215,7 +8220,12 @@ - Sequence + Index + + + + + Image diff --git a/Source/Fractorium/FractoriumLibrary.cpp b/Source/Fractorium/FractoriumLibrary.cpp index 6ea9188..c6f75f2 100644 --- a/Source/Fractorium/FractoriumLibrary.cpp +++ b/Source/Fractorium/FractoriumLibrary.cpp @@ -83,7 +83,7 @@ void Fractorium::SelectLibraryItem(size_t index) if (auto emberItem = dynamic_cast(top->child(i))) { emberItem->setSelected(i == index); - emberItem->setCheckState(0, i == index ? Qt::Checked : Qt::Unchecked); + emberItem->setCheckState(NAME_COL, i == index ? Qt::Checked : Qt::Unchecked); } } } @@ -111,7 +111,7 @@ vector> Fractorium::GetCurrentEmberIndex(bool isC { if (isChecked) { - if (item->checkState(0) == Qt::Checked) + if (item->checkState(NAME_COL) == Qt::Checked) v.push_back(make_pair(index, item)); } else @@ -154,19 +154,21 @@ void FractoriumEmberController::SyncLibrary(eLibraryUpdate update) { for (int i = 0; i < top->childCount() && it != m_EmberFile.m_Embers.end(); ++i, ++it)//Iterate through all of the children, which will represent the open embers. { - if (auto item = dynamic_cast*>(top->child(i)))//Cast the child widget to the EmberTreeWidgetItem type. + if (auto emberItem = dynamic_cast*>(top->child(i)))//Cast the child widget to the EmberTreeWidgetItem type. { if (static_cast(update) & static_cast(eLibraryUpdate::INDEX)) it->m_Index = i; if (static_cast(update) & static_cast(eLibraryUpdate::NAME)) - item->setText(0, QString::fromStdString(it->m_Name)); + emberItem->setText(NAME_COL, QString::fromStdString(it->m_Name)); if (static_cast(update) & static_cast(eLibraryUpdate::POINTER)) - item->SetEmberPointer(&(*it)); + emberItem->SetEmberPointer(&(*it)); - if (item->checkState(0) == Qt::Checked) - m_EmberFilePointer = item->GetEmber(); + if (emberItem->checkState(NAME_COL) == Qt::Checked) + m_EmberFilePointer = emberItem->GetEmber(); + + emberItem->setText(INDEX_COL, ToString(i)); } } } @@ -188,21 +190,23 @@ void FractoriumEmberController::FillLibraryTree(int selectIndex) tree->clear(); auto fileItem = new QTreeWidgetItem(tree); QFileInfo info(m_EmberFile.m_Filename); - fileItem->setText(0, info.fileName()); - fileItem->setToolTip(0, m_EmberFile.m_Filename); + fileItem->setText(NAME_COL, info.fileName()); + fileItem->setToolTip(NAME_COL, m_EmberFile.m_Filename); fileItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled); uint i = 0; for (auto& it : m_EmberFile.m_Embers) { auto emberItem = new EmberTreeWidgetItem(&it, fileItem); + auto istr = ToString(i++); + emberItem->setText(INDEX_COL, istr); if (it.m_Name.empty()) - emberItem->setText(0, ToString(i++)); + emberItem->setText(NAME_COL, istr); else - emberItem->setText(0, it.m_Name.c_str()); + emberItem->setText(NAME_COL, it.m_Name.c_str()); - emberItem->setToolTip(0, emberItem->text(0)); + emberItem->setToolTip(NAME_COL, emberItem->text(NAME_COL)); emberItem->SetImage(empy_preview, size, size); } @@ -233,13 +237,15 @@ void FractoriumEmberController::UpdateLibraryTree() for (auto it = Advance(m_EmberFile.m_Embers.begin(), i); it != m_EmberFile.m_Embers.end(); ++it) { auto emberItem = new EmberTreeWidgetItem(&(*it), top); + auto istr = ToString(i++); + emberItem->setText(INDEX_COL, istr); if (it->m_Name.empty()) - emberItem->setText(0, ToString(i++)); + emberItem->setText(NAME_COL, istr); else - emberItem->setText(0, it->m_Name.c_str()); + emberItem->setText(NAME_COL, it->m_Name.c_str()); - emberItem->setToolTip(0, emberItem->text(0)); + emberItem->setToolTip(NAME_COL, emberItem->text(NAME_COL)); emberItem->SetImage(empy_preview, size, size); } @@ -270,7 +276,7 @@ void FractoriumEmberController::EmberTreeItemChanged(QTreeWidgetItem* item, i if (auto emberItem = dynamic_cast*>(item)) { auto oldName = emberItem->GetEmber()->m_Name;//First preserve the previous name. - auto newName = emberItem->text(0).toStdString(); + auto newName = emberItem->text(NAME_COL).toStdString(); //Checking/unchecking other items shouldn't perform the processing below. //If nothing changed, nothing to do. @@ -296,7 +302,7 @@ void FractoriumEmberController::EmberTreeItemChanged(QTreeWidgetItem* item, i } else if (const auto parentItem = dynamic_cast(item)) { - const auto text = parentItem->text(0); + const auto text = parentItem->text(NAME_COL); if (text != "") { @@ -485,12 +491,11 @@ template void FractoriumEmberController::AddAnimationItem() { auto fileItem = new QTreeWidgetItem(m_Fractorium->ui.SequenceTree); - fileItem->setText(0, "Rendered Animation"); - fileItem->setToolTip(0, "Rendered frames can be animated here"); + fileItem->setText(NAME_COL, "Rendered Animation"); fileItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); auto emberItem = new EmberTreeWidgetItemBase(fileItem); emberItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - emberItem->setToolTip(0, "Animated Frame"); + emberItem->setToolTip(INDEX_COL, "Animated Frame"); const uint size = PREVIEW_SIZE; vector empy_preview(size * size * 4); emberItem->SetImage(empy_preview, size, size); @@ -509,34 +514,43 @@ void FractoriumEmberController::FillSequenceTree() vector empy_preview(size * size * 4); const auto tree = m_Fractorium->ui.SequenceTree; tree->clear(); - // Add extra TreeWidget for animation at index 0 + //Add extra TreeWidget for animation at index 0. AddAnimationItem(); + m_AnimateTimer->stop(); auto fileItem = new QTreeWidgetItem(tree); QFileInfo info(m_SequenceFile.m_Filename); - fileItem->setText(0, info.fileName()); - fileItem->setToolTip(0, m_SequenceFile.m_Filename); + fileItem->setText(NAME_COL, info.fileName()); + fileItem->setToolTip(NAME_COL, m_SequenceFile.m_Filename); fileItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable); uint i = 0; for (auto& it : m_SequenceFile.m_Embers) { auto emberItem = new EmberTreeWidgetItemBase(fileItem); + auto istr = ToString(i++); if (it.m_Name.empty()) - emberItem->setText(0, ToString(i)); + emberItem->setText(NAME_COL, istr); else - emberItem->setText(0, it.m_Name.c_str()); + emberItem->setText(NAME_COL, it.m_Name.c_str()); - i++; + emberItem->setText(INDEX_COL, istr); emberItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - emberItem->setToolTip(0, emberItem->text(0)); + emberItem->setToolTip(NAME_COL, emberItem->text(NAME_COL)); emberItem->SetImage(empy_preview, size, size); } tree->expandAll(); - // Hide the animation item + //Hide, then show the animation item. tree->collapseItem(tree->topLevelItem(0)); RenderSequencePreviews(0, uint(m_SequenceFile.Size())); + + if (const auto animation = tree->topLevelItem(0)) + { + animation->setExpanded(true); + m_AnimateFrame = 0; + m_AnimateTimer->start(1000 / m_Fractorium->ui.SequenceAnimationFpsSpinBox->value()); + } } /// @@ -550,7 +564,7 @@ void FractoriumEmberController::SequenceTreeItemChanged(QTreeWidgetItem* item { if (item == m_Fractorium->ui.SequenceTree->topLevelItem(1)) { - auto text = item->text(0); + auto text = item->text(NAME_COL); if (text != "") m_SequenceFile.m_Filename = text; @@ -598,7 +612,7 @@ void Fractorium::SyncFileCountToSequenceCount() if (const auto top = ui.LibraryTree->topLevelItem(0)) { const int count = top->childCount() - 1; - ui.LibraryTree->headerItem()->setText(0, "Current Flame File (" + QString::number(top->childCount()) + ")"); + ui.LibraryTree->headerItem()->setText(NAME_COL, "Current Flame File (" + QString::number(top->childCount()) + ")"); ui.SequenceStartFlameSpinBox->setMinimum(0); ui.SequenceStartFlameSpinBox->setMaximum(count); ui.SequenceStartFlameSpinBox->setValue(0); @@ -835,7 +849,7 @@ void FractoriumEmberController::SequenceAnimateNextFrame() else { animate->m_Pixmap = QPixmap(nth->m_Pixmap); - animate->setData(0, Qt::DecorationRole, animate->m_Pixmap); + animate->setData(NAME_COL, Qt::DecorationRole, animate->m_Pixmap); } } } @@ -859,7 +873,6 @@ void FractoriumEmberController::SequenceAnimateButtonClicked() { animation->setExpanded(true); m_AnimateFrame = 0; - // TODO look at duration based instead of time m_AnimateTimer->start(1000 / m_Fractorium->ui.SequenceAnimationFpsSpinBox->value()); } } diff --git a/Source/Fractorium/FractoriumSettings.cpp b/Source/Fractorium/FractoriumSettings.cpp index 8952650..8625119 100644 --- a/Source/Fractorium/FractoriumSettings.cpp +++ b/Source/Fractorium/FractoriumSettings.cpp @@ -87,9 +87,10 @@ void FractoriumSettings::EnsureDefaults() if (SaveImageExt() == "") #ifndef __APPLE__ - SaveImageExt(".png"); + SaveImageExt(".png"); + #else - SaveImageExt("Png (*.png)"); + SaveImageExt("Png (*.png)"); #endif if (FinalExt() != "jpg" && FinalExt() != "png" && FinalExt() != "exr" @@ -308,6 +309,9 @@ void FractoriumSettings::FinalDoAll(bool b) { setValue(FINALDOALL, b); bool FractoriumSettings::FinalDoSequence() { return value(FINALDOSEQUENCE).toBool(); } void FractoriumSettings::FinalDoSequence(bool b) { setValue(FINALDOSEQUENCE, b); } +bool FractoriumSettings::FinalUseNumbers() { return value(FINALUSENUMBERS).toBool(); } +void FractoriumSettings::FinalUseNumbers(bool b) { setValue(FINALUSENUMBERS, b); } + bool FractoriumSettings::FinalPng16Bit() { return value(FINALPNG16BIT).toBool(); } void FractoriumSettings::FinalPng16Bit(bool b) { setValue(FINALPNG16BIT, b); } diff --git a/Source/Fractorium/FractoriumSettings.h b/Source/Fractorium/FractoriumSettings.h index a867d42..b5acc10 100644 --- a/Source/Fractorium/FractoriumSettings.h +++ b/Source/Fractorium/FractoriumSettings.h @@ -74,6 +74,7 @@ #define FINALTEMPORALSAMPLES "finalrender/temporalsamples" #define FINALSUPERSAMPLE "finalrender/supersample" #define FINALSTRIPS "finalrender/strips" +#define FINALUSENUMBERS "finalrender/usenumbers" #define XMLWIDTH "xml/width" #define XMLHEIGHT "xml/height" @@ -270,6 +271,9 @@ public: bool FinalDoSequence(); void FinalDoSequence(bool b); + bool FinalUseNumbers(); + void FinalUseNumbers(bool b); + bool FinalPng16Bit(); void FinalPng16Bit(bool b);