unreal.NiagaraDataChannelLibrary¶
- class unreal.NiagaraDataChannelLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryA C++ and Blueprint accessible library of utility functions for accessing Niagara DataChannel
C++ Source:
Plugin: Niagara
Module: Niagara
File: NiagaraDataChannel.h
- classmethod get_data_channel_element_count(world_context_object, channel, search_params, read_previous_frame=True) int32¶
Returns the number of readable elements in the given data channel
- 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¶
Initializes and returns the Niagara Data Channel reader for the given data channel.
- 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:
- classmethod subscribe_to_niagara_data_channel(world_context_object, channel, search_params, update_delegate) 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
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 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¶
Initializes and returns the Niagara Data Channel writer to write N elements to the given data channel.
- 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: