Skip to content

Commit eeeb039

Browse files
committed
Overhauled frame number handling in animation status messages.
Animation status messages now consistently display a running frame count and the total number of frames actually to be rendered, properly taking into account the Frame_Step setting. Additionally, the status messages now also show the nominal frame number as used in the `frame_number` variable and the output filename.
1 parent 8706877 commit eeeb039

File tree

11 files changed

+94
-58
lines changed

11 files changed

+94
-58
lines changed

changes.txt

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Detailed changelog information is available in the file `revision.txt`, which
2323
should be located in the same directory as this file is.
2424
------------------------------------------------------------------------------
2525

26+
2627
Changes between 3.7.0 and 3.7.1-TBD
2728
===================================
2829

@@ -45,8 +46,8 @@ Prior to the release of 3.7.1, the following items still need urgent attention:
4546

4647
- The Windows version's inbuilt help index needs to be fixed.
4748

48-
New Features and Improvements
49-
-----------------------------
49+
New Features
50+
------------
5051

5152
- A new inbuilt constant, `tau`, has been added as shorthand for `2*pi`, in
5253
support of the world-wide initiative to obsolete pi in favour of the new,
@@ -67,8 +68,6 @@ New Features and Improvements
6768

6869
- The macro syntax has been extended to allow for optional parameters.
6970

70-
- POV-Ray for Windows now reports file names and line numbers of warnings.
71-
7271
- Light sources' distance-based fading can now be set to obey an inverse-power
7372
law at all distances.
7473

@@ -88,14 +87,10 @@ New Features and Improvements
8887
- Fresnel angle-dependent attenuation can now also be applied to highlights
8988
and the diffuse component for more physical realism.
9089

91-
- Colour maps, pigment maps and the like are no longer limited to 256 entries.
92-
9390
- The creation of a log for the `+C` render abort-continue feature can now be
9491
suppressed using `-CC` to save disk space.
9592

96-
- The number of components ber blob is no longer artificially limited.
97-
98-
For more details on the new features, see the documentation.
93+
For more details on the above new features, see the documentation.
9994

10095
Changed Behaviour
10196
-----------------
@@ -110,7 +105,7 @@ Changed Behaviour
110105
`#version 3.7` (or later) directive anywhere in the main scene file.
111106

112107
- Using `ambient` with a suspiciously high value in a non-legacy scene will
113-
now prompt a warning, unless an `emission` is also specified.
108+
now prompt a warning, unless `emission` is also specified.
114109

115110
- POV-Ray will now try to auto-detect whether an input TIFF file with alpha
116111
channel uses premultiplied or non-premultiplied alpha mode, rather than
@@ -158,6 +153,14 @@ Compatibility Improvements
158153
- Thread stack size has been increased to avoid problems on some platforms.
159154
(requires boost 1.50 or later)
160155

156+
Miscellaneous Improvements
157+
--------------------------
158+
159+
- Animation status messages now include the nominal frame number.
160+
- POV-Ray for Windows now reports file names and line numbers of warnings.
161+
- Colour maps, pigment maps and the like are no longer limited to 256 entries.
162+
- The number of components ber blob is no longer artificially limited.
163+
161164
Fixed or Mitigated Bugs Reported by Static Code Analysis
162165
--------------------------------------------------------
163166

@@ -256,6 +259,9 @@ Reported via Windows Crash Reports:
256259

257260
Miscellaneous:
258261

262+
- Animation status messages now consistently display a running frame count and
263+
the total number of frames actually to be rendered, properly taking into
264+
account the Frame_Step setting.
259265
- Fixed mesh_camera-related flaws in the parser.
260266
- Fixed a family of bugs that could cause problems when using focal blur with
261267
some camera types if the camera is very close to the surface of a media
@@ -284,6 +290,7 @@ Other Noteworthy
284290
- The Visual Studio 2010 project for a console-only Windows version has been
285291
revived.
286292

293+
287294
---------------------------------
288295
Changes between 3.7.RC7 and 3.7.0
289296
---------------------------------

source/base/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#define OFFICIAL_VERSION_STRING "3.7.1"
4646
#define OFFICIAL_VERSION_NUMBER 371
4747

48-
#define POV_RAY_PRERELEASE "alpha.8581629"
48+
#define POV_RAY_PRERELEASE "alpha.8586521"
4949

