PopcornFX v2.17

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
  1. Home
  2. Docs
  3. PopcornFX v2.17
  4. Scripting reference
  5. Namespaces
  6. debug

debug

The debug namespace gives access to debug & diagnostics helper functions.

Diagnostics

Return typeDescription
voiddebug.info(bool condition)
If condition is true at graph compile-time, will cause the editor to emit a build info message.
Removed in shipping builds.
voiddebug.warning(bool condition)
If condition is true at graph compile-time, will cause the editor to emit a build warning message.
Removed in shipping builds.
voiddebug.error(bool condition)
If condition is true at graph compile-time, will cause the editor to emit a build error message.
Removed in shipping builds.
voiddebug.assert(bool condition)
If condition is true at graph compile-time, will cause the editor to emit a build error message.
If condition is false at runtime, will cause the editor to pause the simulation and select the particle for inspection / debugging.
Removed in shipping builds.

 

These can be useful to emit diagnostics inside templates. Each have a node equivalent.
A couple of core-library templates use these to emit warnings when incorrect combinations of properties are used (for example, the event multiplier node)

Draw helpers

 

 

Return typeDescription
intalignMode enumeration

  1. alignMode.left: Left alignment
  2. alignMode.center: Center alignment
  3. alignMode.right: Right alignment
voiddebug.drawValue(bool enabled, auto value, float3 position[, float fontScale, float4 color, float2 offset, int alignMode]) [v2.15.0]
If enabled is true, draws value at position (worldspace position), offsetted by offset worldspace units along the camera side/up axis.
The value input can be of type int, int2, int3, int4, float, float2, float3, or float4.
The fontScale parameter is a size multiplier for the text, whose size is 0.1 worldspace units wide by default, so setting a scale of 10 would make each character 1.0 world units wide. You can pass a value that depends on the distance to the view to make the text appear a constant screenspace size.
The alignMode defaults to alignMode.center, it can take the following values:

  1. alignMode.left: The text will be to the left of position
  2. alignMode.center: The text will be centered on position
  3. alignMode.right: The text will be to the right of position

Removed in shipping builds.

voiddebug.drawLine(bool enabled, float3 start, float3 end[, float4 colorStart, float4 colorEnd]) [v2.16.0]
If enabled is true, draws a line between the worldspace positions start and end.
You can specify the color of both extremities using colorStart and colorEnd. When not specified, they default to white.
Removed in shipping builds.

 

Note: The debug.draw* functions will only appear in-editor if the debug information button is activated in the editor viewport’s toolbar:
Debug info toggle button

 

Was this article helpful to you? Yes No

How can we help?