Graphics Components

Summary
Graphics Components
AnimationCallbackListenerCallback object used by the animation system to call a function by the name on the provided table
AnimationGraphCallbackListenerListens for changes in a stance graph and fires off callbacks to scripts when those changes occur.
LuaAnimationCallbackListenerListens for animation events and fires off callbacks to scripts when those events are triggered.
BlendNodeA node in the blend tree of an animated graphics component
BlendSlotBlend tree node that allows the scripts to play an animation at a pre-defined point in the blend tree
Functions
PlayCustomAnimbegin an animation on this blend slot
NKPlayCustomAnimHoldbegin an animation on this blend slot
GetPlayingAnimationreturns the current playing animation
NKGetPlaytimeReturns the current duration of the currently playing animation
NKClearAnimationStops playing any animation on this slot
BlendByGraphDefines an animation state graph
Functions
NKTriggerTransitionTrigger a transition by name to a different state in this graph
NKSetStateSets this graph to the provided state without transitioning
NKSetStateEx
NKIsTransitioningChecks to see if the graph is currently transitioning
NKGetActiveTransitionGets the active transition name
NKGetTransitionDestinationGet the destination state name of the current active transition, or an empty string if this graph is not transitioning.
NKGetTransitionSourceGet the source state name of the current active transition, or an empty string if this graph is not transitioning.
NKFinishTransitionShort-circuits the currently playing transition to the end No-operation if there is no current transition
BlendInfoThis class defines the data necessary to drive a blend tree each frame.
Functions
NKCopyCopies the state of the provide BlendInfo into this
NKGetSpeedGets the speed used for animation blending
NKSetSpeedSets the speed used for animation blending
NKSetStateSets the value of a schematic defined BlendState
NKSetFacingDirectionSets the facing direction used for blending
NKSetMovementDirectionSets the movement direction used for blending
NKSetOnGroundSet flag indicating this object is on the ground for use by animation blending
NKSetJumpFlagSet flag indicating this object is jumping for use by animation blending
BoundsAn object representing the extents of the game object’s model
Functions
NKGetRadiusGet the radius of the model’s extents
NKGetCenterGet the center of the model
NKGetExtentsGet the extents of the model
GraphicsComponentComponent representing a GameObject’s graphics
Functions
NKSetSubmeshVisibilitySet the visibility of an individual submesh within this GraphicsComponent.
NKGetShouldRenderLastGet last render mode for this model.
NKSetShouldRenderLastSet standard/last render mode for this model.
AnimatedGraphicsComponentComponent representing an instance of an animated mesh.
Functions
NKSetSubmeshVisibilitySet the visibility of an individual submesh within this AnimatedGraphicsComponent.
GetBoneIDByNameTranslates a bone name to a bone id.
GetAnimationGet an Animation object by name.
NKGetBlendSlotGet a BlendSlot node by name from the animation BlendTree associated with this instance.
NKGetBlendGraphGet a BlendByGraph node by name from the animation BlendTree associated with this instance.
GetBlendInfoGet the BlendInfo struct driving the animation blending for this instance.
NKRegisterTransitionListenerRegisters an animation transition listener on this graphics component.
NKSetSubmeshTextureSet the texture of an individual submesh.
NKRegisterAnimationEventRegisters an animation event to this graphics component.
NKGetBonePositionGet the model space position of the provided bone.
NKGetBoneOrientationGet the model space orientation of the provided bone.
MorphPaletteContainer holding data for mesh morphing.
Functions
NKGetSizeReturns the number of variables held in this palette.
NKSetValueSets the value at a specific index in the palette.
MorphGraphicsComponentComponent representing an instance of a morph target mesh.
Functions
NKGetMorphSubmeshCountReturns the number of morph submeshes in this instance.
NKGetPaletteForSubmeshReturns the palette containing morph data for the submesh at the specified index.
StaticGraphicsComponentComponent representing an instance of an static mesh.
Functions
NKSetShouldHighlightSet if this graphic should be highlighted by the renderer.
NKIsHighlightedReturns the stored bool value for if this object is highlighted by the renderer.
NKSetSubmeshTextureSet the texture of an individual submesh.

