POV-Ray : Newsgroups : povray.newusers : getting the output file name Server Time
24 Dec 2024 13:03:45 EST (-0500)
  getting the output file name (Message 1 to 5 of 5)  
From: Ross Litscher
Subject: getting the output file name
Date: 17 Jan 2003 17:15:11
Message: <3e28806f$1@news.povray.org>
Hello all. motivated by a small discussion in p.b.i., i'm on a mission to
find out how to get the output file name from the currently rendering scene.
actually, I guess i need the file name while parsing the scene. i've scanned
through the docs and searched on the web view of the newsgroups, but to no
avail. any help would be appreciated. i basically want to write to a file
with a similar filename. if the output image is called "my_scene.tga" then
i'd like to write some text to a file called "my_scene.txt" without having
to hard code the filenames in the .pov file. just getting the actual
filename is what i need, the rest i can manage.

hopefully this makes sense. thankyou very much for any hints.

peace,
ross


Post a reply to this message

From: hughes, b 
Subject: Re: getting the output file name
Date: 17 Jan 2003 19:52:49
Message: <3e28a561$1@news.povray.org>
"Ross Litscher" <lit### [at] osuedu> wrote in message
news:3e28806f$1@news.povray.org...
> Hello all. motivated by a small discussion in p.b.i., i'm on a mission to
> find out how to get the output file name from the currently rendering
scene.
> actually, I guess i need the file name while parsing the scene. i've
scanned
> through the docs and searched on the web view of the newsgroups, but to no
> avail. any help would be appreciated. i basically want to write to a file
> with a similar filename. if the output image is called "my_scene.tga" then
> i'd like to write some text to a file called "my_scene.txt" without having
> to hard code the filenames in the .pov file. just getting the actual
> filename is what i need, the rest i can manage.
>
> hopefully this makes sense. thankyou very much for any hints.

Yes, does. You can do INI commands to use %s and get the name into such a
file. See the doc section 5.2.4  Shell-out to Operating System and the part
immediately following.


Post a reply to this message

From: Ross Litscher
Subject: Re: getting the output file name
Date: 17 Jan 2003 22:00:56
Message: <3e28c368@news.povray.org>
hughes, b. <omn### [at] charternet> wrote in message
news:3e28a561$1@news.povray.org...
> "Ross Litscher" <lit### [at] osuedu> wrote in message
> news:3e28806f$1@news.povray.org...
> > Hello all. motivated by a small discussion in p.b.i., i'm on a mission
to
> > find out how to get the output file name from the currently rendering
> scene.
> > actually, I guess i need the file name while parsing the scene. i've
> scanned
> > through the docs and searched on the web view of the newsgroups, but to
no
> > avail. any help would be appreciated. i basically want to write to a
file
> > with a similar filename. if the output image is called "my_scene.tga"
then
> > i'd like to write some text to a file called "my_scene.txt" without
having
> > to hard code the filenames in the .pov file. just getting the actual
> > filename is what i need, the rest i can manage.
> >
> > hopefully this makes sense. thankyou very much for any hints.
>
> Yes, does. You can do INI commands to use %s and get the name into such a
> file. See the doc section 5.2.4  Shell-out to Operating System and the
part
> immediately following.
>
>

I don't quite follow. I can create a file in povray without shelling out.
how can i get the filename contained in %s into some kind of variable for
use in pov code? what will a shell command get me? i guess if i knew the
windows command to make a new file then i could do something like:

Post_Scene_Command=make_new_file %s".txt"

or something similar, but then that still wouldn't let me know what the
filename is in the scenes pov code so i could continue with a #write (...)
command to write into that file.

maybe you are saying I should do a Post_Scene_Command to write the filename
to a file, then within the scene code do a #read  from that file to get the
filename i want into a variable?

i guess there are other ways to do what I ultmately wanted to do that needed
the filename accessible from within the scenes code.


Post a reply to this message

From: hughes, b 
Subject: Re: getting the output file name
Date: 17 Jan 2003 23:30:38
Message: <3e28d86e@news.povray.org>
"Ross Litscher" <lit### [at] osuedu> wrote in message
news:3e28c368@news.povray.org...
>
> hughes, b. <omn### [at] charternet> wrote in message
> news:3e28a561$1@news.povray.org...
> >
> > Yes, does. You can do INI commands to use %s and get the name into such
a
> > file. See the doc section 5.2.4  Shell-out to Operating System and the
> > part immediately following.
>
> I don't quite follow. I can create a file in povray without shelling out.
> how can i get the filename contained in %s into some kind of variable for
> use in pov code? what will a shell command get me? i guess if i knew the
> windows command to make a new file then i could do something like:
>
> Post_Scene_Command=make_new_file %s".txt"
>
> or something similar, but then that still wouldn't let me know what the
> filename is in the scenes pov code so i could continue with a #write (...)
> command to write into that file.

More like Pre_Scene_Command=command /c append >>c:\%s.txt   ;; or cmd if
WinXP
Then more commands to work on the file or something.

> maybe you are saying I should do a Post_Scene_Command to write the
filename
> to a file, then within the scene code do a #read  from that file to get
the
> filename i want into a variable?

Yes, except as I said above. But I'm not sure why you think you couldn't
know the files name for using in the scene file. Sounds like you are wanting
to use alternate names other than your scene's name, which is the %s in the
INI and that which would be the file created too. Only other way would be
parsing and rendering through a scene once first using #fopen YourFile
"c:\yourfile.txt" write then going through it a second time to make use of
it, at least I think so.

> i guess there are other ways to do what I ultmately wanted to do that
needed
> the filename accessible from within the scenes code.

I don't believe so. Even MegaPOV doesn't have a scene name keyword for use
soley within the SDL, I'm fairly certain it does not anyway. Alas, there
isn't any direct contact between the pov and ini for you to work with it in
the way I think you're asking about. However, you should still be able to
work around it.

Or I could be wrong.  ;-)


Post a reply to this message

From: Ross Litscher
Subject: Re: getting the output file name
Date: 17 Jan 2003 23:36:45
Message: <3e28d9dd$1@news.povray.org>
hughes, b. <omn### [at] charternet> wrote in message
news:3e28d86e@news.povray.org...
> I don't believe so. Even MegaPOV doesn't have a scene name keyword for use
> soley within the SDL, I'm fairly certain it does not anyway. Alas, there
> isn't any direct contact between the pov and ini for you to work with it
in
> the way I think you're asking about. However, you should still be able to
> work around it.
>
> Or I could be wrong.  ;-)
>
>

thats what i was hoping to find. but i understand your suggestions now and
they will help. thanks


Post a reply to this message

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