Syntax
OSL programming is made up of 6 different types of syntax.
Commands
Commands are the backbone of all osl scripting, they take inputs and return nothing. Inputs can be raw data, such as a string
Assignments
Assignments are any line that has an assignment operator as the second token.
Methods
Methods allow you to modify the data you input into them, and they do return a value.
Using Methods As Commands
Functions
Functions take parameters and no inputs, and are mostly used for when the function isn’t meant to modify any specific variable but rather calculate a value based on its parameters
Statements
Statements are containers for commands, and allow for conditionals and looping.
Examples of statements are shown below:
Operators
Operators take in values from their left and right tokens and calculate a response to replace itself and those two tokens with the output of the calculation. Operators include logic like and, or, nor, nand.. etc.
Last updated