5050
#if (POV_RAY_IS_AUTOBUILD == 1) && ((POV_RAY_IS_OFFICIAL == 1) || (POV_RAY_IS_SEMI_OFFICIAL == 1))
5151
#ifdef POV_RAY_PRERELEASE

source/frontend/animationprocessing.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
11-
/// Copyright 1991-2015 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -101,7 +101,8 @@ AnimationProcessing::AnimationProcessing(POVMS_Object& options) :
101101
oddFieldFlag = renderOptions.TryGetBool(kPOVAttrib_OddField, false);
102102

103103
clockDelta = double(finalClock - initialClock) / double(finalFrame - initialFrame);
104-
frameNumber = subsetStartFrame;
104+
runningFrameNumber = 1;
105+
nominalFrameNumber = subsetStartFrame;
105106
clockValue = POVMSFloat(double(clockDelta * double(subsetStartFrame - initialFrame)) + double(initialClock));
106107

107108
frameNumberDigits = 1;
@@ -116,7 +117,7 @@ POVMS_Object AnimationProcessing::GetFrameRenderOptions()
116117
opts.SetFloat(kPOVAttrib_Clock, clockValue);
117118

118119
// append to console files if not first frame (user can set this for first frame via command line to append all data to existing files, so don't set it to false)
119-
if(frameNumber > subsetStartFrame)
120+
if(nominalFrameNumber > subsetStartFrame)
120121
opts.SetBool(kPOVAttrib_AppendConsoleFiles, true);
121122

122123
POVMS_List declares;
@@ -140,7 +141,7 @@ POVMS_Object AnimationProcessing::GetFrameRenderOptions()
140141

141142
POVMS_Object frame_number(kPOVMSType_WildCard);
142143
frame_number.SetString(kPOVAttrib_Identifier, "frame_number");
143-
frame_number.SetFloat(kPOVAttrib_Value, frameNumber);
144+
frame_number.SetFloat(kPOVAttrib_Value, nominalFrameNumber);
144145
declares.Append(frame_number);
145146

146147
POVMS_Object initial_clock(kPOVMSType_WildCard);
@@ -163,33 +164,39 @@ POVMS_Object AnimationProcessing::GetFrameRenderOptions()
163164

164165
void AnimationProcessing::ComputeNextFrame()
165166
{
166-
frameNumber+= frameStep;
167-
clockValue = POVMSFloat(double(clockDelta * double(frameNumber - initialFrame)) + double(initialClock));
167+
nominalFrameNumber+= frameStep;
168+
++runningFrameNumber;
169+
clockValue = POVMSFloat(double(clockDelta * double(nominalFrameNumber - initialFrame)) + double(initialClock));
168170
}
169171

170172
bool AnimationProcessing::MoreFrames()
171173
{
172-
return (frameNumber+frameStep <= subsetEndFrame);
174+
return (nominalFrameNumber+frameStep <= subsetEndFrame);
173175
}
174176

175-
POVMSInt AnimationProcessing::GetFrameNumber()
177+
POVMSInt AnimationProcessing::GetNominalFrameNumber()
176178
{
177-
return frameNumber;
179+
return nominalFrameNumber;
178180
}
179181

180-
POVMSInt AnimationProcessing::GetStartFrame()
182+
POVMSInt AnimationProcessing::GetRunningFrameNumber()
183+
{
184+
return runningFrameNumber;
185+
}
186+
187+
POVMSInt AnimationProcessing::GetSubsetStartFrame()
181188
{
182189
return subsetStartFrame;
183190
}
184191

185-
POVMSInt AnimationProcessing::GetEndFrame()
192+
POVMSInt AnimationProcessing::GetSubsetEndFrame()
186193
{
187194
return subsetEndFrame;
188195
}
189196

190-
POVMSInt AnimationProcessing::GetTotalFrames()
197+
POVMSInt AnimationProcessing::GetTotalFramesToRender()
191198
{
192-
return subsetEndFrame - subsetStartFrame + 1;
199+
return (subsetEndFrame - subsetStartFrame) / frameStep + 1;
193200
}
194201

195202
POVMSFloat AnimationProcessing::GetClockValue()

source/frontend/animationprocessing.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
11-
/// Copyright 1991-2015 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -57,10 +57,21 @@ class AnimationProcessing
5757
void ComputeNextFrame();
5858
bool MoreFrames();
5959

