Contact Us

CATEGORIES

Whoops…Nothing found

Try other keywords in your search

pixc LUA Functions

 1 Minute

 0 Likes

 29 Views

The pixc LUA functions available in PIXERA Control gives the user a variety of options for internal control of Actions and the data they have access to. In this article, we will go over these options and their uses.


Logging with pixc.log()

 

pixc.log() allows you to print data into the log window of the Control tab, functioning as a kind of terminal window to monitor values being used in the Action. The log window can be opened by clicking on the “sheet of paper” icon at the top of the workspace.

To use the function, you simply need to input into the parentheses whatever variable or other API function that will then print its value to the log when the Action is run.

If you would like to clear the log of data, you will want to use Alt + Click onto the "sheet of paper" icon.


Displaying Data with pixc.report()

 

pixc.report() is similar to pixc.log(), in that it will display the data of what is put inside. However, instead of printing the data into the log, it will have the data popup in the attribute location next to the Action's name in the workspace. This example below is an Action without an attribute.

 

If this function is not used in an Action, it is automatically created in the LUA core. Empty Actions like this automatically forward the inputted value to the attribute field, only making it visible, not usable. This example below is an Action with an attribute.

 

Adding your own pixc.report() to this type of Action will then make it only display what you enter, not what is being received.


Sending and Receiving Data with pixc.callRefs()

 

pixc.callRefs() also handles data, but instead of only displaying it, the allows you to pass values in the node based system to other Module's Actions.

 

If this function is not used in an Action, it is automatically created in the LUA core. Empty Actions like this automatically forward the inputted value down the chain, to be used or not at the user's discretion.

 

Adding your own pixc.callRefs() to a center Action in the chain will then make it only send what you enter, not what is being received.

 

pixc.callRefs() also returns to the Action that called it a table containing a reference of every Action's return that it is connected to. This way the call can be used to get the end data from another Action for later use.

The table format of the return is in the form of:

  • Table with all connected actions
    • Number of element
    • Table with all return values of the element
      • Number of element
      • return

Take a look at this example project file for more information: CallRefs and Return


Stopping Data with pixc.suppressCallRefs()

 

pixc.suppressCallRefs() is the opposite of pixc.report() and pixc.callRefs()in that instead of displaying or sending along data, it stops any data from being displayed or sent along.

 

This is useful if you want an Action to not have data sent to it displayed, or if you want an Action in a chain to not send any data to the next Action. In the case of pixc.callRefs(), pixc.suppressCallRefs() will also not run the following Actions, allowing it to be a stop for programming.

 

PIXERA 2.0.230 | 07. January 2024 | CL

Was this article helpful?