BrushBehavior



A behavior describing how stroke input properties should affect the shape and color of the brush tip.

The behavior is conceptually a tree made from the various node types defined below. Each edge of the tree graph represents passing a nullable finite floating point value (with "null" representing an undefined value) from a node to its parent, and each node in the tree fits into one of the following categories:

  1. Leaf nodes generate an output value without graph inputs. For example, they can create a value from properties of stroke input.

  2. Filter nodes can conditionally toggle branches of the graph "on" by outputting their input value, or "off" by outputting a null value.

  3. Operator nodes take in one or more input values and generate an output. For example, by mapping input to output with an easing function.

  4. Terminal nodes apply one or more input values to chosen properties of the brush tip.

For each input in a stroke, BrushTip.behaviors are applied as follows:

  1. The actual target modifier (as calculated above) for each tip property is accumulated from every BrushBehavior present on the current BrushTip. Multiple behaviors can affect the same Target. Depending on the Target, modifiers from multiple behaviors will stack either additively or multiplicatively, according to the documentation for that Target. Regardless, the order of specified behaviors does not affect the result.

  2. The modifiers are applied to the shape and color shift values of the tip's state according to the documentation for each Target. The resulting tip property values are then clamped or normalized to within their valid range of values. E.g. the final value of BrushTip.cornerRounding will be clamped within 0, 1. Generally: The affected shape values are those found in BrushTip members. The color shift values remain in the range -100% to +100%. Note that when stored on a vertex, the color shift is encoded such that each channel is in the range 0, 1, where 0.5 represents a 0% shift.

Note that the accumulated tip shape property modifiers may be adjusted by the implementation before being applied: The rates of change of shape properties may be constrained to keep them from changing too rapidly with respect to distance traveled from one input to the next.

Summary

Public constructors

BrushBehavior(terminalNode: TerminalNode, developerComment: String)

Constructs a BrushBehavior with a single TerminalNode.

Cmn
BrushBehavior(
    terminalNodes: List<TerminalNode>,
    developerComment: String
)

Constructs a BrushBehavior with a list of TerminalNodes.

Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

List<TerminalNode>

An immutable list of the targets that this BrushBehavior affects.

Cmn

Public constructors

BrushBehavior

BrushBehavior(terminalNode: TerminalNode, developerComment: String = "")

Constructs a BrushBehavior with a single TerminalNode.

BrushBehavior

BrushBehavior(
    terminalNodes: List<TerminalNode>,
    developerComment: String = ""
)

Constructs a BrushBehavior with a list of TerminalNodes.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

terminalNodes

val terminalNodesList<TerminalNode>

An immutable list of the targets that this BrushBehavior affects.