60-
POVMSInt GetFrameNumber();
61-
POVMSInt GetStartFrame();
62-
POVMSInt GetEndFrame();
63-
POVMSInt GetTotalFrames();
60+
/// Get nominal frame number.
61+
POVMSInt GetNominalFrameNumber();
62+
63+
/// Get running frame number.
64+
POVMSInt GetRunningFrameNumber();
65+
66+
/// Get subset start frame number.
67+
POVMSInt GetSubsetStartFrame();
68+
69+
/// Get subset end frame number.
70+
POVMSInt GetSubsetEndFrame();
71+
72+
/// Get the total number of frames to actually render.
73+
POVMSInt GetTotalFramesToRender();
74+
6475
POVMSFloat GetClockValue();
6576
int GetFrameNumberDigits();
6677
private:
@@ -79,7 +90,8 @@ class AnimationProcessing
7990
POVMSBool oddFieldFlag;
8091

8192
POVMSFloat clockValue;
82-
POVMSInt frameNumber;
93+
POVMSInt runningFrameNumber;
94+
POVMSInt nominalFrameNumber;
8395

8496
POVMSInt frameStep;
8597

source/frontend/simplefrontend.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
11-
/// Copyright 1991-2015 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -271,7 +271,7 @@ State SimpleFrontend<PARSER_MH, FILE_MH, RENDER_MH, IMAGE_MH>::Process()
271271
{
272272
options = animationProcessing->GetFrameRenderOptions();
273273
if (imageProcessing != NULL)
274-
options.SetUCS2String(kPOVAttrib_OutputFile, imageProcessing->GetOutputFilename(options, animationProcessing->GetFrameNumber(), animationProcessing->GetFrameNumberDigits()).c_str());
274+
options.SetUCS2String(kPOVAttrib_OutputFile, imageProcessing->GetOutputFilename(options, animationProcessing->GetNominalFrameNumber(), animationProcessing->GetFrameNumberDigits()).c_str());
275275
}
276276
else
277277
if (imageProcessing != NULL)
@@ -374,7 +374,7 @@ State SimpleFrontend<PARSER_MH, FILE_MH, RENDER_MH, IMAGE_MH>::Process()
374374
try
375375
{
376376
if(animationProcessing != NULL)
377-
imageProcessing->WriteImage(options, animationProcessing->GetFrameNumber(), animationProcessing->GetFrameNumberDigits());
377+
imageProcessing->WriteImage(options, animationProcessing->GetNominalFrameNumber(), animationProcessing->GetFrameNumberDigits());
378378
else
379379
imageProcessing->WriteImage(options);
380380
}

unix/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.1-alpha.8581629
1+
3.7.1-alpha.8586521

vfe/unix/unixconsole.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
11-
/// Copyright 1991-2014 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -515,7 +515,7 @@ int main (int argc, char **argv)
515515
}
516516

517517
if (flags & stAnimationStatus)
518-
fprintf(stderr, "\nRendering frame %d of %d\n", session->GetCurrentFrame(), session->GetTotalFrames());
518+
fprintf(stderr, "\nRendering frame %d of %d (#%d)\n", session->GetCurrentFrame(), session->GetTotalFrames(), session->GetCurrentFrameId());
519519
if (flags & stAnyMessage)
520520
PrintStatus (session);
521521
if (flags & stBackendStateChanged)

