Eyeon:Script/Tutorials/Console Introduction/Attributes, Input-Output List
From VFXPedia
Contents |
Attributes, Input List, Output List
Part 1 - Attributes
In order to determine the Clips of a multiclip Loader in the previous example, you'd have to know what the Global In / Global Out positions of all the clips in the loader's cliplist. This takes some of the automation out of scripting.
Fortunately, eyeonScript has a number of hidden properties of tools that can be read with the GetAttrs() function.
Add a multiclip loader to your composition and rename it to "LoaderMulti". Input the following:
print(LoaderMulti:GetAttrs()) table: 084BB4B0
In this case, it's telling us that the function returned a table. In order to read all of the values of a table, you need to utilize the dump function.
dump(LoaderMulti:GetAttrs())
Now a list full of special hidden attributes should be visible in the console. As an aside note, the console has shortcuts for the print and dump functions:
=LoaderMulti:GetAttrs() table: 084BB4B0 ==LoaderMulti:GetAttrs()
In the console, you should see a number of hidden properties. For more information, see the GetAttrs function's documentation. For now, the property we're interested in is the TOOLST_Clip_Name.
The first part of the variable, "TOOL" means that the object whose attributes are being shown is a tool, the "S" means that the values are strings, and the "T" means that they're in a table, meaning multiple values (hence multiple clips). Inside the table should be the name of each clip that's being used in the loader at different times.
There are a number of other interesting pieces of information in the attributes list. Take a few seconds now to go over them. Not all of these entries will make complete sense, but they may prove useful later on.
For more information, see the GetAttrs() and SetAttrs() functions as well as the section on attributes and properties.
Part 2 - Input / Output List
As explained earlier, every tool has a number of properties. These properties can be broken down into inputs and outputs; inputs are the information that's put into the tools (the gamma of a brightness/contrast, etc.), and outputs are the processed results of the inputs (see Inputs and Outputs section for greater clarity).
If ever a list of all the inputs available to a tool is needed, utilize the GetInputList function. For instance:
==LoaderMulti:GetInputList()
Should return a table full of input objects.
In order to find out more information about each individual Input, utilize the GetAttrs() function. If we wanted to get the attributes for the fifteenth table entry in the input list, we could do the following:
inputList=LoaderMulti:GetInputList() ==inputList[15]:GetAttrs()
A similar method could be used for getting the list for all outputs.
outputList = LoaderMulti:GetOutputList() ==outputList ==outputList[1]:GetAttrs()
Every single tool has attributes/inputs/outputs. Some tools will have unique attributes exclusive to the tool.
Tips for Attributes, Input-Output List (edit)
EyeonTips:Script/Tutorials/Console Introduction/Attributes, Input-Output List
