unreal.MagicLeapHandTrackingFunctionLibrary

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

Bases: unreal.BlueprintFunctionLibrary

Magic Leap Hand Tracking Function Library

C++ Source:

  • Plugin: MagicLeap
  • Module: MagicLeapHandTracking
  • File: MagicLeapHandTrackingFunctionLibrary.h
classmethod get_configuration() → (active_static_gestures=Array(HandTrackingGesture), keypoints_filter_level=HandTrackingKeypointFilterLevel, gesture_filter_level=HandTrackingGestureFilterLevel, hand_switching_filter_level=HandTrackingGestureFilterLevel, tracking_enabled=bool) or None

Gets the list of static and dynamic gestures currently set to be identified by the gesture recognition system.

Returns:true if the output params were populated with a valid value, false otherwise.

active_static_gestures (Array(HandTrackingGesture)):

keypoints_filter_level (HandTrackingKeypointFilterLevel): Filtering for the keypoints and hand centers.

gesture_filter_level (HandTrackingGestureFilterLevel): Filtering for the static gesture recognition.

hand_switching_filter_level (HandTrackingGestureFilterLevel): Filtering for if the left or right hand is present.

tracking_enabled (bool):

Return type:tuple or None
classmethod get_current_gesture(hand) → HandTrackingGesture or None

The current gesture being performed by the given hand.

Parameters:hand (ControllerHand) – Hand to query the gesture for. Only Left and Right hand are supported.
Returns:true if the output param was populated with a valid value, false otherwise.

gesture (HandTrackingGesture): Output parameter containing the given hand’s gesture, or NoHand if there isn’t one or the system isnt working now.

Return type:HandTrackingGesture or None
classmethod get_current_gesture_confidence(hand) → float or None

The confidence level of the current gesture being performed by the given hand. Value is between [0, 1], 0 is low, 1 is high degree of confidence. For a NoHand, the confidence is always set to 1.

Parameters:hand (ControllerHand) – Hand to query the gesture confidence value for. Only Left and Right hand are supported.
Returns:true if the output param was populated with a valid value, false otherwise.

confidence (float): Output parameter containing the confidence value for the given hand’s gesture.

Return type:float or None
classmethod get_gesture_keypoint_transform(hand, keypoint, transform_space) → Transform or None

Get Transform for a point on the hand.

Parameters:
Returns:

true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.

transform (Transform): Output parameter to write the data to.

Return type:

Transform or None

classmethod get_gesture_keypoints(hand) → Array(Transform) or None

List of keypoints detected on the given hand.

Note that this returns a transform in the Tracking space. To get the transform in Unreal’s world space, use the MotioController component as a child of the XRPawn with hand set to the following. Special_3 - Left Index Finger Tip Special_5 - Left Thumb Tip Special_4 - Right Index Finger Tip Special_6 - Right Thumb Tip deprecated: GetGestureKeypoints is deprecated. Please use GetGestureKeypointTransform instead.

Parameters:hand (ControllerHand) – Hand to query the keypoints for. Only Left and Right hand are supported.
Returns:true if the output param was populated with a valid value, false otherwise.

keypoints (Array(Transform)): Output parameter containing transforms of the keypoints detected on the given hand.

Return type:Array(Transform) or None
classmethod get_hand_center(hand) → Transform or None

Transform of the center of the hand. Approximately the center of the palm.

Note that this returns a transform in world space. deprecated: GetHandCenter is deprecated. Please use GetGestureKeypointTransform instead.

Parameters:hand (ControllerHand) – Hand to query the hand center transform for. Only Left and Right hand are supported.
Returns:true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.

hand_center (Transform): Output parameter containing the position and orientation of the given hand.

Return type:Transform or None
classmethod get_hand_center_normalized(hand) → Vector or None

Normalized position of the center of the given hand. This can be used to detect and warn the users that the hand is out of the gesture detection frame.

Parameters:hand (ControllerHand) – Hand to query the normalized hand center position for. Only Left and Right hand are supported.
Returns:true if the output param was populated with a valid value, false otherwise.

hand_center_normalized (Vector): Output paramter containing the normalized position of the given hand.

Return type:Vector or None
classmethod get_hand_gesture_confidence(hand)

deprecated: ‘get_hand_gesture_confidence’ was renamed to ‘get_current_gesture_confidence’.

classmethod get_hand_index_finger_tip(hand, transform_space) → Transform or None

Transform of the Index Finger Tip. deprecated: GetHandIndexFingerTip is deprecated. Please use GetGestureKeypointTransform instead.

Parameters:
  • hand (ControllerHand) – Hand to query the hand center transform for. Only Left and Right hand are supported.
  • transform_space (GestureTransformSpace) – Get the transform relative to the world, hand center, or tracking space.
Returns:

true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.

pointer (Transform): Output parameter containing the position and orientation.

Return type:

Transform or None

classmethod get_hand_pointer(hand, transform_space)

deprecated: ‘get_hand_pointer’ was renamed to ‘get_hand_index_finger_tip’.

classmethod get_hand_secondary(hand, transform_space)

deprecated: ‘get_hand_secondary’ was renamed to ‘get_hand_thumb_tip’.

classmethod get_hand_thumb_tip(hand, transform_space) → Transform or None

Transform of Thumb Tip.

Note that this returns a transform in the Tracking space. To get the transform in Unreal’s world space, use the MotioController component as a child of the XRPawn with hand set to EControllerHand::Special_5 for the left hand secondary and EControllerHand::Special_6 for the right hand secondary. deprecated: GetHandThumbTip is deprecated. Please use GetGestureKeypointTransform instead.

Parameters:
  • hand (ControllerHand) – Hand to query the hand center transform for. Only Left and Right hand are supported.
  • transform_space (GestureTransformSpace) – Get the transform relative to the world, hand center, or tracking space.
Returns:

true if the output param was populated with a valid value, false means that is is either unchanged or populated with a stale value.

secondary (Transform): Output parameter containing the position and orientation.

Return type:

Transform or None

Get a LiveLinkSourceHandle for magic leap hand tracking.

Returns:true if a LiveLink Source was assigned.

source_handle (LiveLinkSourceHandle): Output parameter SourceHandle that will be filled in.

Return type:LiveLinkSourceHandle or None
classmethod get_static_gesture_confidence_threshold(gesture) → float

Gets the minimum gesture confidence used to filter out the detected static gesture.

Parameters:gesture (HandTrackingGesture) – The gesture to get the confidence threshold for.
Returns:The gesture confidence threshold.
Return type:float
classmethod set_configuration(static_gestures_to_activate, keypoints_filter_level=HandTrackingKeypointFilterLevel.NO_FILTER, gesture_filter_level=HandTrackingGestureFilterLevel.NO_FILTER, hand_switching_filter_level=HandTrackingGestureFilterLevel.NO_FILTER, tracking_enabled=True) → bool

Enables and disables the gestures to be detected by the gesture recognition system.

Parameters:
Returns:

true if the configuration was set successfully.

Return type:

bool

classmethod set_static_gesture_confidence_threshold(gesture, confidence) → None

Sets the minimum gesture confidence to filter out the detected static gesture.

Parameters:
  • gesture (HandTrackingGesture) – The gesture to set the confidence threshold for.
  • confidence (float) – The gesture confidence threshold.