AnimationCallbackListener

Callback object used by the animation system to call a function by the name on the provided table

AnimationGraphCallbackListener

Listens for changes in a stance graph and fires off callbacks to scripts when those changes occur.

LuaAnimationCallbackListener

Listens for animation events and fires off callbacks to scripts when those events are triggered.

Inherits:

BlendNode

A node in the blend tree of an animated graphics component

BlendSlot

Blend tree node that allows the scripts to play an animation at a pre-defined point in the blend tree

Inherits:

Summary
Functions
PlayCustomAnimbegin an animation on this blend slot
NKPlayCustomAnimHoldbegin an animation on this blend slot
GetPlayingAnimationreturns the current playing animation
NKGetPlaytimeReturns the current duration of the currently playing animation
NKClearAnimationStops playing any animation on this slot

Functions

PlayCustomAnim

begin an animation on this blend slot

Parameters

AnimationInstancethe animation which can be queried via AnimatedGraphicsComponent.GetAnimation
floatblend in time in seconds
floatblend out time in seconds
boolif true, the animation will loop until stopped
boolif true, the animation will be restarted if the same animation is already playing

NKPlayCustomAnimHold

begin an animation on this blend slot

Parameters

AnimationInstancethe animation which can be queried via AnimatedGraphicsComponent.GetAnimation
floatblend in time in seconds
boolif true, the animation will loop until stopped

GetPlayingAnimation

returns the current playing animation

Returns

AnimationInstancethe currently playing animation instance

NKGetPlaytime

Returns the current duration of the currently playing animation

Returns

doublethe time in seconds since the animation was started

NKClearAnimation

Stops playing any animation on this slot

BlendByGraph

Defines an animation state graph

Inherits:

Summary
Functions
NKTriggerTransitionTrigger a transition by name to a different state in this graph
NKSetStateSets this graph to the provided state without transitioning
NKSetStateEx
NKIsTransitioningChecks to see if the graph is currently transitioning
NKGetActiveTransitionGets the active transition name
NKGetTransitionDestinationGet the destination state name of the current active transition, or an empty string if this graph is not transitioning.
NKGetTransitionSourceGet the source state name of the current active transition, or an empty string if this graph is not transitioning.
NKFinishTransitionShort-circuits the currently playing transition to the end No-operation if there is no current transition

Functions

NKTriggerTransition

Trigger a transition by name to a different state in this graph

Parameters

stringthe name of the transition

Returns

booltrue if successful

NKSetState

Sets this graph to the provided state without transitioning

Parameters

stringthe name of the state

Returns

booltrue if successful

NKSetStateEx

ExtendedSets this graph to the provided state without transitioning

Parameters

stringthe name of the state

Returns

intan error code, or zero if successful

NKIsTransitioning

Checks to see if the graph is currently transitioning

Returns

booltrue if transitioning

NKGetActiveTransition

Gets the active transition name

Returns

stringthe name of the current transition, or empty if no transition

NKGetTransitionDestination

Get the destination state name of the current active transition, or an empty string if this graph is not transitioning.

Returns

stringthe name of the destination state.

NKGetTransitionSource

Get the source state name of the current active transition, or an empty string if this graph is not transitioning.

Returns

stringthe name of the source state.

NKFinishTransition

Short-circuits the currently playing transition to the end No-operation if there is no current transition

BlendInfo

This class defines the data necessary to drive a blend tree each frame.  This allows the user code to manipulate the state of the blend tree without knowledge of the the tree’s layout itself.

