unreal.OSCManager

class unreal.OSCManager(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

C++ Source:

  • Plugin: OSC

  • Module: OSC

  • File: OSCManager.h

classmethod add_address(message, value) -> (OSCMessage, message=OSCMessage)

Adds address (packed as string) value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage

classmethod add_blob(message, value) -> (OSCMessage, message=OSCMessage)

Adds blob value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage

classmethod add_bool(message, value) -> (OSCMessage, message=OSCMessage)

Adds boolean value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage

classmethod add_bundle_to_bundle(bundle, out_bundle) -> (OSCBundle, out_bundle=OSCBundle)

Adds bundle packet to bundle.

Parameters
Returns

out_bundle (OSCBundle):

Return type

OSCBundle

classmethod add_float(message, value) -> (OSCMessage, message=OSCMessage)

Adds float value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage

classmethod add_int32(message, value) -> (OSCMessage, message=OSCMessage)

Adds Int32 value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage

classmethod add_int64(message, value) -> (OSCMessage, message=OSCMessage)

Adds Int64 value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage

classmethod add_message_to_bundle(message, bundle) -> (OSCBundle, bundle=OSCBundle)

Adds provided message packet to bundle.

Parameters
Returns

bundle (OSCBundle):

Return type

OSCBundle

classmethod add_string(message, value) -> (OSCMessage, message=OSCMessage, value=str)

Adds string value to end of OSCMessage

Parameters
Returns

message (OSCMessage):

value (str):

Return type

tuple

classmethod clear_bundle(bundle) -> (OSCBundle, bundle=OSCBundle)

Clears provided bundle of all internal messages/bundle packets.

Parameters

bundle (OSCBundle) –

Returns

bundle (OSCBundle):

Return type

OSCBundle

classmethod clear_message(message) -> (OSCMessage, message=OSCMessage)

Clears provided message of all arguments.

Parameters

message (OSCMessage) –

Returns

message (OSCMessage):

Return type

OSCMessage

classmethod clear_osc_address_containers(address) -> (OSCAddress, address=OSCAddress)

Clears containers of OSC Address provided

Parameters

address (OSCAddress) –

Returns

address (OSCAddress):

Return type

OSCAddress

classmethod convert_string_to_osc_address(string) OSCAddress

Converts string to OSC Address

Parameters

string (str) –

Return type

OSCAddress

classmethod create_osc_client(send_ip_address, port, client_name, outer=None) OSCClient

Creates an OSC Client. If SendIPAddress left empty (or ‘0’), attempts to use attempts to use LocalHost IP address.

Parameters
  • send_ip_address (str) –

  • port (int32) –

  • client_name (str) –

  • outer (Object) –

Return type

OSCClient

classmethod create_osc_server(receive_ip_address, port, multicast_loopback, start_listening, server_name, outer=None) OSCServer

Creates an OSC Server. If ReceiveIPAddress left empty (or ‘0’), attempts to use LocalHost IP address. If StartListening set, immediately begins listening on creation.

Parameters
  • receive_ip_address (str) –

  • port (int32) –

  • multicast_loopback (bool) –

  • start_listening (bool) –

  • server_name (str) –

  • outer (Object) –

Return type

OSCServer

classmethod find_object_at_osc_address(address) Object

Finds an object with the given OSC Address in path form, where containers correspond to path folders and the the address method to the object’s name. Only supports parent objects.

Parameters

address (OSCAddress) –

Return type

Object

classmethod get_address(message, index) OSCAddress or None

Sets Value to address at provided Index in OSCMessage if in bounds and OSC type matches ‘String’ (Does NOT return address of message, rather string packed in message and casts to OSC address). Returns if string found at index and is valid OSC address path.

Parameters
Returns

value (OSCAddress):

Return type

OSCAddress or None

classmethod get_all_addresses(message)

Returns all strings that are valid address paths in order received from OSCMessage (Does NOT include address of message, just strings packed in message that are valid paths).

Parameters

message (OSCMessage) –

Returns

values (Array(OSCAddress)):

Return type

Array(OSCAddress)

classmethod get_all_bools(message)

Returns all boolean values in order of received from OSCMessage

Parameters

message (OSCMessage) –

Returns

values (Array(bool)):

Return type

Array(bool)

classmethod get_all_floats(message)

Returns all float values in order of received from OSCMessage

Parameters

message (OSCMessage) –

Returns

values (Array(float)):

Return type

Array(float)

classmethod get_all_int32s(message)

Returns all integer values in order of received from OSCMessage

Parameters

message (OSCMessage) –

Returns

values (Array(int32)):

Return type

Array(int32)

classmethod get_all_int64s(message)

Returns all Int64 values in order of received from OSCMessage

Parameters

message (OSCMessage) –

Returns

values (Array(int64)):

Return type

Array(int64)

classmethod get_all_strings(message)

Returns all string values in order of received from OSCMessage

Parameters

message (OSCMessage) –

Returns

values (Array(str)):

Return type

Array(str)

classmethod get_blob(message, index) Array(uint8) or None

Sets Value to blob at provided Index from OSCMessage if in bounds and type matches

Parameters
Returns

value (Array(uint8)):

Return type

Array(uint8) or None

classmethod get_bool(message, index) bool or None

Sets Value to boolean at provided Index from OSCMessage if in bounds and type matches

Parameters
Returns

value (bool):

Return type

bool or None

classmethod get_bundles_from_bundle(bundle)

Fills array with child bundles found in bundle.

Parameters

bundle (OSCBundle) –

Return type

Array(OSCBundle)

classmethod get_float(message, index) float or None

Set Value to float at provided Index in OSCMessage if in bounds and type matches

Parameters
Returns

value (float):

Return type

float or None

classmethod get_int32(message, index) int32 or None

Set Value to integer at provided Index in OSCMessage if in bounds and type matches

Parameters
Returns

value (int32):

Return type

int32 or None

classmethod get_int64(message, index) int64 or None

Set Value to Int64 at provided Index in OSCMessage if in bounds and type matches

Parameters
Returns

value (int64):

Return type

int64 or None

classmethod get_message_from_bundle(bundle, index) -> (OSCMessage, succeeded=bool)

Returns message found in bundle at ordered index.

Parameters
Returns

succeeded (bool):

Return type

bool

classmethod get_messages_from_bundle(bundle)

Fills array with messages found in bundle.

Parameters

bundle (OSCBundle) –

Return type

Array(OSCMessage)

classmethod get_osc_address_container(address, index) str

Returns the OSC Address container at the provided ‘Index.’ Returns empty string if index is out-of-bounds.

Parameters
Return type

str

classmethod get_osc_address_container_path(address) str

Returns full path of OSC address in the form ‘/Container1/Container2/Method’

Parameters

address (OSCAddress) –

Return type

str

classmethod get_osc_address_containers(address)

Builds referenced array of address of containers in order

Parameters

address (OSCAddress) –

Return type

Array(str)

classmethod get_osc_address_full_path(address) str

Returns full path of OSC address in the form ‘/Container1/Container2’

Parameters

address (OSCAddress) –

Return type

str

classmethod get_osc_address_method(address) str

Returns method name of OSC Address provided

Parameters

address (OSCAddress) –

Return type

str

classmethod get_osc_message_address(message) OSCAddress

Returns copy of message’s OSC Address

Parameters

message (OSCMessage) –

Return type

OSCAddress

classmethod get_string(message, index) str or None

Set Value to string at provided Index in OSCMessage if in bounds and type matches

Parameters
Returns

value (str):

Return type

str or None

classmethod object_path_from_osc_address(address) str

Converts OSC Address to an object path.

Parameters

address (OSCAddress) –

Return type

str

classmethod osc_address_from_object_path(object) OSCAddress

Converts object path to OSC Address, converting folders to address containers and the object’s name to the address method. Only supports parent objects (See UObjectBaseUtility::GetPathName and UObjectBaseUtility::GetFullName).

Parameters

object (Object) –

Return type

OSCAddress

classmethod osc_address_from_object_path_string(path_name) OSCAddress

Converts object path string to OSC Address, converting folders to address containers and the object’s name to the address method. Only supports parent objects (See UObjectBaseUtility::GetPathName and UObjectBaseUtility::GetFullName).

Parameters

path_name (str) –

Return type

OSCAddress

classmethod osc_address_is_valid_path(address) bool

Returns whether OSC Address is valid path

Parameters

address (OSCAddress) –

Return type

bool

classmethod osc_address_is_valid_pattern(address) bool

Returns whether OSC Address is valid pattern to match against

Parameters

address (OSCAddress) –

Return type

bool

classmethod osc_address_path_matches_pattern(pattern, path) bool

Returns if address pattern matches the provided address path. If passed address is not a valid path, returns false.

Parameters
Return type

bool

classmethod osc_address_pop_container(address) -> (str, address=OSCAddress)

Pops container from ordered array of containers. If no containers, returns empty string

Parameters

address (OSCAddress) –

Returns

address (OSCAddress):

Return type

OSCAddress

classmethod osc_address_pop_containers(address, num_containers) -> (Array(str), address=OSCAddress)

Pops container from ordered array of containers. If NumContainers is greater than or equal to the number of containers in address, returns all containers.

Parameters
  • address (OSCAddress) –

  • num_containers (int32) –

Returns

address (OSCAddress):

Return type

OSCAddress

classmethod osc_address_push_container(address, container) -> (OSCAddress, address=OSCAddress)

Pushes container onto address’ ordered array of containers

Parameters
Returns

address (OSCAddress):

Return type

OSCAddress

classmethod osc_address_push_containers(address, containers) -> (OSCAddress, address=OSCAddress)

Pushes container onto address’ ordered array of containers

Parameters
Returns

address (OSCAddress):

Return type

OSCAddress

classmethod osc_address_remove_containers(address, index, count) -> (OSCAddress, address=OSCAddress)

Remove containers from ordered array of containers at index up to count of containers.

Parameters
  • address (OSCAddress) –

  • index (int32) –

  • count (int32) –

Returns

address (OSCAddress):

Return type

OSCAddress

classmethod set_osc_address_method(address, method) -> (OSCAddress, address=OSCAddress)

Sets the method name of the OSC Address provided

Parameters
Returns

address (OSCAddress):

Return type

OSCAddress

classmethod set_osc_message_address(message, address) -> (OSCMessage, message=OSCMessage)

Sets the OSC Address of the provided message

Parameters
Returns

message (OSCMessage):

Return type

OSCMessage