POV-Ray : Documentation : 3.5.9.1 Syntax Coloring
  POV-Ray 3.6 Documentation Online View  
3.5.9 Tools Menu   3.5.9.2 Reload Tool Menu

3.5.9.1 Syntax Coloring

The syntax of entries in PVTOOLS.INI is as follows:

[Menu]
Itemn=Description
 
[Command]
Itemn=command_string
 
[Help]
Itemn=help_line

Where n is a number between 0 and 31, and entries in the [Help] section are optional.

Item0 ... Item31

are the item numbers that define the order in which entries appear in the Tools Menu.

[Menu]

Entries in the [Menu] section are what actually appears in the Tools Menu. The '&' character tells Windows where to put the underline in the menu entry. The underlined letter becomes the abbreviation for the command. For example the letter 'C' in '&Click Me' would become 'Click Me' when displayed in the Tools Menu, and you could access the command by pressing Alt+T and then 'C'. (Alt+T activates the Tools Menu).
You should make sure that all Tools Menu entries have different abbreviations if you intend to access them this way. Of course, you don't have to supply any abbreviation if you don't want to.

[Command]

This is the command that POV-Ray will execute for that entry. This can be a Windows EXE or PIF, a DOS EXE or COM, or even a DOS batch file. The command consists of the actual command name followed by any parameters you want to supply to the program.
There is one special command, called '$S'. $S means 'use the shell association for the filename that follows it'. Let's look at an example -

Item4=$S %1

Since %1 refers to the output file (see below) this means that Item 4 of the tools menu expands to a command to Windows to open the last output file with whatever program is associated with it. For example, if the last output file was 'c:\images\torus4.bmp' then the above command example would use whatever program is associated with BMP files (i.e. the program that Windows runs if you double-clicked on the TORUS4.BMP file in Windows Explorer) to open it.

Note: If using the Shell Open command ($S), DO NOT quote the parameters with '"', even if they will have spaces in them.

POV-Ray for Windows has a number of pre-defined parameters that you can substitute into the command line before the program is run. These are defined by a percent sign ('%') followed by a letter or number. For example, '%i' means substitute the POV-Ray for Windows INI file directory in the place of the '%i'.

Let's look at the command:

notepad.exe %ipvtools.txt

If you had installed POV-Ray for Windows into the directory 'c:\povwin3', then our standard INI file directory would be 'c:\povwin3\ini\'. When POV-Ray ran the above command, the '%i' would be replaced with 'c:\povwin3\ini\'. Note that the trailing '\' is provided by POV-Ray. This means that:

notepad.exe %ipvtools.txt

would become:

notepad.exe c:\povwin3\ini\pvtools.txt

Here are all of the predefined substitutions:
%0 The contents of the 'SourceFile' entry of the 'LastRender' section in PVENGINE.INI. This will be the input file provided to POV-Ray for the most recent render. This information is extracted from the rendering engine itself, rather than any input dialog or command-line. It is the file which, after all processing of the command line and INI files was complete, was finally assigned as the input file.
%1 The contents of the 'OutputFile' entry of the 'LastRender' section in PVENGINE.INI. This will be the output file from the last render, if any. This entry could be blank.
%2 The contents of the 'SceneFile' entry of the 'LastRender' section in PVENGINE.INI. This will be the scene file name for the last render, without the .POV extension. You can use this by appending a new extension to it. For example,
tga2gif %d\%1 %2.gif
could expand to:
tga2gif c:\scenes\myscene.tga myscene.gif
assuming the input file was myscene.pov and the current directory at that time was c:\scenes.
%3 The contents of the 'HistogramFile' entry of the 'LastRender' section in PVENGINE.INI. If there was a histogram file written, this will be its name. If the histogram file was in .CSV format, you'd probably use this to fire up Excel. Otherwise, you could use it to run a viewer program or a post-processor.
%4 The contents of the 'IniOutputFile' entry of the 'LastRender' section in PVENGINE.INI. If you had instructed POV-Ray to write an INI file from the last render, this would contain its name.
%D The contents of the 'CurrentDirectory' entry of the 'LastRender' section in PVENGINE.INI. This is the current working directory that was set on your machine when POV-Ray began rendering the last file, and is what the other output file entries are probably relative to. You may need to provide '%d' with some of these other entries to get the full path.
%H The POV-Ray for Windows home directory, as specified in the registry, e.g. 'c:\Program Files\POV-Ray for Windows v3.6\'. Note the trailing backslash is supplied.
%I The POV-Ray for Windows INI directory. e.g. 'c:\Program Files\POV-Ray for Windows v3.6\ini'.
%N The preset INI filename, as used in the render options dialog.
%R The last render file (with full path) as supplied to POV-Ray from the render or choose file dialog. This is not necessarily the same thing as %S or %0.
%S The source file name as provided to POV-Ray on the last render of the current session. This is not necessarily the same thing as the %0 or %R directive. For example, %R will never provide the path to a file that was rendered via the File Queue without the use of the Command dialog. %S will, however, include any such file.
%T The full path to PVTOOLS.INI. This is the file which holds the Tools Menu commands.
%% A literal percent character ('%').

If any of the above seems confusing, there's an easy way to find out what's going on. If you place the statement DEBUG=1 in the General section of PVTOOLS.INI, POV-Ray for Windows will print out the string for each command both before and after it is expanded, instead of running the command that you select in the tool menu. That way you can see exactly what POV-Ray substitutes. The printout will be visible in the messages window.

For example:

[General]
Debug=1

will turn on debugging. while

[General]
Debug=0 

or omitting the statement entirely turns it off.

[Help]

You can have a help line appear in the status bar at the bottom of the window. You don't have to supply this entry if you don't want to.

Example:

[Help]
Item8=Lets you shell out to DOS

This command makes the string 'Lets you shell out to DOS' appear on the status bar when the mouse is over the 8th item in the Tools menu.

3.5.9 Tools Menu   3.5.9.2 Reload Tool Menu


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