POV-Ray : Newsgroups : povray.general : Returning the file name. Server Time
26 Nov 2024 13:16:16 EST (-0500)
  Returning the file name. (Message 1 to 9 of 9)  
From: Stephen
Subject: Returning the file name.
Date: 13 Sep 2010 16:00:56
Message: <4c8e82f8$1@news.povray.org>
Is there a method of returning the file name to a variable, of the scene 
I am rendering? I would also like to get the file path as well.
I want to do some recursive work with the output of the previous frame 
in an animation.

-- 

Best Regards,
	Stephen


Post a reply to this message

From: Le Forgeron
Subject: Re: Returning the file name.
Date: 13 Sep 2010 16:29:00
Message: <4c8e898c$1@news.povray.org>
Le 13/09/2010 22:01, Stephen nous fit lire :
> Is there a method of returning the file name to a variable, of the scene
> I am rendering? I would also like to get the file path as well.
> I want to do some recursive work with the output of the previous frame
> in an animation.
> 
You can have the current frame number (frame_number), but we are weak on
the string functions. (converting the number in a string is fine, but I
do not know how to get the current scene filename, so you might have to
hardcode it)

For using the previously rendered image, add +L<path of the render
directory> in your option (especially with that settings which might be
set or not: to render all files in one directory) (if not rendering from
./ to ./ )

http://www.povray.org/documentation/view/3.6.1/228/

http://www.povray.org/documentation/view/3.6.1/232/


Post a reply to this message

From: Stephen
Subject: Re: Returning the file name.
Date: 13 Sep 2010 17:18:26
Message: <4c8e9522$1@news.povray.org>
On 13/09/2010 9:28 PM, Le_Forgeron wrote:
> You can have the current frame number (frame_number), but we are weak on
> the string functions. (converting the number in a string is fine, but I
> do not know how to get the current scene filename, so you might have to
> hardcode it)
>

Thanks for your reply Le
I thought that be the case but I was hoping that there was some 
undocumented function that everyone but me knew.

It is a slight pain to change the code manualy as I save my files 
incrementally, a lot, as I make changes in the scene.

> For using the previously rendered image, add +L<path of the render
> directory>  in your option (especially with that settings which might be
> set or not: to render all files in one directory) (if not rendering from
> ./ to ./ )

I’m doing this as a sample scene for Bishop3D so my audience may not 
know too much about changing the Library_Path in povray.ini. I was 
hoping to automate some of it.
  Maybe a feature for Pov 4.0 ;-)

-- 

Best Regards,
	Stephen


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Returning the file name.
Date: 13 Sep 2010 17:53:17
Message: <4c8e9d4d@news.povray.org>
Stephen wrote:

> Thanks for your reply Le I thought that be the case but I was hoping
> that there was some undocumented function that everyone but me knew.

I don't think so. What you can do, though, is call POV-Ray from
the command line where you can control the file names and even pass
them to the scene via generated include file.

> It is a slight pain to change the code manualy as I save my files 
> incrementally, a lot, as I make changes in the scene.

Maybe source control should be integrated into the Windows editor ;)


Post a reply to this message

From: Reactor
Subject: Re: Returning the file name.
Date: 13 Sep 2010 20:15:01
Message: <web.4c8ebe4561d0e05a6a99b6f80@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Stephen wrote:
>
> > Thanks for your reply Le I thought that be the case but I was hoping
> > that there was some undocumented function that everyone but me knew.
>
> I don't think so. What you can do, though, is call POV-Ray from
> the command line where you can control the file names and even pass
> them to the scene via generated include file.
>
> > It is a slight pain to change the code manualy as I save my files
> > incrementally, a lot, as I make changes in the scene.
>
> Maybe source control should be integrated into the Windows editor ;)

That actually crossed my mind a while ago - making a full IDE type environment
for POV-ray.  I like the idea of having a project file that tracks the scene
files, included files, images, etc.  Even better if it has the ability to jump
between identifier definitions and their references across files...

