Designer Plugins
Plugins for Disguise Designer software.
Plugins for Disguise Designer software.
Globally available utility functions and types which are unique to Designer.
When executing Python code, your script is indented and embedded within a function called userScript. Errors within the userScript are caught and reported with context about the line number and the specific error that occurred. The userScript function body starts on line 10 of the overall script, so when an error occurs, it will reference this offset line number. For example, an error referencing line 10 actually refers to the first line of your script.
Debugging tip: When an error occurs, add print() statements to trace execution and help identify what went wrong.
For more information about the execution environment, see the Python Environment page.
In the API reference, Type always refers to a Python type. There is no Type class. The class names themselves are valid types. For example, Vec is a valid Type value.
ReflectionValue is equivalent to Python’s Any type and accepts any value.
Access as follows: getattr(ClassName.property.fget, 'field', None). If field is not found, it is incompatible with getting the FieldInfo.
Note that Vec and Vec3 are the same class object, aliased under different names.
| Task | Python |
|---|---|
| Create a 2D float vector | Vec2(x, y) - see Vec2 |
| Create a 3D float vector (for position, size, etc.) | Vec(x, y, z) or Vec3(x, y, z) - see Vec |
| Create a 4D float vector | float4(x, y, z, w) - see float4 |
| Create a 2D integer vector (for resolution, etc.) | Int2(width, height) - see Int2 |
| Property | Access |
|---|---|
| Timecode time in seconds | tc.t - see Timecode |