Summary
Functions
NKCopyCopies the state of the provide BlendInfo into this
NKGetSpeedGets the speed used for animation blending
NKSetSpeedSets the speed used for animation blending
NKSetStateSets the value of a schematic defined BlendState
NKSetFacingDirectionSets the facing direction used for blending
NKSetMovementDirectionSets the movement direction used for blending
NKSetOnGroundSet flag indicating this object is on the ground for use by animation blending
NKSetJumpFlagSet flag indicating this object is jumping for use by animation blending

Functions

NKCopy

Copies the state of the provide BlendInfo into this

Parameters

BlendInfothe blend info object to copy

NKGetSpeed

Gets the speed used for animation blending

Returns

floatthe speed of the corresponding game object to use with animation blending

NKSetSpeed

Sets the speed used for animation blending

Parameters

floatthe speed to use with animation blending

NKSetState

Sets the value of a schematic defined BlendState

Parameters

stringthe name of the state
intthe value to set

NKSetFacingDirection

Sets the facing direction used for blending

Parameters

vec3the normalized direction used for animation blending

NKSetMovementDirection

Sets the movement direction used for blending

Parameters

vec3the normalized direction used for animation blending

NKSetOnGround

Set flag indicating this object is on the ground for use by animation blending

Parameters

boolthe on ground flag

NKSetJumpFlag

Set flag indicating this object is jumping for use by animation blending

Parameters

boolthe jumping flag

Bounds

An object representing the extents of the game object’s model

Summary
Functions
NKGetRadiusGet the radius of the model’s extents
NKGetCenterGet the center of the model
NKGetExtentsGet the extents of the model

Functions

NKGetRadius

Get the radius of the model’s extents

Parameters

floatthe radius of the model’s extents

NKGetCenter

Get the center of the model

Parameters

vec3the center of the model

NKGetExtents

Get the extents of the model

Parameters

vec3the extents of the model

GraphicsComponent

Component representing a GameObject’s graphics

Summary
Functions
NKSetSubmeshVisibilitySet the visibility of an individual submesh within this GraphicsComponent.
NKGetShouldRenderLastGet last render mode for this model.
NKSetShouldRenderLastSet standard/last render mode for this model.

Functions

NKSetSubmeshVisibility

Set the visibility of an individual submesh within this GraphicsComponent.

Parameters

stringThe name of the submesh.
boolThe visibility state to assign.

NKGetShouldRenderLast

Get last render mode for this model.

Returns

boolenabled / disabled

NKSetShouldRenderLast

Set standard/last render mode for this model.

Parameters

boolenabled / disabled

AnimatedGraphicsComponent

Component representing an instance of an animated mesh.

Inherits:

Summary
Functions
NKSetSubmeshVisibilitySet the visibility of an individual submesh within this AnimatedGraphicsComponent.
GetBoneIDByNameTranslates a bone name to a bone id.
GetAnimationGet an Animation object by name.
NKGetBlendSlotGet a BlendSlot node by name from the animation BlendTree associated with this instance.
NKGetBlendGraphGet a BlendByGraph node by name from the animation BlendTree associated with this instance.
GetBlendInfoGet the BlendInfo struct driving the animation blending for this instance.
NKRegisterTransitionListenerRegisters an animation transition listener on this graphics component.
NKSetSubmeshTextureSet the texture of an individual submesh.
NKRegisterAnimationEventRegisters an animation event to this graphics component.
NKGetBonePositionGet the model space position of the provided bone.
NKGetBoneOrientationGet the model space orientation of the provided bone.

Functions

NKSetSubmeshVisibility

Set the visibility of an individual submesh within this AnimatedGraphicsComponent.

Parameters

stringThe name of the submesh.
boolThe visibility state to assign.

GetBoneIDByName

Translates a bone name to a bone id.

Parameters

stringThe name of the bone.

Returns

intThe bone id of the provided name, or -1 if a bone by that name was not found.

GetAnimation

Get an Animation object by name.

Parameters

stringThe name of the Animation to retrieve.

Returns

AnimationThe Animation with the provided name, or nil if not found.

NKGetBlendSlot

