POV-Ray : Newsgroups : povray.general : Persistent variables across an animation run Server Time
27 Dec 2024 20:51:38 EST (-0500)
  Persistent variables across an animation run (Message 1 to 7 of 7)  
From: Alessio Sangalli
Subject: Persistent variables across an animation run
Date: 15 Dec 2021 01:07:16
Message: <61b98614$1@news.povray.org>
I know this has been discussed many times in the past decades, but - 
besides having a bunch of macros that do #fopen's and #fwrite-#fread's, 
is there any plan to add "animation scope" to variables? It would make 
animations easier, especially when using non-linear accelerations, which 
is commonly the case when using easing functions.

Also, vectors or - even better - dictionaries would be a great addition 
to the language, especially if they could be written to disk (or kept in 
animation scope).

Is there any workaround that I am not aware of for the above?

Even the possibility to read files line by line would be useful.

Maybe all of the above is already implemented in a way that is not clear 
to me, if that is the case, please let me know.

Thanks!


Post a reply to this message

From: jr
Subject: Re: Persistent variables across an animation run
Date: 15 Dec 2021 02:45:00
Message: <web.61b99c28a8365710ea8869266cde94f1@news.povray.org>
hi,

Alessio Sangalli <man### [at] gmailcom> wrote:
> I know this has been discussed many times in the past decades, but -
> besides having a bunch of macros that do #fopen's and #fwrite-#fread's,
> is there any plan to add "animation scope" to variables? It would make
> animations easier, especially when using non-linear accelerations, which
> is commonly the case when using easing functions.
>
> Also, vectors or - even better - dictionaries would be a great addition
> to the language, especially if they could be written to disk (or kept in
> animation scope).
>
> Is there any workaround that I am not aware of for the above?

upgrading?  :-)  v3.8 will get you dictionaries, though no "animation scope"
variables.

<https://wiki.povray.org/content/Reference_Talk:Array#Index_Entry_dictionary_keyword>


> Even the possibility to read files line by line would be useful.

have a look at 'Filed()', another recent macro of mine.  you can read a range of
"records", or all. a range can be a single record, and you could use
'frame_number' to "index".  serialising a dictionary using 'Filed()' would be
straightforward too.

<https://news.povray.org/povray.text.scene-files/message/%3Cweb.616d93c020122b7c5bd1b3ba6cde94f1%40news.povray.org%3E/#
%3Cweb.616d93c020122b7c5bd1b3ba6cde94f1%40news.povray.org%3E>


regards, jr.


Post a reply to this message

From: Alessio Sangalli
Subject: Re: Persistent variables across an animation run
Date: 15 Dec 2021 12:12:09
Message: <61ba21e9$1@news.povray.org>
On 14-Dec-21 23:41, jr wrote:

>> Is there any workaround that I am not aware of for the above?
> 
> upgrading?  :-)  v3.8 will get you dictionaries, though no "animation scope"
> variables.
> 
>
<https://wiki.povray.org/content/Reference_Talk:Array#Index_Entry_dictionary_keyword>

Oh, interesting, now the stupid follow-up question, where can I read the 
new stuff planned for the next version, 3.8 in this case?


>> Even the possibility to read files line by line would be useful.
> 
> have a look at 'Filed()', another recent macro of mine.  you can read a range of
> "records", or all. a range can be a single record, and you could use
> 'frame_number' to "index".  serialising a dictionary using 'Filed()' would be
> straightforward too.

Interesting, I had a look at the code; questions:

1) what license is your macro package released as? Just to confirm, as I 
have not seen anything, that is public domain (but yet, you put a 
copyright notice on the HTML page, so I wanted to check)

2) I haven't used 3.8's dictionaries of course, but are you saying that 
there is no SDL native support for #fwrite/#fread for dictionary types?


Thanks!


Post a reply to this message

From: jr
Subject: Re: Persistent variables across an animation run
Date: 15 Dec 2021 13:10:00
Message: <web.61ba2e87a8365710ea8869266cde94f1@news.povray.org>
hi,

