Expression

A Molang expression used as a keyframe component. Compilation resolves anim_time and life_time against the supplied animation time. Other queries pass to the evaluator.


var datapoint = KeyframeDatapoint.of("q.anim_time * 2");
var keyframe = datapoint.compile(new KeyframeCompileContext(0.5F));

Since

3.7.0

Parameters

expression

the Molang source expression

Constructors

Link copied to clipboard
constructor()

Companion properties

Link copied to clipboard
The shared numeric one datapoint.
Link copied to clipboard
The shared numeric zero datapoint.

Companion functions

Link copied to clipboard
@NotNull
open fun fromJson(@Nullable primitive: @Nullable JsonPrimitive, @NotNull stringFunction: @NotNull (String) -> String): @NotNull KeyframeDatapoint
Reads a numeric value or a Molang expression from a JSON primitive.
@NotNull
open fun fromJson(@Nullable primitive: @Nullable JsonPrimitive, @NotNull defDatapoint: @NotNull KeyframeDatapoint, @NotNull stringFunction: @NotNull (String) -> String): @NotNull KeyframeDatapoint
Reads a number or Molang expression, using the supplied default for null or blank input.
Link copied to clipboard
@NotNull
open fun of(value: Float): @NotNull KeyframeDatapoint
Creates a numeric datapoint.
@NotNull
open fun of(@NotNull expression: @NotNull String): @NotNull KeyframeDatapoint
Creates a Molang datapoint for later compilation.

Functions

Link copied to clipboard
@NotNull
open fun compile(@NotNull context: @NotNull KeyframeCompileContext): @NotNull Keyframe
Compiles this datapoint into an evaluable scalar keyframe.
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
@NotNull
open fun toString(): @NotNull String