input is a reserved word. It is used in HSL scripts to define a variable as an argument that is required to run the script.
input can be used to define control constructs, data types, and Boolean states in Shogun Post scripts. Do not use input as a variable name in your script commands.
Inputs are commonly used to create parameters for a script, which are visible in the Pipelines panel. Input statements set the default value of a variable, and some conditions that must be adhered to, such as range. The variable named in the input statement must be declared in the script. The input statement also allows you to control the way in which the parameter is visible and specified in the Pipelines panel.
|string||Yes||Variable name declared in the script, must begin with $.|
|Must match type of variableName||Yes||Default value that the variable will take, if not given as an argument when calling the script.|
|Name||Flag arguments||Argument type||Exclusive to||Comments|
|0||–||Makes the parameter for the script advanced, rather than always visible in the Pipelines panel.|
|0||Should only be used when the discrete or namedDiscrete flag is present. When using the discrete flag, this allows the input parameter in the Pipelines panel to be edited as well being selected from the discrete picklist|
|0||file, folder, module, discrete, namedDiscrete||Adds a color picker to the pipeline parameter. The associated variable must be type vector.|
|11||string||–||Adds a description that is visible in the Pipelines panel.|
|Many||string||color, file, folder, module, namedDiscrete||Sets a picklist for the value which is visible in the Pipelines panel.|
|1||string||color, folder, module, discrete, namedDiscrete||Generates a file icon in the parameter in the Pipeline panel enabling browsing to a file. The fileFilter sets the filter in the file browser. The associated variable must be type string.|
|1||string||color, file, module, discrete, namedDiscrete|
As with file (above), except string returned is a path to a directory rather than a file.
|Many pairs||string||–||Enables the input to be returned from a script. Pairs of arguments are specified as strings. The first string is a picklist item visible in the Pipelines panel; the following string is a script name that will return the input value.|
|0||color, file, folder, discrete, namedDiscrete||Enables you to pick a module from the scene to use in a string variable.|
|Many pairs||string, variable type||color, file, folder, module, discrete||Enables you to create a picklist of type string, which has corresponding values, the same type as the variable type.|
|2||int or float||Enables you to set a range for integer or float variables. May only be used when the variable type is numeric.|
* This flag changes the way the variable's input is entered in the GUI and therefore may not be combined with any of the other flags marked with an asterisk * in the above table. You can use these flags only when the variable type is compatible, for example, you cannot use -folder with an int variable. However, you can use color, discrete, or namedDiscrete for a color variable.
// This allows you to specify pairs of arguments as strings after the -macro.
// First string is the value in the picklist in the operation parameters
// Second string is the script to run which will return a value into the input
// IMPORTANT all return variables from scripts must be the same variable type,
// in this case strings. Otherwise it might crash Shogun Post.
input $GetDayOrMonthAsString "" -macro "Day" "GetDayOfWeek" "Month" "GetMonth";
// This allows you to pick a module from the scene to use in a string variable
// If there is a blank scene there will be nothing to pick
// associated variable must be type string
input $PickModuleName "" -module;
// -discrete -allowNonDiscrete
// Example 1: allows you to create a picklist using the -discrete switch
// NOTE: The default value for the input has to be included in the list of discrete
input $PickTextToPrint "Text1" -discrete "Text1" "Text2";
// Example 2: allows you to edit the text as well as use the picklist using the
// -allowNonDiscrete switch
// NOTE: It is helpful, but not essential, to add "" to the picklist, so that it is
// obvious you can leave blank or enter text
input $PickOrTypeTextToPrint "Text3" -discrete "" "Text3" "Text4" -allowNonDiscrete;
// Specify pairs of strings, first string: Picklist value, second string: Value to
// set variable to. Allows you to create a picklist, that will convert to another
// value of the same variable type. Picking "One" will set the variable to "1",
// which could be easily converted to an integer.
// IMPORTANT: The default value must be a valid entry from the variable value, and
// not the picklist value.
input $GetNumberFromWord "1" -namedDiscrete "One" "1" "Two" "2" "Three" "3";
// This will make the parameter for the script an advanced one rather than always
// visible in the pipelines panel.
// This will add a color picker to the pipeline parameter
// associated variable must be type vector
// This will add a description which will be visible in the pipelines panel.
// This generates a file icon in the parameter in the pipeline panel allowing
// browsing to a path associated variable must be type string
string $Filename; input $Filename "" -file "ShogunPost File (.hdf)|.hdf";
// As with file, except string returned is a path to a directory rather than a
// Allows a range to be set for integer or float variables
input $EnterValInRange 10.000 -range -50.000 50.000 -description "Enter value between -50.000 and 50.000";