POV-Ray : Newsgroups : povray.bugreports : animation display window does not reset to black Server Time
3 Mar 2024 18:17:03 EST (-0500)
  animation display window does not reset to black (Message 1 to 9 of 9)  
From: Jonathan Bush
Subject: animation display window does not reset to black
Date: 1 Jan 2024 12:45:00
Message: <web.6592f8f55019edc16e558a71fde6c206@news.povray.org>
The first animated frame begins as a black window and generates as usual, but
the 2nd and subsequent animated frames do not. I just see the completed first
frame remaining on the screen while I hear the computer working hard. All the
generated images are identical to the first frame. This does not happen with
other animated scripts, so my script is buggy, but what bug in my script would
result in this behavior?

System:
  Host: XPS Kernel: 5.15.0-91-generic x86_64 bits: 64 Desktop: Xfce 4.18.1
    Distro: Linux Mint 21.2 Victoria

This is an informal build 3.7.0.10 by Andreas Beckmann, so perhaps I should ask
him?

I don't know if it is related, but there are supposed to be four animated
objects in an otherwise static scene. The animated objects do not appear in the
first animated frame, although diagnostic info I see in the console tells me two
of them begin positioned within the frame.

And speaking of diagnostic info, I am unable to disable the verbose option for
POVray. I put -V on the command line, and my povray.ini file includes the line

Verbose=Off

But it won't shut up. Futhermore, #debug messages are not displayed even though
I have Debug_Console=On in that same povray.ini file. I have to use the #warning
directive instead, and the warnings are embedded within the verbose output. Here
is a sample from the console display:

==== [Parsing...] ==========================================================
File 'ap_skip.inc' line 101: Parse Warning: In ap_skip.inc ANIMATING
File 'ap.pov' line 55: Parse Warning: ***** ANIM Time=  1.0351
File 'ap_animate.inc' line 65: Parse Warning: NewClock123=  0.0044 Path123Alpha=
  0.0138
File 'ap_animate.inc' line 67: Parse Warning: piece 1 y*-63.2734 <  5.6667,
 0.0092, -5.3333>
File 'ap_animate.inc' line 68: Parse Warning: NewClock4=  0.0050 Path4Alpha=
 1.5787
File 'ap_animate.inc' line 70: Parse Warning: piece 2 y*26.3322 <  5.3334,
 0.0092, -6.3333>
File 'ap_animate.inc' line 72: Parse Warning: piece 3 <  2.3335,  0.0092,
 -6.0000>
File 'ap_animate.inc' line 74: Parse Warning: piece 4 <  7.9843,  1.3333,
 -5.6667>
----------------------------------------------------------------------------

I apologize for the rambling tone of this bug report, but I'm just trying to
provide all the info I can.

Here is the .inc file which is responsible for generating the animated objects.

//****************************************************************************
// ap_animate.inc
//
//  A lot of these comments require the other files to understand
//  what is going on. I provide a link below to Google Drive.
//
//  Here we place the 4 animated objects. 3 are BlackLink and one is BlackPeg.
//
//  IntervalIndex is either 0, 1, or 2.
//    0 refers to the first 60 frames, which are static.
//      They generate just fine. The two object commands below execute
//      correctly.
//    1 refers to frames 61 to 540 which is where the problem lies.
//      The four object commands in this block do not execute.
//      Just prior to the object commands are some
//      #warning messages, and they display onscreen during execution.
//      Someone reading this code by itself might conclude that the objects
//      are placed outside of the frame. I present this file because it might
//      pertain to the weird POVray behavior of not blacking out the display
//      at the start of frames 62 to 540.
//
//      To summarize, the buggy behavior I see begins with frame 62
//      which is the first animated frame.
//
//    2 refers the the final second, frames 541 to 600, which is also
//      A static interval.

#if (IntervalIndex = 0)     // Static interval, two pieces on the board
     // calling macros from another file, but this only happens once.
     // These commands execute correctly.
  object { BlackLink rotate y*ATH translate  Link12Pos(20, 3)}
  object { BlackLink rotate y*(-AT2) translate Link34Pos(21, 4)}