Get a BlendSlot node by name from the animation BlendTree associated with this instance.

Parameters

stringThe name of the BlendSlot node.

Returns

BlendSlotThe BlendSlot with the provided name, or nil if no node by that name was found.

NKGetBlendGraph

Get a BlendByGraph node by name from the animation BlendTree associated with this instance.

Parameters

stringThe name of the BlendByGraph node.

Returns

BlendSlotThe BlendByGraph with the provided name, or nil if no node by that name was found.

GetBlendInfo

Get the BlendInfo struct driving the animation blending for this instance.

Returns

BlendInfoThe BlendInfo driving the animation blending for this instance.

NKRegisterTransitionListener

Registers an animation transition listener on this graphics component.

Parameters

BlendByGraphThe transition graph to register the listener to.
AnimationGraphCallbackListenerThe listener that specifies what function should be called when the graph reports a change.

NKSetSubmeshTexture

Set the texture of an individual submesh.

Parameters

ETextureTypetype of texture
stringsubmesh name
intsurface id
stringtexture name

NKRegisterAnimationEvent

Registers an animation event to this graphics component.  When this event is triggered, a callback will be fired to the listener.  These events are defined in the Animations section of the graphics component in the object’s data file.

Parameters

stringThe name of the animation event to listen for.
LuaAnimationCallbackListenerThe callback listener that specifies what function should be called when the animation event is fired.

NKGetBonePosition

Get the model space position of the provided bone.

Parameters

intThe bone id to return the position of.

Returns

vec3The model space position of the provided bone, or a zero vector if a bone with the id was not found.

NKGetBoneOrientation

Get the model space orientation of the provided bone.

Parameters

intThe bone id to return the orientation of.

Returns

quatThe model space orientation of the provided bone, or the identity if a bone with the id was not found.

MorphPalette

Container holding data for mesh morphing.

Summary
Functions
NKGetSizeReturns the number of variables held in this palette.
NKSetValueSets the value at a specific index in the palette.

Functions

NKGetSize

Returns the number of variables held in this palette.

Returns

intThe number of variables held in this palette.

NKSetValue

Sets the value at a specific index in the palette.

Parameters

intThe index for the value.
floatThe value to be set.
boolIf true, no animation can override this setting.

MorphGraphicsComponent

Component representing an instance of a morph target mesh.

Inherits:

Summary
Functions
NKGetMorphSubmeshCountReturns the number of morph submeshes in this instance.
NKGetPaletteForSubmeshReturns the palette containing morph data for the submesh at the specified index.

Functions

NKGetMorphSubmeshCount

Returns the number of morph submeshes in this instance.

Returns

intThe number of morph submeshes in this instance.

NKGetPaletteForSubmesh

Returns the palette containing morph data for the submesh at the specified index.

Parameters

intThe index of the submesh.

Returns

MorphPaletteThe palette containing morph data for the submesh.

StaticGraphicsComponent

Component representing an instance of an static mesh.

Inherits:

Summary
Functions
NKSetShouldHighlightSet if this graphic should be highlighted by the renderer.
NKIsHighlightedReturns the stored bool value for if this object is highlighted by the renderer.
NKSetSubmeshTextureSet the texture of an individual submesh.

Functions

NKSetShouldHighlight

Set if this graphic should be highlighted by the renderer.

Parameters

booltrue will highlight, false will not.

NKIsHighlighted

Returns the stored bool value for if this object is highlighted by the renderer.

Returns

booltrue is highlighted, false is not.

NKSetSubmeshTexture

Set the texture of an individual submesh.

Parameters

ETextureTypetype of texture
stringsubmesh name
stringtexture name
Callback object used by the animation system to call a function by the name on the provided table
Listens for changes in a stance graph and fires off callbacks to scripts when those changes occur.
A node in the blend tree of an animated graphics component
Component representing a GameObject’s graphics
Component representing an instance of an animated mesh.
Close