--User changes

-Add animation sequence creation to Fractorium.
 -Add two new options to EmberGenome which are used when generating an animation sequence.:
  --startcount: Add this number to the filename of each flame.
  --padding: Override the automatically calculated amount of padding zeroes added to each filename.

--Bug fixes
 -Prevent filenames in command line programs from using scientific notation when rendering a large number of frames.
 -Fix tab orders to match newer GUI items which were overlooked in previous releases.
 -Re-render previews if transparency value in the options dialog was changed. Re-rendering was previously only done if early clip or y axis up was changed.
 -Use transparency when rendering thumbnail previews.

--Code changes
 -Wrap EmberCommon.h in a namespace called EmberCommon.
 -Move FormatName() from EmberGenome to EmberCommon.h/cpp
 -Add a prefix parameter to EmberFile::DefaultFilename() to allow for creating a default filename for sequences.
 -When showing the final render dialog, allow specifying where it came from: the toolbar or the render sequence button.
 -Refactor all preview rendering code out into its own class hierarchy with overrides for the main window and the final render dialog.
 -Remove all preview render cancelling functions, they are now built into the new class hierarchy and a new render will not start until the previous one is stopped.
 -Add two new function ConstrainLow() and ConstrainHigh() which wrap constraining two min/max spinboxes to each others' values.
 -Add a bool to FractoriumEmberControllerBase::CopyEmberFile() to specify whether to copy the main file or the sequence file. This is somewhat of a hack and was done in a rush.
 -Add a bool to FractoriumEmberControllerBase::SetEmberFile() to specify whether to move the file rather than copy. This is used in FinalRenderEmberController and improves efficiency.
 -Add wrapper functions for variations filter dialog settings.
This commit is contained in:
mfeemster
2016-06-11 17:47:03 -07:00
parent 51c1cc7a83
commit c91171d392
27 changed files with 1734 additions and 450 deletions

View File

@ -3,6 +3,8 @@
#include "EmberGenome.h"
#include "JpegUtils.h"
using namespace EmberCommon;
/// <summary>
/// Set various default test values on the passed in ember.
/// </summary>
@ -34,14 +36,6 @@ void SetDefaultTestValues(Ember<T>& ember)
ember.m_CurveDE = T(0.6);
}
template <typename T>
void FormatName(Ember<T>& result, ostringstream& os, streamsize padding)
{
os << std::setw(padding) << result.m_Time;
result.m_Name = os.str();
os.str("");
}
/// <summary>
/// The core of the EmberGenome.exe program.
/// Template argument expected to be float or double.
@ -470,18 +464,20 @@ bool EmberGenome(EmberOptions& opt)
frameCount = 0;
os.str("");
os << setfill('0');
auto padding = streamsize(std::log10(((opt.Frames() * opt.Loops()) + opt.Frames()) * embers.size())) + 1;
os << setfill('0') << setprecision(0) << fixed;
auto padding = opt.Padding() ? streamsize(opt.Padding()) : (streamsize(std::log10(opt.StartCount() + (((opt.Frames() * opt.Loops()) + opt.Frames()) * embers.size()))) + 1);
t.Tic();
for (i = 0; i < embers.size(); i++)
{
if (opt.Loops() > 0)
{
for (frame = 0; frame < std::round(opt.Frames() * opt.Loops()); frame++)
size_t roundFrames = size_t(std::round(opt.Frames() * opt.Loops()));
for (frame = 0; frame < roundFrames; frame++)
{
blend = T(frame) / T(opt.Frames());
tools.Spin(embers[i], pTemplate, result, frameCount++, blend);//Result is cleared and reassigned each time inside of Spin().
tools.Spin(embers[i], pTemplate, result, opt.StartCount() + frameCount++, blend);//Result is cleared and reassigned each time inside of Spin().
FormatName(result, os, padding);
cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), opt.HexPalette());
}
@ -489,9 +485,9 @@ bool EmberGenome(EmberOptions& opt)
//The loop above will have rotated just shy of a complete rotation.
//Rotate the next step and save in result, but do not print.
//result will be the starting point for the interp phase below.
frame = size_t(std::round(opt.Frames() * opt.Loops()));
frame = roundFrames;
blend = T(frame) / T(opt.Frames());
tools.Spin(embers[i], pTemplate, result, frameCount, blend);//Do not increment frameCount here.
tools.Spin(embers[i], pTemplate, result, opt.StartCount() + frameCount, blend);//Do not increment frameCount here.
FormatName(result, os, padding);
}
@ -502,18 +498,17 @@ bool EmberGenome(EmberOptions& opt)
for (frame = 0; frame < opt.Frames(); frame++)
{
seqFlag = (frame == 0 || (frame == opt.Frames() - 1));
seqFlag = frame == 0 || (frame == opt.Frames() - 1);
blend = frame / T(opt.Frames());
result.Clear();
tools.SpinInter(&embers[i], pTemplate, result, frameCount++, seqFlag, blend);
tools.SpinInter(&embers[i], pTemplate, result, opt.StartCount() + frameCount++, seqFlag, blend);
FormatName(result, os, padding);
cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), opt.HexPalette());
}
}
}
result = embers.back();
tools.Spin(embers.back(), pTemplate, result, frameCount, 0);
tools.Spin(embers.back(), pTemplate, result, opt.StartCount() + frameCount, 0);
FormatName(result, os, padding);
cout << emberToXml.ToString(result, opt.Extras(), opt.PrintEditDepth(), !opt.NoEdits(), opt.HexPalette());
t.Toc("Sequencing");