#else   // Yes, I know I could use elseif, and I will when the bugs are fixed.
  #if (IntervalIndex = 1)               // animated interval
    #declare NewClock123 = (clock-0.1)*1.25;     // turns .1 to .9 into 0 to 1
    #declare Path123Alpha = radians(180*NewClock123);
    // angle of elliptical path, 0 to pi radians
    // Path 4 is the peg, which Alpha ranges PI/2 to Pi radians,
    // arriving at hole 1 second before the links
    #declare NewClock4 = ((clock<0.8)?(clock-0.1)*(10/7):1);
    #declare Path4Alpha   = radians(90+90*NewClock4);
    #declare Center1x = separation*8.25;  // center of ellipse. path 1 is the
                                          // link3 that moves to link2.
    #declare Center1z = separation*(-8.25);
    #declare Center2x = separation*8.5;   // Path 2 is the link1 that moves to
                                          // link2.
    #declare Center2z = separation*(-9.5);
    #declare Center3x = separation*6;     // 3 is the link3 that arrives from
                                          // offscreen left
    #declare Center3z = separation*(-9);
    #declare Center4x = separation*12;    // 4 is the peg arriving from
                                          // offscreen right
    #declare Center4z = separation*(-8.5);
    #declare BoardVector1x = 0.25*separation;
    #declare BoardVector1z = 0.25*separation;   // vectors for the ellipse axes
                                                // in the xz plane
    #declare BoardVector2x = -0.5*separation;
    #declare BoardVector2z = 0;
    #declare BoardVector3x = -2.5*separation;
    #declare BoardVector3z = 0;
    #declare BoardVector4x = 3*separation;
    #declare BoardVector4z = 0;
    #declare Height123 = separation;
    #declare Height4 = 2*separation;
    #declare RotStart1 =-AT2;
    #declare RotEnd1 = -ATH;
    #declare RotStart2 = ATH;
    #declare RotEnd2 = -ATH;



    #macro PathPos(Alpha, Centerx, Centerz, Height, BoardVectorx, BoardVectorz)
      <Centerx+BoardVectorx*cos(Alpha), Height*sin(Alpha),
       Centerz+BoardVectorz*cos(Alpha)>
    #end

     // animated paths 1 and 2 rotate during animation but nothing else.
    #macro PathRot(NewClock, RotStart, RotEnd)
      y*(RotStart+NewClock*(RotEnd-RotStart))
    #end

     // all these definitions are for the sake of the #warning messages.

    #declare RotVec1 = RotStart1+NewClock123*(RotEnd1-RotStart1);
    #declare PosVec1x = Center1x+BoardVector1x*cos(Path123Alpha);
    #declare PosVec1y = Height123*sin(Path123Alpha);
    #declare PosVec1z = Center1z+BoardVector1z*cos(Path123Alpha);
    #declare RotVec2 = RotStart2+NewClock123*(RotEnd2-RotStart2);
    #declare PosVec2x = Center2x+BoardVector2x*cos(Path123Alpha);
    #declare PosVec2y = Height123*sin(Path123Alpha);
    #declare PosVec2z = Center2z+BoardVector2z*cos(Path123Alpha);
    #declare PosVec3x = Center3x+BoardVector3x*cos(Path123Alpha);
    #declare PosVec3y = Height123*sin(Path123Alpha);
    #declare PosVec3z = Center3z+BoardVector3z*cos(Path123Alpha);
    #declare PosVec4x = Center4x+BoardVector4x*cos(Path4Alpha);
    #declare PosVec4y = Height4*sin(Path4Alpha);
    #declare PosVec4z = Center4z+BoardVector4z*cos(Path4Alpha);

    #warning concat("NewClock123=",str(NewClock123,8,4),
                    " Path123Alpha=",str(Path123Alpha,8,4),"\n")
    #warning concat("piece 1 y*",str(RotVec1,7,4),
                    " <",str(PosVec1x,8,4),",",str(PosVec1y,8,4),",",
                    str(PosVec1z,8,4),">\n")
    #warning concat("NewClock4=",str(NewClock4,8,4),
                    " Path4Alpha=",str(Path4Alpha,8,4),"\n")
    #warning concat("piece 2 y*",str(RotVec2,7,4),
                    " <",str(PosVec2x,8,4),",",str(PosVec2y,8,4),",",
                    str(PosVec2z,8,4),">\n")
    #warning concat("piece 3 <",str(PosVec3x,8,4),",",str(PosVec3y,8,4),",",
                    str(PosVec3z,8,4),">\n")
    #warning concat("piece 4 <",str(PosVec4x,8,4),",",str(PosVec4y,8,4),",",
                    str(PosVec4z,8,4),">\n")

    // These object commands do not execute correctly,
    // but the above warning directives are displayed on the console.
    object { BlackLink rotate PathRot(NewClock123, RotStart1, RotEnd1)
             translate  PathPos(Path123Alpha, Center1x, Center1z, Height123,
                        BoardVector1x, BoardVector1z)
    }
    object { BlackLink rotate PathRot(NewClock123, RotStart2, RotEnd2)
             translate  PathPos(Path123Alpha, Center2x, Center2z, Height123,
                        BoardVector2x, BoardVector2z)
    }
    object { BlackLink rotate -AT2*y
             translate  PathPos(Path123Alpha, Center3x, Center3z, Height123,
                        BoardVector3x, BoardVector3z)
    }
    object { BlackPeg translate  PathPos(Path4Alpha, Center4x, Center4z,
                                 Height4, BoardVector4x, BoardVector4z)
    }
  #else                        // last interval is static
    object { BlackLink rotate -ATH*y translate Link12Pos(20, 4) }
    // calling macros from another file, but this only happens once.

    object { BlackLink rotate -ATH*y translate Link12Pos(21, 3) }
    object { BlackLink rotate -AT2*y translate Link34Pos(21, 3) }
    object { BlackPeg translate PegPos(22, 4) }
  #end