Alessio Sangalli <man### [at] gmailcom> wrote:
> On 14-Dec-21 23:41, jr wrote:
> ...
> > v3.8 will get you dictionaries, ...
>
> Oh, interesting, now the stupid follow-up question, where can I read the
> new stuff planned for the next version, 3.8 in this case?

I so wish I knew.  a few months back a core developer ('clipka') resurfaced --
briefly -- to gift us the first two betas.  nothing since early August.  see
<https://github.com/POV-Ray/povray/tags>.


> >> Even the possibility to read files line by line would be useful.
> >
> > have a look at 'Filed()', ...
>
> Interesting, I had a look at the code; questions:
>
> 1) what license is your macro package released as? Just to confirm, as I
> have not seen anything, that is public domain (but yet, you put a
> copyright notice on the HTML page, so I wanted to check)

my copyright + license stuff is always at the  bottom of .inc + .html files.  I
use the GNU GPL v3+, out of ignorance mostly.  please feel free to do with the
code as you please.  :-)


> 2) I haven't used 3.8's dictionaries of course, but are you saying that
> there is no SDL native support for #fwrite/#fread for dictionary types?

correct, read + write only deal with float, vector, and string types.  (you can
write binary ints, but not read them back).
<https://wiki.povray.org/content/Reference:File_I/O_Directives>


regards, jr.


Post a reply to this message

From: Alessio Sangalli
Subject: Re: Persistent variables across an animation run
Date: 15 Dec 2021 14:27:07
Message: <61ba418b$1@news.povray.org>
On 15-Dec-21 10:05, jr wrote:

>> Oh, interesting, now the stupid follow-up question, where can I read the
>> new stuff planned for the next version, 3.8 in this case?
> 
> I so wish I knew.  a few months back a core developer ('clipka') resurfaced --
> briefly -- to gift us the first two betas.  nothing since early August.  see
> <https://github.com/POV-Ray/povray/tags>.

Yeah, I see. I wouldn't mind get familiar with the core. I'll look a 
little into that.


> my copyright + license stuff is always at the  bottom of .inc + .html files.  I
> use the GNU GPL v3+, out of ignorance mostly.  please feel free to do with the
> code as you please.  :-)

I believe the industry standard is to put the copyright notice and 
license at the *top* of the file :)


> correct, read + write only deal with float, vector, and string types.  (you can
> write binary ints, but not read them back).
> <https://wiki.povray.org/content/Reference:File_I/O_Directives>

I see, yeah, thanks!


Post a reply to this message

From: Thomas de Groot
Subject: Re: Persistent variables across an animation run
Date: 17 Dec 2021 02:59:08
Message: <61bc434c$1@news.povray.org>
Op 15/12/2021 om 19:05 schreef jr:
> hi,
> 
> Alessio Sangalli <man### [at] gmailcom> wrote:
>> On 14-Dec-21 23:41, jr wrote:
>> ...
>>> v3.8 will get you dictionaries, ...
>>
>> Oh, interesting, now the stupid follow-up question, where can I read the
>> new stuff planned for the next version, 3.8 in this case?
> 
> I so wish I knew.  a few months back a core developer ('clipka') resurfaced --
> briefly -- to gift us the first two betas.  nothing since early August.  see
> <https://github.com/POV-Ray/povray/tags>.
> 
There is, at least, this:
https://wiki.povray.org/content/Documentation:Tutorial_Section_1#Version_3.8

/not/ what is /planned/, though...

-- 
Thomas


Post a reply to this message

From: Alessio Sangalli
Subject: Re: Persistent variables across an animation run
Date: 17 Dec 2021 12:17:10
Message: <61bcc616$1@news.povray.org>
On 16-Dec-21 23:59, Thomas de Groot wrote:

> There is, at least, this:
> https://wiki.povray.org/content/Documentation:Tutorial_Section_1#Version_3.8 

Oh nice, this is actually pretty good. It's important to become familiar 
with the new "system" that uses github etc.

> /not/ what is /planned/, though...

Yeah that is more complicated.


Post a reply to this message

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