vfe/vfe.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// @parblock
1111
///
1212
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
13-
/// Copyright 1991-2015 Persistence of Vision Raytracer Pty. Ltd.
13+
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
1414
///
1515
/// POV-Ray is free software: you can redistribute it and/or modify
1616
/// it under the terms of the GNU Affero General Public License as
@@ -920,30 +920,31 @@ State VirtualFrontEnd::Process()
920920
m_Session->SetSucceeded (false);
921921
if (animationProcessing != NULL)
922922
{
923-
shelloutProcessing->SetFrameClock(animationProcessing->GetFrameNumber(), animationProcessing->GetClockValue());
923+
shelloutProcessing->SetFrameClock(animationProcessing->GetNominalFrameNumber(), animationProcessing->GetClockValue());
924924
if (shelloutProcessing->SkipNextFrame() == false)
925925
{
926926
UCS2String filename;
927-
int frame = animationProcessing->GetFrameNumber() - animationProcessing->GetStartFrame() ;
927+
int frameId = animationProcessing->GetNominalFrameNumber();
928+
int frame = animationProcessing->GetRunningFrameNumber();
928929
options = animationProcessing->GetFrameRenderOptions ();
929930
if (m_Session->OutputToFileSet())
930931
{
931-
filename = imageProcessing->GetOutputFilename (options, animationProcessing->GetFrameNumber(), animationProcessing->GetFrameNumberDigits());
932+
filename = imageProcessing->GetOutputFilename (options, frameId, animationProcessing->GetFrameNumberDigits());
932933
options.SetUCS2String (kPOVAttrib_OutputFile, filename.c_str());
933934

934935
// test access permission now to avoid surprise later after waiting for
935936
// the render to complete.
936937
if (m_Session->TestAccessAllowed(filename, true) == false)
937938
{
938-
string str ("IO Restrictions prohibit write access to '") ;
939+
string str ("IO Restrictions prohibit write access to '");
939940
str += UCS2toASCIIString(filename);
940941
str += "'";
941942
throw POV_EXCEPTION(kCannotOpenFileErr, str);
942943
}
943944
shelloutProcessing->SetOutputFile(UCS2toASCIIString(filename));
944945
m_Session->AdviseOutputFilename (filename);
945946
}
946-
m_Session->AppendAnimationStatus (frame + 1, animationProcessing->GetTotalFrames(), filename) ;
947+
m_Session->AppendAnimationStatus (frameId, frame, animationProcessing->GetTotalFramesToRender(), filename);
947948
}
948949
}
949950

@@ -1163,7 +1164,7 @@ State VirtualFrontEnd::Process()
11631164
if (animationProcessing != NULL)
11641165
{
11651166
if (m_Session->OutputToFileSet())
1166-
m_Session->AdviseOutputFilename (imageProcessing->WriteImage(options, animationProcessing->GetFrameNumber(), animationProcessing->GetFrameNumberDigits()));
1167+
m_Session->AdviseOutputFilename (imageProcessing->WriteImage(options, animationProcessing->GetNominalFrameNumber(), animationProcessing->GetFrameNumberDigits()));
11671168
m_Session->AdviseFrameCompleted();
11681169
}
11691170
else

vfe/vfesession.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// @parblock
1111
///
1212
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
13-
/// Copyright 1991-2015 Persistence of Vision Raytracer Pty. Ltd.
13+
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
1414
///
1515
/// POV-Ray is free software: you can redistribute it and/or modify
1616
/// it under the terms of the GNU Affero General Public License as
@@ -109,6 +109,7 @@ void vfeSession::Clear(bool Notify)
109109
m_PercentComplete = 0;
110110
m_PixelsRendered = 0;
111111
m_TotalPixels = 0;
112+
m_CurrentFrameId = 0;
112113
m_CurrentFrame = 0;
113114
m_TotalFrames = 0;
114115
if (Notify)
@@ -296,14 +297,15 @@ void vfeSession::AppendStatusMessage (const boost::format& fmt, int RecommendedP
296297
NotifyEvent(stStatusMessage);
297298
}
298299

299-
void vfeSession::AppendAnimationStatus (int Frame, int Total, const UCS2String& Filename)
300+
void vfeSession::AppendAnimationStatus (int FrameId, int SubsetFrame, int SubsetTotal, const UCS2String& Filename)
300301
{
301302
boost::mutex::scoped_lock lock(m_MessageMutex);
302303

303-
m_CurrentFrame = Frame;
304-
m_TotalFrames = Total;
305-
m_StatusQueue.push (StatusMessage (*this, Filename, Frame, Total));
306-
m_StatusLineMessage = (boost::format("Rendering frame %d of %d") % Frame % Total).str();
304+
m_CurrentFrameId = FrameId;
305+
m_CurrentFrame = SubsetFrame;
306+
m_TotalFrames = SubsetTotal;
307+
m_StatusQueue.push (StatusMessage (*this, Filename, SubsetFrame, SubsetTotal, FrameId));
308+
m_StatusLineMessage = (boost::format("Rendering frame %d of %d (#%d)") % SubsetFrame % SubsetTotal % FrameId).str();
307309
if (m_MaxStatusMessages != -1)
308310
while (m_StatusQueue.size() > m_MaxStatusMessages)
309311
m_StatusQueue.pop();

0 commit comments

Comments
 (0)