#end

// *********************************************************************

You should be able to access the other files at
https://drive.google.com/file/d/1CUqz-eivsopQLrQc4bHrbSw_E5fWUgB4/view?usp=sharing
and I also attach the zip file here.

Thanks for your attention!


Post a reply to this message


Attachments:
Download 'ap_files.tar.gz' (10 KB)

From: Jonathan Bush
Subject: Re: animation display window does not reset to black
Date: 1 Jan 2024 13:40:00
Message: <web.6593060aa76bba896e558a71fde6c206@news.povray.org>
In order to run the ap.pov script, you should have a subdirectory /images which
includes the subdirectories /static and /animated. I use the command

povray -V ap.pov

In an attempt to prevent verbose mode, for all the good it does.


Post a reply to this message

From: Kenneth
Subject: Re: animation display window does not reset to black
Date: 1 Jan 2024 17:40:00
Message: <web.65933a9ba76bba899b4924336e066e29@news.povray.org>
[running Windows 10, with POV-ray v3.7]

I downloaded your zip file. This is quite a complex scene, with many pieces that
interact, making it difficult to track down what is going on.

I attempted to run your ap.pov file with a 600-frame animation. I could not get
the scene to render at all without fatal errors-- probably because I would
need(?) to create folders and sub-folders called 'images', 'animated', 'static',
etc. and with the correct file paths to find them, which is not my own set-up.
(See your ap_skip.inc file.)

The best I could do was to run various animation frames and report the
parse-error results. I have attached that below, as screenshots; maybe it will
prove helpful. (I could not even get POV-ray's 'All_File=on' feature to work
with this scene, to output the parse-error message contents as text.)

I *suspect* that something might be wrong with how the 'clock' value is used in
the scene-- but I haven't been able to check that so far. I wonder about this
line in your ap_animate.inc file:
     #declare NewClock123 = (clock-0.1)*1.25; // turns .1 to .9 into 0 to 1

According to the notes in your posted comments, that line is supposed to kick-in
at frame 61 of the animation(?).. which is where your problems begins, as you
mentioned. But I honestly don't yet understand how all of the
various files work together for the final result.


Post a reply to this message


Attachments:
Download 'ap_scene_messages_pane_kw.jpg' (269 KB)

Preview of image 'ap_scene_messages_pane_kw.jpg'
ap_scene_messages_pane_kw.jpg


 

From: Jonathan Bush
Subject: Re: animation display window does not reset to black
Date: 1 Jan 2024 18:50:00
Message: <web.65934e6aa76bba896e558a71fde6c206@news.povray.org>
Thank you for responding so quickly.

In my follow-up post, I stated that you need to make a subdirectory /images with
its own subdirectories /static and /animated. See the povray.ini file for the
output file path. Sorry I don't know much about Windows; I guess you need
backslashes. I hope you don't have to edit the files to change forward slashes
to back slashes.

I hope that, once those subdirectories are installed within the directory that
contains all these files, the code will run for you. It was not my intention for
you to help me with debugging my own code. I do appreciate your efforts!
Meanwhile I would be glad to try to explain my code.

Regarding the line from ap_animate.inc

#declare NewClock123 = (clock-0.1)*1.25; // turns .1 to .9 into 0 to 1

Yes, this happens during the animated interval, when clock ranges from 0.1 to
0.8. There are 4 animated objects which follow 4 paths. The variable NewClock123
is a value that ranges from 0 to 1 during this interval, which makes it easier
for me to calculate where the first 3 of these 4 objects should be on their
paths.


render 1 seems to be about the missing subdirectories.

render 2: The file ap.pov contains line 89 assumed_gamma 1.

"In ap_skip.inc black frame" Please where is black frame? What line number?

I should provide some background. ap.pov is supposed to generate the frames for
a 10-second video at 60 fps. The first 60 frames are all identical. After the
first frame is generated, a post-frame command executes the file fix.sh which
contains a cp command to copy this frame into static0 in the /static directory.
So by the time ap_skip.inc is creating the cp command to copy from static back
into animated, you should already have that static file sitting there. This is
for frames 2 through 60.