At one point I was looking into existing IDEs that have the ability to syntax
highlight or 'compile' for any language that you give it a definition file for.
The idea is that it has already been done very well, and this would simply be
the reuse of existing packages.


Anyway, is providing a way to read the file name something that could be done
easily?  Could it cause problems from a security standpoint?  I'm sure this has
come up before, but if it is going to be considered it would seem to require
several variables (to allow the user to determine the names of scene files and
output files, which may be different).  Would it be better to consider allowing
a scene file to read what options it was called with?  This would be the options
as specified in the povray.ini, scene.ini, and command line - for instance, a
scene could know whether or not anti-aliasing was used.



-Reactor


Post a reply to this message

From: StephenS
Subject: Re: Returning the file name.
Date: 13 Sep 2010 22:20:00
Message: <web.4c8edb8861d0e05a13ee07b00@news.povray.org>
Stephen <mca### [at] aolDOTcom> wrote:
....
> It is a slight pain to change the code manualy as I save my files
> incrementally, a lot, as I make changes in the scene.
....
Do you increment the end of a base filename?
Loop useing the file_exists(S) function untill it fails, then use the one
before.

Stephen S


Post a reply to this message

From: Le Forgeron
Subject: Re: Returning the file name.
Date: 14 Sep 2010 03:36:30
Message: <4c8f25fe$1@news.povray.org>
Le 14/09/2010 02:13, Reactor a écrit :
> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> Stephen wrote:
>>
>>> Thanks for your reply Le I thought that be the case but I was hoping
>>> that there was some undocumented function that everyone but me knew.
>>
>> I don't think so. What you can do, though, is call POV-Ray from
>> the command line where you can control the file names and even pass
>> them to the scene via generated include file.
>>
>>> It is a slight pain to change the code manualy as I save my files
>>> incrementally, a lot, as I make changes in the scene.
>>
>> Maybe source control should be integrated into the Windows editor ;)
> 
> That actually crossed my mind a while ago - making a full IDE type environment
> for POV-ray.  I like the idea of having a project file that tracks the scene
> files, included files, images, etc.  Even better if it has the ability to jump
> between identifier definitions and their references across files...
> 

Ever heard of povclipse ?

> At one point I was looking into existing IDEs that have the ability to syntax
> highlight or 'compile' for any language that you give it a definition file for.
> The idea is that it has already been done very well, and this would simply be
> the reuse of existing packages.

povclipse ran on eclipse.

-- 
A good Manager will take you
through the forest, no mater what.
A Leader will take time to climb on a
Tree and say 'This is the wrong forest'.


Post a reply to this message

From: Reactor
Subject: Re: Returning the file name.
Date: 14 Sep 2010 20:20:00
Message: <web.4c90102461d0e05a6a99b6f80@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:

>
> Ever heard of povclipse ?
>

.... I have now!

> > At one point I was looking into existing IDEs that have the ability to syntax
> > highlight or 'compile' for any language that you give it a definition file for.
> > The idea is that it has already been done very well, and this would simply be
> > the reuse of existing packages.
>
> povclipse ran on eclipse.
>


I don't know why I missed it before, although it does sound vaguely familiar.
I'll probably give it a shot later this evening.

-Reactor


Post a reply to this message

From: Stephen
Subject: Re: Returning the file name.
Date: 16 Sep 2010 03:16:29
Message: <4c91c44d$1@news.povray.org>
On 14/09/2010 3:18 AM, StephenS wrote:
> Stephen<mca### [at] aolDOTcom>  wrote:
> .....
>> It is a slight pain to change the code manualy as I save my files
>> incrementally, a lot, as I make changes in the scene.
> .....
> Do you increment the end of a base filename?
> Loop useing the file_exists(S) function untill it fails, then use the one
> before.
>

That is a smart idea, Stephen.
The scene is for Miri as it is here birthday later this month. The code 
might encourage her to delve into SDL. ;-)

-- 

Best Regards,
	Stephen


Post a reply to this message

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