unreal.NiagaraDataChannelLibrary

class unreal.NiagaraDataChannelLibrary(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

A C++ and Blueprint accessible library of utility functions for accessing Niagara DataChannel

C++ Source:

  • Plugin: Niagara

  • Module: Niagara

  • File: NiagaraDataChannelFunctionLibrary.h

classmethod get_data_channel_element_count(world_context_object, channel, search_params, read_previous_frame=True) int32

LEGACY FUNCTION: Please use non-legacy version. Returns the number of readable elements in the given data channel This function is now legacy and and will soon be deprecated. Please use the new non-legacy function.

Parameters:
  • world_context_object (Object) – World to execute in

  • channel (NiagaraDataChannelAsset) – The channel to read from

  • search_params (NiagaraDataChannelSearchParameters) – Parameters used when retrieving a specific set of Data Channel Data to read or write like the islands data channel type.

  • read_previous_frame (bool) – True if this reader will read the previous frame’s data. If false, we read the current frame. Reading the current frame allows for zero latency reads, but any data elements that are generated after this reader is used are missed. Reading the previous frame’s data introduces a frame of latency but ensures we never miss any data as we have access to the whole frame.

Return type:

int32

classmethod read_from_niagara_data_channel(world_context_object, channel, search_params, read_previous_frame) NiagaraDataChannelReader

LEGACY FUNCTION: Please use non-legacy version. Initializes and returns the Niagara Data Channel reader for the given data channel. This function is now legacy and and will soon be deprecated. Please use the new non-legacy function.

Parameters:
  • world_context_object (Object) – World to execute in

  • channel (NiagaraDataChannelAsset) – The channel to read from

  • search_params (NiagaraDataChannelSearchParameters) – Parameters used when retrieving a specific set of Data Channel Data to read or write like the islands data channel type.

  • read_previous_frame (bool) – True if this reader will read the previous frame’s data. If false, we read the current frame. Reading the current frame allows for zero latency reads, but any data elements that are generated after this reader is used are missed. Reading the previous frame’s data introduces a frame of latency but ensures we never miss any data as we have access to the whole frame.

Return type:

NiagaraDataChannelReader

classmethod subscribe_to_niagara_data_channel(world_context_object, channel, search_params, update_delegate) int32

LEGACY FUNCTION: Please use non-legacy version. Subscribes to a single data channel and calls a delegate every times new data is written to the data channel.

Parameters:
  • world_context_object (Object) – World to execute in

  • channel (NiagaraDataChannelAsset) – The channel to subscribe to for updates

  • search_params (NiagaraDataChannelSearchParameters) – Parameters used when retrieving a specific set of Data Channel Data to read - only used by some types of data channels, like the island types.

  • update_delegate (OnNewNiagaraDataChannelPublish) – The delegate to be called when new data is available in the data channel. Can be called multiple times per tick.

Returns:

unsubscribe_token (int32): This token can be used to unsubscribe from the data channel.

Return type:

int32

classmethod subscribe_to_niagara_data_channel_with_context(world_context_object, channel, access_context, update_delegate) -> (access_context=NDCAccessContextInst, unsubscribe_token=int32)

Subscribes to a single data channel and calls a delegate every times new data is written to the data channel.

Parameters:
  • world_context_object (Object) – World to execute in

  • channel (NiagaraDataChannelAsset) – The channel to subscribe to for updates

  • access_context (NDCAccessContextInst) – Context allowing passing of NDC type specific information between the caller and internal Data Channel that can control internal routing and help feedback information to the caller.

  • update_delegate (OnNewNiagaraDataChannelPublish) – The delegate to be called when new data is available in the data channel. Can be called multiple times per tick.

Returns:

access_context (NDCAccessContextInst): Context allowing passing of NDC type specific information between the caller and internal Data Channel that can control internal routing and help feedback information to the caller.

unsubscribe_token (int32): This token can be used to unsubscribe from the data channel.

Return type:

tuple

classmethod unsubscribe_from_niagara_data_channel(world_context_object, channel, unsubscribe_token) None

Removes a prior registration from a data channel

Parameters:
  • world_context_object (Object) – World to execute in

  • channel (NiagaraDataChannelAsset) – The channel to unsubscribe from

  • unsubscribe_token (int32) – The token returned from the subscription call

classmethod write_to_niagara_data_channel(world_context_object, channel, search_params, count, visible_to_game, visible_to_cpu, visible_to_gpu, debug_source) NiagaraDataChannelWriter

LEGACY FUNCTION: Please use non-legacy version. Initializes and returns the Niagara Data Channel writer to write N elements to the given data channel. This function is now legacy and and will soon be deprecated. Please use the new non-legacy function.

Parameters:
  • world_context_object (Object) – World to execute in

  • channel (NiagaraDataChannelAsset) – The channel to write to

  • search_params (NiagaraDataChannelSearchParameters) – Parameters used when retrieving a specific set of Data Channel Data to read or write like the islands data channel type.

  • count (int32) – The number of elements to write

  • visible_to_game (bool) – If true, the data written to this data channel is visible to Blueprint and C++ logic reading from it

  • visible_to_cpu (bool) – If true, the data written to this data channel is visible to Niagara CPU emitters

  • visible_to_gpu (bool) – If true, the data written to this data channel is visible to Niagara GPU emitters

  • debug_source (str) – Instigator for this write, used in the debug hud to track writes to the data channel from different sources

Return type:

NiagaraDataChannelWriter