ap_skip.inc creates the cp command and then passes it back to ap.pov inside the
variable CpCommand. Check out ap.pov line 187 for the else clause where this
string gets used. The string is placed inside fix.sh and then ap.pov stops,
which results in a black frame for this iteration. The post frame command inside
of povray.ini then copies the static image over top of the black frame that
ap.pov just generated.

If the post frame command is not working for you, you may need to modify a file
povray.conf somwhere in your system to allow shellout commands.

render 60 of 600 looks the same.

All the warning messages you show screen shots of are placed in the code by me
as diagnostics. I am unable to get #debug messages to display.

PLEASE ask if you are unable to get my code running after you create the
subdirectories, or if you have any questions.


Post a reply to this message

From: Jonathan Bush
Subject: Re: animation display window does not reset to black
Date: 1 Jan 2024 20:50:00
Message: <web.65936a35a76bba896e558a71fde6c206@news.povray.org>
Regarding Windows, of course the copy command is a different syntax. I don't
imagine a bash shellout command would work either. The files ap_skip.inc and
povray.ini would need to be modified to produce a command string which Windows
would be able to run. Sorry, I cannot offer much help with that.

I ran a subset of the frames, skipping the initial static interval. The same
problem occurred; the display of the first frame was initially black, but
subsequent frames did not reset to black. I rewrote the code to produce a
9-second video where the first static second is avoided, but this did not fix
the problem either.

I will continue to make simpler and simpler code until it works correctly, then
I will post the simplest code I could make which demonstrates the problem.

I am grateful for your patience.


Post a reply to this message

From: jr
Subject: Re: animation display window does not reset to black
Date: 2 Jan 2024 01:00:00
Message: <web.6593a5efa76bba897f6d9cf76cde94f1@news.povray.org>
hi,

"Jonathan Bush" <djb### [at] gmxcom> wrote:
> ...
> I will continue to make simpler and simpler code until it works correctly, then
> I will post the simplest code I could make which demonstrates the problem.

had a first quick look, a couple of comments only.

looks like you can use some of POV-Ray's "built-in" stuff to advantage.  the
'frame_number' for instance.  the idea of (re)writing a shell script which gets
executed by an .ini is new to me, and looks interesting; thinking that the
'Parse_String()' macro is what you're looking for instead.

<https://wiki.povray.org/content/Reference:Numeric_Expressions#Built-in_Variables>
<https://wiki.povray.org/content/Reference:Strings.inc>

fwiw, if (ap.pov) "The first second is static", then that code does not
"belong".  recommend splitting the generation of the initial frames from the
game/move animation.


regards, jr.


Post a reply to this message

From: Jonathan Bush
Subject: Re: animation display window does not reset to black
Date: 2 Jan 2024 14:00:00
Message: <web.65945cd9a76bba896e558a71fde6c206@news.povray.org>
Apparently, if every frame of an animation is identical, POVray will not black
out frames beyond the first frame. I'm not sure if this qualifies as a bug or
not.

My apologies, nothing to see here, move along.


Post a reply to this message

From: jr
Subject: Re: animation display window does not reset to black
Date: 4 Jan 2024 06:35:00
Message: <web.6596977da76bba897f6d9cf76cde94f1@news.povray.org>
hi,

"Jonathan Bush" <djb### [at] gmxcom> wrote:
> ...
> And speaking of diagnostic info, I am unable to disable the verbose option for
> POVray. I put -V on the command line, and my povray.ini file includes the line
> Verbose=Off
> But it won't shut up. ...

I use '-gr -gs' to reduce output.  and 'nice -n 19 povray ...' generally.

also, re "compiled by Beckmann", as you're evidently ok with command lines, why
not (configure and) build your own ?
<https://github.com/POV-Ray/povray/tags/>


regards, jr.


Post a reply to this message

From: Le Forgeron
Subject: Re: animation display window does not reset to black
Date: 6 Jan 2024 04:52:37
Message: <659922e5$1@news.povray.org>
Le 02/01/2024 à 19:58, Jonathan Bush a écrit :
> Apparently, if every frame of an animation is identical, POVray will not black
> out frames beyond the first frame. I'm not sure if this qualifies as a bug or
> not.
> 
> My apologies, nothing to see here, move along.
> 
> 
Actually, displayed image on X11 system (such as linux) during rendered 
is not reset between frames.

I made a modification on the hgpovray fork to dimer the previous image 
when computing start, so that the graphical progress of the rendering of 
the new frame is still visible (excepted if all is black on black). But 
that is my personal taste.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.