POV-Ray : Newsgroups : povray.general : New Get macro : Re: New Get macro Server Time
28 Apr 2024 16:05:34 EDT (-0400)
  Re: New Get macro  
From: Bald Eagle
Date: 24 Aug 2020 14:15:01
Message: <web.5f4402af4810ab9f1f9dae300@news.povray.org>
> I thought I could find the section anyway, but the shipped unix html to
> the online documentation looks scrambled somehow. I couldn't find the
> equivalent section on line in a reasonable amount of thrashing about.
> When online I look at section 3.3 by link online I end up in Windows
> Section 3...

I know what you mean - I can never find what I'm looking for.

http://www.povray.org/documentation/3.7.0/r3_2.html
3.2.4.2 Output File Name
....
The default output filename is created from the scene name and need not be
specified. The scene name is the input name with all drive, path, and extension
information stripped. For example if the input file name is
c:\povray3\mystuff\myfile.pov the scene name is myfile. The proper extension is
appended to the scene name based on the file type. For example myfile.tga or
myfile.png might be used.

You may override the default output name using Output_File_Name=file or +Ofile.
For example:

Input_File_Name=myinput.pov
Output_File_Name=myoutput.tga
If an output file name of "-" is specified (a single minus sign), then the image
will be written to standard output, usually the screen. The output can then be
piped into another program or to a GUI if desired.

If the file specified is actually a path or directory or folder name and not a
file name, then the default output name is used but it is written to the
specified directory. For example:

Input_File_Name=myscene.pov
Output_File_Name=c:\povray3\myimages\
This will create c:\povray3\myimages\myscene.tga as the output file.



3.2.5.2 Input File Name
Input_File_Name=file Sets input file name to file
+Ifile Same as Input_File_Name=file
Note: There may be no space between +I and file.

You will probably always set this option but if you do not the default input
filename is object.pov. If you do not have an extension then .pov is assumed. On
case-sensitive operating systems both .pov and .POV are tried. A full path
specification may be used (on MS-DOS systems +Ic:\povray3\mystuff\myfile.pov is
allowed for example). In addition to specifying the input file name this also
establishes the scene name.

The scene name is the input name with drive, path and extension stripped. In the
above example the scene name is myfile. This name is used to create a default
output file name and it is referenced other places.

Note: As of version 3.5 you can now specify a POV file on the command-line
without the use of the +i switch (i.e. it works the same way as specifying an
INI file without a switch), the POV file then should be the last on the
command-line.

If you use "-" as the input file name the input will be read from standard
input. Thus you can pipe a scene created by a program to POV-Ray and render it
without having a scene file.

3.2.6.1 String Substitution in Shell Commands
It could get cumbersome to change the Post_Scene_Command every time you changed
scene names. POV-Ray can substitute various values into a command string for
you. For example:

Post_Scene_Command=tga2gif -d -m %s
POV-Ray will substitute the %s with the scene name in the command. The scene
name is the Input_File_Name or +I setting with any drive, directory and
extension removed. For example:

Input_File_Name=c:\povray3\scenes\waycool.pov

In an animation it may be necessary to have the exact output file name with the
frame number included. The string %o will substitute the output file name.


Here is the complete list of substitutions available for a command string.

%o Output file name with extension and embedded frame number if any
%s Scene name derived by stripping path and ext from input name
%n Frame number of this frame
%k Clock value of this frame
%h Height of image in pixels
%w Width of image in pixels
%% A single % sign.


Maybe we could have a %p and/or %f for "full pathname" of input / output file.


Until then, maybe I can figure out a way to test for a file, and then if it
doesn't exist, abort the scene with an #error directive.
Then I could use the fatal error action to do something like
pwd > path.txt

User_Abort_Return=s Set user abort return actions
Fatal_Error_Return=s Set fatal return actions

But that of course requires that the scene be initiated with the .ini file.


Post a reply to this message

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