Console Commands - Variables

 

There are three types of variables:

1) Configuration Variables hold the Function settings, like the primary color value or the mixing mode (solid, add, etc.). These variables cannot be accessed directly. Use the pushvar and popvar commands to exchange data with the temporal variables.

2) Temporal Variables are used to perform calculations (see the compute command below). You can use these variables in other commands by writing them with a preceding $ character like e.g. $foobar. If you add multiple $ in front of the variable, they are converted to zeroes until the resulting string reaches the length equal to the number of $. For example $$$foobar translates to 003 if foobar=3. This is useful if you want to save a number of image files in a script and want them to be named like "image0001, image0002, ...".

Tip: You can set the temporal variables from p1 to p99 at the command line. This is useful if you want to run a script with dynamic data from the command line.
For example start the program with texturemaker.exe /p1="E:\myfiles\myimage.bmp" and specify the line open $p1 within a script to load that image.

3) Query Variables store the data, which is gathered from user-defined dialogs in scripts (see the addquery command). Insert the values of these variables in command terms by writing the $ character in front of them (e.g. $myqueryvariable). Please use letters [a..z] only in variable names.

4) There are some reserved words specified, which can be used to gather information from the application and the active texture:

$texture: The name from the active Texture.
$width: Width of the active Texture.
$height: Height of the active Texture.
$texturecount: Number of open Textures.
$randomname: Returns a random string.
$time: The current time.
$function: Currently selected function.

Command List:

addquery, compute, cvarlist, initvars, loadpreset, popconfig, popquery, popvar, pushconfig, pushquery, pushvar, query, randomizeconfig, resetquery, savepreset, set.

 

addquery

Usage: addquery <varname>,<description>,<type>=<initalvalue>

Adds an item to the query dialog. Query dialogs are used in scripts to make them more dynamic. The variable <varname> stores the data, which can be adjusted by the user at the dialog. Its item is displayed beside the string <description>.

<type> can be string (a text string, like HelloWorld), value (a number, e.g. 0) and color (a color integer value, for example 16777215 for white).

Example: addquery mycolor,This is your color,color=255
This adds the color item This is your color with the initial color red to the query list.

Hint: You can create multilanguage descriptions by separating the primary and secondary language string at the description with a ~ character (e.g. english~german).

 

query

Usage: query [<title>]

Calls the query dialog with the items, that were added by the addquery command, and the heading defined by the optional <title> parameter.

 

resetquery

Usage: resetquery

Clears the query dialog item list. You should always call this in script before using addquery.

 

pushquery

Usage: pushquery <configvar>=<queryvar>

Sets the configuration variable <configvar> to the value/string that is stored in the query variable <queryvar>.

Example: pushquery opacity=myvariable1

Hint: Use the cvarlist command to see what config. variables are available.

 

popquery

Usage: popquery <queryvar>=<configvar>

Copies the data from the config. variable <configvar> to the query variable <queryvar>

Example: popquery colorA=primary color

Hint: Use the cvarlist command to see what config. variables are available.

 

set

Usage: set <configvar>=<value>

Stores <value> in the configuration variable <configvar>.

Example: set primary color=0
This sets the Primary Color to black.

Hint: Use the cvarlist command to see what config. variables are available. Many variables can be set to random, which automatically randomizes them to a meaningful value. E.g. setting the variator with "set variator map=random" to random, automatically loads an arbitrary variator map from the list.

Special: For setting the primary and secondary color, you can use the shortcut commands
setpricol <red>,<green>,<blue> 
and
setsecol <red>,<green>,<blue> 

 

randomizeconfig

Usage: randomizeconfig

Sets all configuration variables of the currently selected function to random values (useful for script that create random textures).

 

loadpreset

Usage: loadpreset <presetname>

Loads the preset named <presetname> from the list of available presets for the currently selected function. Presets store the configuration variables (i.e. the settings) for each function.

Example: loadpreset default
Loads the <default> preset

 

savepreset

Usage: savepreset <presetname>

Adds the preset named <presetname> to the currently selected function's preset list.

Example: savepreset mysettings01

Hint: Existing presets will be overwritten.

 

cvarlist

Usage: cvarlist <string>

Lists all configuration variables that contain <string> in their name.

Example: cvarlist color

Hint: Look at the panels documentation to get a list of configuration variables.

 

pushconfig

Usage: pushconfig

Stores the current state of the configuration variables to a temporal location.

Hint: Use this command in combination with the popconfig command in scripts to make sure your script doesn't mix up the user's custom settings.

Example of usage in scripts:

select filter/smooth
pushconfig
loadpreset default
set smooth radius=30
engage
popconfig

 

popconfig

Usage: popconfig

Restores the configuration variables from the temporal location after it was saved by the pushconfig command.

 

compute

Usage: compute <var>=<term>

Computes the mathematical expression <term> and stores the result in the temporal variable <var>. You can use other temporal variables in <term> without having to write a $ in front of them. If the expression resulted in an invalid result, <var> will be set to zero.

Example: compute a=b*sin(b*2*Pi)

 

pushvar

Usage: pushvar <configvar>=<tempvar>

Copies the value of the temporal variable <tempvar> to configuration variable <configvar>

Example: pushvar primary color=a

 

popvar

Usage: popvar <tempvar>=<configvar>

Stores the value of the configuration variable <configvar> in the temporal variable <tempvar>.

Example: popvar a=primary color

 

initvars

Usage: initvars

Deletes all temporal variables.