30 # ifdef WITH_XR_OPENXR
51 # ifdef WITH_XR_OPENXR
55 return component_path;
64 # ifdef WITH_XR_OPENXR
78 # ifdef WITH_XR_OPENXR
88 bool replace_existing)
90 # ifdef WITH_XR_OPENXR
101 # ifdef WITH_XR_OPENXR
113 # ifdef WITH_XR_OPENXR
118 "ActionMapBinding '%s' cannot be removed from '%s'",
131 # ifdef WITH_XR_OPENXR
142 # ifdef WITH_XR_OPENXR
150 static int rna_XrActionMapBinding_component_paths_length(
PointerRNA *
ptr)
152 # ifdef WITH_XR_OPENXR
161 static int rna_XrActionMapBinding_axis0_region_get(
PointerRNA *
ptr)
163 # ifdef WITH_XR_OPENXR
177 static void rna_XrActionMapBinding_axis0_region_set(
PointerRNA *
ptr,
int value)
179 # ifdef WITH_XR_OPENXR
188 static int rna_XrActionMapBinding_axis1_region_get(
PointerRNA *
ptr)
190 # ifdef WITH_XR_OPENXR
204 static void rna_XrActionMapBinding_axis1_region_set(
PointerRNA *
ptr,
int value)
206 # ifdef WITH_XR_OPENXR
217 # ifdef WITH_XR_OPENXR
238 # ifdef WITH_XR_OPENXR
251 # ifdef WITH_XR_OPENXR
265 # ifdef WITH_XR_OPENXR
275 bool replace_existing)
277 # ifdef WITH_XR_OPENXR
288 # ifdef WITH_XR_OPENXR
298 # ifdef WITH_XR_OPENXR
302 reports,
RPT_ERROR,
"ActionMapItem '%s' cannot be removed from '%s'", ami->
name, am->
name);
313 # ifdef WITH_XR_OPENXR
323 # ifdef WITH_XR_OPENXR
331 static int rna_XrActionMapItem_user_paths_length(
PointerRNA *
ptr)
333 # ifdef WITH_XR_OPENXR
342 static void rna_XrActionMapItem_op_name_get(
PointerRNA *
ptr,
char *value)
344 # ifdef WITH_XR_OPENXR
354 strcpy(value, ami->
op);
363 static int rna_XrActionMapItem_op_name_length(
PointerRNA *
ptr)
365 # ifdef WITH_XR_OPENXR
374 return strlen(ami->
op);
384 # ifdef WITH_XR_OPENXR
395 static bool rna_XrActionMapItem_bimanual_get(
PointerRNA *
ptr)
397 # ifdef WITH_XR_OPENXR
408 static void rna_XrActionMapItem_bimanual_set(
PointerRNA *
ptr,
bool value)
410 # ifdef WITH_XR_OPENXR
418 static bool rna_XrActionMapItem_haptic_match_user_paths_get(
PointerRNA *
ptr)
420 # ifdef WITH_XR_OPENXR
431 static void rna_XrActionMapItem_haptic_match_user_paths_set(
PointerRNA *
ptr,
bool value)
433 # ifdef WITH_XR_OPENXR
441 static int rna_XrActionMapItem_haptic_mode_get(
PointerRNA *
ptr)
443 # ifdef WITH_XR_OPENXR
458 static void rna_XrActionMapItem_haptic_mode_set(
PointerRNA *
ptr,
int value)
460 # ifdef WITH_XR_OPENXR
469 static bool rna_XrActionMapItem_pose_is_controller_grip_get(
PointerRNA *
ptr)
471 # ifdef WITH_XR_OPENXR
482 static void rna_XrActionMapItem_pose_is_controller_grip_set(
PointerRNA *
ptr,
bool value)
484 # ifdef WITH_XR_OPENXR
492 static bool rna_XrActionMapItem_pose_is_controller_aim_get(
PointerRNA *
ptr)
494 # ifdef WITH_XR_OPENXR
505 static void rna_XrActionMapItem_pose_is_controller_aim_set(
PointerRNA *
ptr,
bool value)
507 # ifdef WITH_XR_OPENXR
517 # ifdef WITH_XR_OPENXR
525 static int rna_XrActionMapItem_bindings_length(
PointerRNA *
ptr)
527 # ifdef WITH_XR_OPENXR
538 # ifdef WITH_XR_OPENXR
556 # ifdef WITH_XR_OPENXR
566 # ifdef WITH_XR_OPENXR
577 # ifdef WITH_XR_OPENXR
588 # ifdef WITH_XR_OPENXR
603 # ifdef WITH_XR_OPENXR
614 # ifdef WITH_XR_OPENXR
624 # ifdef WITH_XR_OPENXR
635 # ifdef WITH_XR_OPENXR
652 static bool rna_XrSessionSettings_use_positional_tracking_get(
PointerRNA *
ptr)
654 # ifdef WITH_XR_OPENXR
655 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
663 static void rna_XrSessionSettings_use_positional_tracking_set(
PointerRNA *
ptr,
bool value)
665 # ifdef WITH_XR_OPENXR
673 static bool rna_XrSessionSettings_use_absolute_tracking_get(
PointerRNA *
ptr)
675 # ifdef WITH_XR_OPENXR
676 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
684 static void rna_XrSessionSettings_use_absolute_tracking_set(
PointerRNA *
ptr,
bool value)
686 # ifdef WITH_XR_OPENXR
694 static int rna_XrSessionSettings_icon_from_show_object_viewport_get(
PointerRNA *
ptr)
696 # ifdef WITH_XR_OPENXR
697 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
719 static bool rna_XrSessionState_is_running(
bContext *
C)
721 # ifdef WITH_XR_OPENXR
730 static void rna_XrSessionState_reset_to_base_pose(
bContext *
C)
732 # ifdef WITH_XR_OPENXR
742 # ifdef WITH_XR_OPENXR
751 static bool rna_XrSessionState_action_create(
bContext *
C,
755 # ifdef WITH_XR_OPENXR
767 if (is_button_action) {
788 is_button_action ? &haptic_duration_msec :
NULL,
800 static bool rna_XrSessionState_action_binding_create(
bContext *
C,
805 # ifdef WITH_XR_OPENXR
809 if (count_user_paths < 1 || (count_user_paths != count_component_paths)) {
816 float float_thresholds[2];
820 if (is_float_action) {
823 if (is_button_action) {
824 axis_flags[0] = axis_flags[1] = amb->
axis_flag;
826 if (is_pose_action) {
830 memcpy(&poses[1], &poses[0],
sizeof(poses[1]));
839 is_float_action ? float_thresholds :
NULL,
840 is_button_action ? axis_flags :
NULL,
841 is_pose_action ? poses :
NULL);
848 bool rna_XrSessionState_active_action_set_set(
bContext *
C,
const char *action_set_name)
850 # ifdef WITH_XR_OPENXR
859 bool rna_XrSessionState_controller_pose_actions_set(
bContext *
C,
860 const char *action_set_name,
861 const char *grip_action_name,
862 const char *aim_action_name)
864 # ifdef WITH_XR_OPENXR
867 &wm->
xr, action_set_name, grip_action_name, aim_action_name);
869 UNUSED_VARS(
C, action_set_name, grip_action_name, aim_action_name);
874 void rna_XrSessionState_action_state_get(
bContext *
C,
875 const char *action_set_name,
876 const char *action_name,
877 const char *user_path,
880 # ifdef WITH_XR_OPENXR
882 wmXrActionState
state;
884 switch (
state.type) {
890 r_state[0] =
state.state_float;
903 UNUSED_VARS(
C, action_set_name, action_name, user_path);
908 bool rna_XrSessionState_haptic_action_apply(
bContext *
C,
909 const char *action_set_name,
910 const char *action_name,
911 const char *user_path,
916 # ifdef WITH_XR_OPENXR
922 user_path[0] ? user_path :
NULL,
927 UNUSED_VARS(
C, action_set_name, action_name, user_path, duration, frequency, amplitude);
932 void rna_XrSessionState_haptic_action_stop(
bContext *
C,
933 const char *action_set_name,
934 const char *action_name,
935 const char *user_path)
937 # ifdef WITH_XR_OPENXR
941 UNUSED_VARS(
C, action_set_name, action_name, user_path);
945 static void rna_XrSessionState_controller_grip_location_get(
bContext *
C,
949 # ifdef WITH_XR_OPENXR
958 static void rna_XrSessionState_controller_grip_rotation_get(
bContext *
C,
962 # ifdef WITH_XR_OPENXR
971 static void rna_XrSessionState_controller_aim_location_get(
bContext *
C,
975 # ifdef WITH_XR_OPENXR
984 static void rna_XrSessionState_controller_aim_rotation_get(
bContext *
C,
988 # ifdef WITH_XR_OPENXR
997 static void rna_XrSessionState_viewer_pose_location_get(
PointerRNA *
ptr,
float *r_values)
999 # ifdef WITH_XR_OPENXR
1000 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1008 static void rna_XrSessionState_viewer_pose_rotation_get(
PointerRNA *
ptr,
float *r_values)
1010 # ifdef WITH_XR_OPENXR
1011 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1019 static void rna_XrSessionState_nav_location_get(
PointerRNA *
ptr,
float *r_values)
1021 # ifdef WITH_XR_OPENXR
1022 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1030 static void rna_XrSessionState_nav_location_set(
PointerRNA *
ptr,
const float *values)
1032 # ifdef WITH_XR_OPENXR
1040 static void rna_XrSessionState_nav_rotation_get(
PointerRNA *
ptr,
float *r_values)
1042 # ifdef WITH_XR_OPENXR
1043 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1051 static void rna_XrSessionState_nav_rotation_set(
PointerRNA *
ptr,
const float *values)
1053 # ifdef WITH_XR_OPENXR
1061 static float rna_XrSessionState_nav_scale_get(
PointerRNA *
ptr)
1064 # ifdef WITH_XR_OPENXR
1065 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1074 static void rna_XrSessionState_nav_scale_set(
PointerRNA *
ptr,
float value)
1076 # ifdef WITH_XR_OPENXR
1086 # ifdef WITH_XR_OPENXR
1095 static int rna_XrSessionState_actionmaps_length(
PointerRNA *
ptr)
1097 # ifdef WITH_XR_OPENXR
1107 static int rna_XrSessionState_active_actionmap_get(
PointerRNA *
ptr)
1109 # ifdef WITH_XR_OPENXR
1110 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1118 static void rna_XrSessionState_active_actionmap_set(
PointerRNA *
ptr,
int value)
1120 # ifdef WITH_XR_OPENXR
1128 static int rna_XrSessionState_selected_actionmap_get(
PointerRNA *
ptr)
1130 # ifdef WITH_XR_OPENXR
1131 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1139 static void rna_XrSessionState_selected_actionmap_set(
PointerRNA *
ptr,
int value)
1141 # ifdef WITH_XR_OPENXR
1155 static void rna_XrEventData_action_set_get(
PointerRNA *
ptr,
char *r_value)
1157 # ifdef WITH_XR_OPENXR
1159 strcpy(r_value,
data->action_set);
1166 static int rna_XrEventData_action_set_length(
PointerRNA *
ptr)
1168 # ifdef WITH_XR_OPENXR
1170 return strlen(
data->action_set);
1177 static void rna_XrEventData_action_get(
PointerRNA *
ptr,
char *r_value)
1179 # ifdef WITH_XR_OPENXR
1181 strcpy(r_value,
data->action);
1190 # ifdef WITH_XR_OPENXR
1192 return strlen(
data->action);
1199 static void rna_XrEventData_user_path_get(
PointerRNA *
ptr,
char *r_value)
1201 # ifdef WITH_XR_OPENXR
1203 strcpy(r_value,
data->user_path);
1210 static int rna_XrEventData_user_path_length(
PointerRNA *
ptr)
1212 # ifdef WITH_XR_OPENXR
1214 return strlen(
data->user_path);
1221 static void rna_XrEventData_user_path_other_get(
PointerRNA *
ptr,
char *r_value)
1223 # ifdef WITH_XR_OPENXR
1225 strcpy(r_value,
data->user_path_other);
1232 static int rna_XrEventData_user_path_other_length(
PointerRNA *
ptr)
1234 # ifdef WITH_XR_OPENXR
1236 return strlen(
data->user_path_other);
1245 # ifdef WITH_XR_OPENXR
1254 static void rna_XrEventData_state_get(
PointerRNA *
ptr,
float r_values[2])
1256 # ifdef WITH_XR_OPENXR
1265 static void rna_XrEventData_state_other_get(
PointerRNA *
ptr,
float r_values[2])
1267 # ifdef WITH_XR_OPENXR
1276 static float rna_XrEventData_float_threshold_get(
PointerRNA *
ptr)
1278 # ifdef WITH_XR_OPENXR
1280 return data->float_threshold;
1287 static void rna_XrEventData_controller_location_get(
PointerRNA *
ptr,
float r_values[3])
1289 # ifdef WITH_XR_OPENXR
1298 static void rna_XrEventData_controller_rotation_get(
PointerRNA *
ptr,
float r_values[4])
1300 # ifdef WITH_XR_OPENXR
1309 static void rna_XrEventData_controller_location_other_get(
PointerRNA *
ptr,
float r_values[3])
1311 # ifdef WITH_XR_OPENXR
1320 static void rna_XrEventData_controller_rotation_other_get(
PointerRNA *
ptr,
float r_values[4])
1322 # ifdef WITH_XR_OPENXR
1333 # ifdef WITH_XR_OPENXR
1335 return data->bimanual;
1353 "Float action, representing either a digital or analog button"},
1358 "2D float vector action, representing a thumbstick or trackpad"},
1363 "3D pose action, representing a controller's location and rotation"},
1368 "Haptic vibration output action, to be applied with a duration, frequency, and amplitude"},
1377 "Execute operator on button press (non-modal operators only)"},
1382 "Execute operator on button release (non-modal operators only)"},
1383 {
XR_OP_MODAL,
"MODAL", 0,
"Modal",
"Use modal execution (modal operators only)"},
1388 {
XR_HAPTIC_PRESS,
"PRESS", 0,
"Press",
"Apply haptics on button press"},
1389 {
XR_HAPTIC_RELEASE,
"RELEASE", 0,
"Release",
"Apply haptics on button release"},
1394 "Apply haptics on button press and release"},
1399 "Apply haptics repeatedly for the duration of the button press"},
1404 {0,
"ANY", 0,
"Any",
"Use any axis region for operator execution"},
1409 "Use positive axis region only for operator execution"},
1414 "Use negative axis region only for operator execution"},
1419 {0,
"ANY", 0,
"Any",
"Use any axis region for operator execution"},
1424 "Use positive axis region only for operator execution"},
1429 "Use negative axis region only for operator execution"},
1453 func,
"component_path",
"XrComponentPath",
"Component Path",
"Added component path");
1457 parm =
RNA_def_pointer(func,
"component_path",
"XrComponentPath",
"Component Path",
"");
1469 "The component path with the given path");
1491 "Replace any existing binding with the same name");
1494 func,
"binding",
"XrActionMapBinding",
"Binding",
"Added action map binding");
1497 func =
RNA_def_function(srna,
"new_from_binding",
"rna_XrActionMapBinding_new_from_binding");
1499 func,
"binding",
"XrActionMapBinding",
"Binding",
"Binding to use as a reference");
1502 func,
"result",
"XrActionMapBinding",
"Binding",
"Added action map binding");
1507 parm =
RNA_def_pointer(func,
"binding",
"XrActionMapBinding",
"Binding",
"");
1516 "XrActionMapBinding",
1518 "The action map binding with the given name");
1536 parm =
RNA_def_pointer(func,
"user_path",
"XrUserPath",
"User Path",
"Added user path");
1540 parm =
RNA_def_pointer(func,
"user_path",
"XrUserPath",
"User Path",
"");
1548 func,
"user_path",
"XrUserPath",
"User Path",
"The user path with the given path");
1570 "Replace any existing item with the same name");
1572 parm =
RNA_def_pointer(func,
"item",
"XrActionMapItem",
"Item",
"Added action map item");
1575 func =
RNA_def_function(srna,
"new_from_item",
"rna_XrActionMapItem_new_from_item");
1576 parm =
RNA_def_pointer(func,
"item",
"XrActionMapItem",
"Item",
"Item to use as a reference");
1578 parm =
RNA_def_pointer(func,
"result",
"XrActionMapItem",
"Item",
"Added action map item");
1591 func,
"item",
"XrActionMapItem",
"Item",
"The action map item with the given name");
1607 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1615 "Replace any existing actionmap with the same name");
1617 parm =
RNA_def_pointer(func,
"actionmap",
"XrActionMap",
"Action Map",
"Added action map");
1620 func =
RNA_def_function(srna,
"new_from_actionmap",
"rna_XrActionMap_new_from_actionmap");
1622 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1625 func,
"actionmap",
"XrActionMap",
"Action Map",
"Action map to use as a reference");
1627 parm =
RNA_def_pointer(func,
"result",
"XrActionMap",
"Action Map",
"Added action map");
1632 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1634 parm =
RNA_def_pointer(func,
"actionmap",
"XrActionMap",
"Action Map",
"Removed action map");
1640 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1645 func,
"actionmap",
"XrActionMap",
"Action Map",
"The action map with the given name");
1668 "rna_XrActionMap_items_begin",
1669 "rna_iterator_listbase_next",
1670 "rna_iterator_listbase_end",
1671 "rna_iterator_listbase_get",
1672 "rna_XrActionMap_items_length",
1679 "Items in the action map, mapping an XR event to an operator, pose, or haptic output");
1713 "rna_XrActionMapItem_user_paths_begin",
1714 "rna_iterator_listbase_next",
1715 "rna_iterator_listbase_end",
1716 "rna_iterator_listbase_get",
1717 "rna_XrActionMapItem_user_paths_length",
1732 prop,
"Operator Name",
"Name of operator (translated) to call on action event");
1734 prop,
"rna_XrActionMapItem_op_name_get",
"rna_XrActionMapItem_op_name_length",
NULL);
1740 prop,
"Operator Properties",
"Properties to set when the operator is called");
1750 prop,
"rna_XrActionMapItem_bimanual_get",
"rna_XrActionMapItem_bimanual_set");
1752 prop,
"Bimanual",
"The action depends on the states/poses of both user paths");
1756 "rna_XrActionMapItem_pose_is_controller_grip_get",
1757 "rna_XrActionMapItem_pose_is_controller_grip_set");
1759 prop,
"Is Controller Grip",
"The action poses will be used for the VR controller grips");
1763 "rna_XrActionMapItem_pose_is_controller_aim_get",
1764 "rna_XrActionMapItem_pose_is_controller_aim_set");
1766 prop,
"Is Controller Aim",
"The action poses will be used for the VR controller aims");
1770 prop,
"Haptic Name",
"Name of the haptic action to apply when executing this action");
1774 "rna_XrActionMapItem_haptic_match_user_paths_get",
1775 "rna_XrActionMapItem_haptic_match_user_paths_set");
1778 "Haptic Match User Paths",
1779 "Apply haptics to the same user paths for the haptic action and this action");
1785 "Haptic duration in seconds. 0.0 is the minimum supported duration");
1791 "Frequency of the haptic vibration in hertz. 0.0 specifies the OpenXR "
1792 "runtime's default frequency");
1797 prop,
"Haptic Amplitude",
"Intensity of the haptic vibration, ranging from 0.0 to 1.0");
1802 prop,
"rna_XrActionMapItem_haptic_mode_get",
"rna_XrActionMapItem_haptic_mode_set",
NULL);
1808 "rna_XrActionMapItem_bindings_begin",
1809 "rna_iterator_listbase_next",
1810 "rna_iterator_listbase_end",
1811 "rna_iterator_listbase_get",
1812 "rna_XrActionMapItem_bindings_length",
1817 prop,
"Bindings",
"Bindings for the action map item, mapping the action to an XR input");
1850 "rna_XrActionMapBinding_component_paths_begin",
1851 "rna_iterator_listbase_next",
1852 "rna_iterator_listbase_end",
1853 "rna_iterator_listbase_get",
1854 "rna_XrActionMapBinding_component_paths_length",
1869 "rna_XrActionMapBinding_axis0_region_get",
1870 "rna_XrActionMapBinding_axis0_region_set",
1873 prop,
"Axis 0 Region",
"Action execution region for the first input axis");
1878 "rna_XrActionMapBinding_axis1_region_get",
1879 "rna_XrActionMapBinding_axis1_region_set",
1882 prop,
"Axis 1 Region",
"Action execution region for the second input axis");
1907 "Follow the active scene camera to define the VR view's base pose"},
1912 "Follow the transformation of an object to define the VR view's base pose"},
1917 "Follow a custom transformation to define the VR view's base pose"},
1928 "Draw dark controller with aiming axis ray"},
1933 "Draw light controller with aiming axis ray"},
1951 "Define where the location and rotation for the VR view come from, to which "
1952 "translation and rotation deltas from the VR headset will be applied to");
1959 "Object to take the location and rotation to which translation and "
1960 "rotation deltas from the VR headset will be applied to");
1965 "Base Pose Location",
1966 "Coordinates to apply translation deltas from the VR headset to");
1974 "Rotation angle around the Z-Axis to apply the rotation deltas from the VR headset to");
2002 prop,
"Show Controllers",
"Show VR controllers (requires VR actions for controller poses)");
2013 prop,
"Show Object Extras",
"Show object extras, including empties, lights, and cameras");
2020 prop,
"Controller Draw Style",
"Style to use when drawing VR controllers");
2037 "rna_XrSessionSettings_use_positional_tracking_get",
2038 "rna_XrSessionSettings_use_positional_tracking_set");
2041 "Positional Tracking",
2042 "Allow VR headsets to affect the location in virtual space, in addition to the rotation");
2047 "rna_XrSessionSettings_use_absolute_tracking_get",
2048 "rna_XrSessionSettings_use_absolute_tracking_set");
2051 "Absolute Tracking",
2052 "Allow the VR tracking origin to be defined independently of the headset location");
2060 prop,
"rna_XrSessionSettings_icon_from_show_object_viewport_get",
NULL,
NULL);
2081 func =
RNA_def_function(srna,
"is_running",
"rna_XrSessionState_is_running");
2089 func =
RNA_def_function(srna,
"reset_to_base_pose",
"rna_XrSessionState_reset_to_base_pose");
2095 func =
RNA_def_function(srna,
"action_set_create",
"rna_XrSessionState_action_set_create");
2105 func =
RNA_def_function(srna,
"action_create",
"rna_XrSessionState_action_create");
2112 parm =
RNA_def_pointer(func,
"actionmap_item",
"XrActionMapItem",
"",
"");
2118 srna,
"action_binding_create",
"rna_XrSessionState_action_binding_create");
2125 parm =
RNA_def_pointer(func,
"actionmap_item",
"XrActionMapItem",
"",
"");
2127 parm =
RNA_def_pointer(func,
"actionmap_binding",
"XrActionMapBinding",
"",
"");
2133 srna,
"active_action_set_set",
"rna_XrSessionState_active_action_set_set");
2144 srna,
"controller_pose_actions_set",
"rna_XrSessionState_controller_pose_actions_set");
2156 "Name of the action representing the controller grips");
2163 "Name of the action representing the controller aims");
2168 func =
RNA_def_function(srna,
"action_state_get",
"rna_XrSessionState_action_state_get");
2188 "Current state of the VR action. Second float value is only set for 2D vector type actions",
2193 func =
RNA_def_function(srna,
"haptic_action_apply",
"rna_XrSessionState_haptic_action_apply");
2208 "Optional OpenXR user path. If not set, the action will be applied to all paths");
2216 "Haptic duration in seconds. 0.0 is the minimum supported duration",
2226 "Frequency of the haptic vibration in hertz. 0.0 specifies the OpenXR "
2227 "runtime's default frequency",
2237 "Haptic amplitude, ranging from 0.0 to 1.0",
2244 func =
RNA_def_function(srna,
"haptic_action_stop",
"rna_XrSessionState_haptic_action_stop");
2259 "Optional OpenXR user path. If not set, the action will be stopped for all paths");
2263 srna,
"controller_grip_location_get",
"rna_XrSessionState_controller_grip_location_get");
2265 "Get the last known controller grip location in world space");
2269 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2278 "Controller grip location",
2284 srna,
"controller_grip_rotation_get",
"rna_XrSessionState_controller_grip_rotation_get");
2286 func,
"Get the last known controller grip rotation (quaternion) in world space");
2290 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2299 "Controller grip quaternion rotation",
2307 srna,
"controller_aim_location_get",
"rna_XrSessionState_controller_aim_location_get");
2309 "Get the last known controller aim location in world space");
2313 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2322 "Controller aim location",
2328 srna,
"controller_aim_rotation_get",
"rna_XrSessionState_controller_aim_rotation_get");
2330 func,
"Get the last known controller aim rotation (quaternion) in world space");
2334 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2343 "Controller aim quaternion rotation",
2356 "Viewer Pose Location",
2357 "Last known location of the viewer pose (center between the eyes) in world space");
2365 "Viewer Pose Rotation",
2366 "Last known rotation of the viewer pose (center between the eyes) in world space");
2371 prop,
"rna_XrSessionState_nav_location_get",
"rna_XrSessionState_nav_location_set",
NULL);
2374 "Navigation Location",
2375 "Location offset to apply to base pose when determining viewer location");
2380 prop,
"rna_XrSessionState_nav_rotation_get",
"rna_XrSessionState_nav_rotation_set",
NULL);
2383 "Navigation Rotation",
2384 "Rotation offset to apply to base pose when determining viewer rotation");
2388 prop,
"rna_XrSessionState_nav_scale_get",
"rna_XrSessionState_nav_scale_set",
NULL);
2392 "Additional scale multiplier to apply to base scale when determining viewer scale");
2397 "rna_XrSessionState_actionmaps_begin",
2398 "rna_iterator_listbase_next",
2399 "rna_iterator_listbase_end",
2400 "rna_iterator_listbase_get",
2401 "rna_XrSessionState_actionmaps_length",
2410 "rna_XrSessionState_active_actionmap_get",
2411 "rna_XrSessionState_active_actionmap_set",
2417 "rna_XrSessionState_selected_actionmap_get",
2418 "rna_XrSessionState_selected_actionmap_set",
2440 prop,
"rna_XrEventData_action_set_get",
"rna_XrEventData_action_set_length",
NULL);
2446 prop,
"rna_XrEventData_action_get",
"rna_XrEventData_action_length",
NULL);
2452 prop,
"rna_XrEventData_user_path_get",
"rna_XrEventData_user_path_length",
NULL);
2458 prop,
"rna_XrEventData_user_path_other_get",
"rna_XrEventData_user_path_other_length",
NULL);
2460 prop,
"User Path Other",
"Other user path, for bimanual actions. E.g. \"/user/hand/right\"");
2479 prop,
"State Other",
"State of the other user path for bimanual actions");
2491 "Controller Location",
2492 "Location of the action's corresponding controller aim in world space");
2499 "Controller Rotation",
2500 "Rotation of the action's corresponding controller aim in world space");
2507 "Controller Location Other",
2508 "Controller aim location of the other user path for bimanual actions");
2515 "Controller Rotation Other",
2516 "Controller aim rotation of the other user path for bimanual actions");
typedef float(TangentPoint)[2]
struct wmWindowManager * CTX_wm_manager(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert_unreachable()
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
float normalize_qt(float q[4])
void eul_to_quat(float quat[4], const float eul[3])
void copy_qt_qt(float q[4], const float a[4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v2(float r[2])
MINLINE void zero_v3(float r[3])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define SET_FLAG_FROM_TEST(value, test, flag)
@ V3D_OFSDRAW_SHOW_OBJECT_EXTRAS
@ V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_OFSDRAW_SHOW_GRIDFLOOR
@ V3D_OFSDRAW_SHOW_ANNOTATION
@ V3D_OFSDRAW_SHOW_SELECTION
@ V3D_OFSDRAW_XR_SHOW_CONTROLLERS
@ XR_SESSION_USE_ABSOLUTE_TRACKING
@ XR_SESSION_USE_POSITION_TRACKING
@ XR_CONTROLLER_DRAW_LIGHT_RAY
@ XR_CONTROLLER_DRAW_LIGHT
@ XR_CONTROLLER_DRAW_DARK_RAY
@ XR_CONTROLLER_DRAW_DARK
#define XR_MAX_USER_PATH_LENGTH
#define XR_MAX_COMPONENT_PATH_LENGTH
@ XR_BASE_POSE_SCENE_CAMERA
@ XR_HAPTIC_MATCHUSERPATHS
#define RNA_POINTER_INVALIDATE(ptr)
#define RNA_TRANSLATION_PREC_DEFAULT
#define ND_XR_DATA_CHANGED
void *(* MEM_callocN)(size_t len, const char *str)
const PointerRNA PointerRNA_NULL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_define_animate_sdna(bool animate)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_float_translation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void rna_def_object_type_visibility_flags_common(StructRNA *srna, int noteflag)
int rna_object_type_visibility_icon_get_common(int object_type_exclude_viewport, const int *object_type_exclude_select)
static void rna_def_xr_session_settings(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_xr_haptic_flags[]
static void rna_def_xr_actionmap_bindings(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_xr_session_state(BlenderRNA *brna)
static void rna_def_xr_user_paths(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem rna_enum_xr_axis0_flags[]
static const EnumPropertyItem rna_enum_xr_axis1_flags[]
static void rna_def_xr_component_paths(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_xr_actionmap(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_xr_action_types[]
static void rna_def_xr_actionmap_items(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem rna_enum_xr_op_flags[]
static void rna_def_xr_actionmaps(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_xr_eventdata(BlenderRNA *brna)
void RNA_def_xr(BlenderRNA *brna)
IDProperty * op_properties
struct PointerRNA * op_properties_ptr
int object_type_exclude_select
int object_type_exclude_viewport
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
const char * WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
size_t WM_operator_bl_idname(char *dst, const char *src)
bool WM_xr_action_state_get(const wmXrData *xr, const char *action_set_name, const char *action_name, const char *subaction_path, wmXrActionState *r_state)
bool WM_xr_action_binding_create(wmXrData *xr, const char *action_set_name, const char *action_name, const char *profile_path, const ListBase *user_paths, const ListBase *component_paths, const float *float_thresholds, const eXrAxisFlag *axis_flags, const struct wmXrPose *poses)
void WM_xr_haptic_action_stop(wmXrData *xr, const char *action_set_name, const char *action_name, const char *subaction_path)
bool WM_xr_action_set_create(wmXrData *xr, const char *action_set_name)
bool WM_xr_action_create(wmXrData *xr, const char *action_set_name, const char *action_name, eXrActionType type, const ListBase *user_paths, wmOperatorType *ot, IDProperty *op_properties, const char *haptic_name, const int64_t *haptic_duration, const float *haptic_frequency, const float *haptic_amplitude, eXrOpFlag op_flag, eXrActionFlag action_flag, eXrHapticFlag haptic_flag)
bool WM_xr_controller_pose_actions_set(wmXrData *xr, const char *action_set_name, const char *grip_action_name, const char *aim_action_name)
bool WM_xr_haptic_action_apply(wmXrData *xr, const char *action_set_name, const char *action_name, const char *subaction_path, const int64_t *duration, const float *frequency, const float *amplitude)
bool WM_xr_active_action_set_set(wmXrData *xr, const char *action_set_name, bool delayed)
short WM_xr_actionmap_active_index_get(const wmXrRuntimeData *runtime)
void WM_xr_actionmap_ensure_unique(wmXrRuntimeData *runtime, XrActionMap *actionmap)
void WM_xr_actionmap_selected_index_set(wmXrRuntimeData *runtime, short idx)
XrActionMap * WM_xr_actionmap_new(wmXrRuntimeData *runtime, const char *name, bool replace_existing)
XrActionMapBinding * WM_xr_actionmap_binding_add_copy(XrActionMapItem *ami, XrActionMapBinding *amb_src)
XrActionMapBinding * WM_xr_actionmap_binding_new(XrActionMapItem *ami, const char *name, bool replace_existing)
void WM_xr_actionmap_active_index_set(wmXrRuntimeData *runtime, short idx)
short WM_xr_actionmap_selected_index_get(const wmXrRuntimeData *runtime)
XrActionMap * WM_xr_actionmap_find(wmXrRuntimeData *runtime, const char *name)
XrActionMapItem * WM_xr_actionmap_item_find(XrActionMap *actionmap, const char *name)
XrActionMapBinding * WM_xr_actionmap_binding_find(XrActionMapItem *ami, const char *name)
XrActionMapItem * WM_xr_actionmap_item_new(XrActionMap *actionmap, const char *name, bool replace_existing)
XrActionMapItem * WM_xr_actionmap_item_add_copy(XrActionMap *actionmap, XrActionMapItem *ami_src)
XrActionMap * WM_xr_actionmap_add_copy(wmXrRuntimeData *runtime, XrActionMap *am_src)
void WM_xr_actionmap_item_ensure_unique(XrActionMap *actionmap, XrActionMapItem *ami)
bool WM_xr_actionmap_binding_remove(XrActionMapItem *ami, XrActionMapBinding *amb)
void WM_xr_actionmap_binding_ensure_unique(XrActionMapItem *ami, XrActionMapBinding *amb)
void WM_xr_actionmap_item_properties_update_ot(XrActionMapItem *ami)
bool WM_xr_actionmap_remove(wmXrRuntimeData *runtime, XrActionMap *actionmap)
bool WM_xr_actionmap_item_remove(XrActionMap *actionmap, XrActionMapItem *ami)
ListBase * WM_xr_actionmaps_get(wmXrRuntimeData *runtime)
void WM_xr_session_state_nav_scale_set(wmXrData *xr, float scale)
bool WM_xr_session_state_controller_aim_location_get(const wmXrData *xr, unsigned int subaction_idx, float r_location[3])
void WM_xr_session_base_pose_reset(wmXrData *xr)
bool WM_xr_session_state_nav_scale_get(const wmXrData *xr, float *r_scale)
bool WM_xr_session_state_controller_grip_rotation_get(const wmXrData *xr, unsigned int subaction_idx, float r_rotation[4])
bool WM_xr_session_state_controller_grip_location_get(const wmXrData *xr, unsigned int subaction_idx, float r_location[3])
bool WM_xr_session_state_controller_aim_rotation_get(const wmXrData *xr, unsigned int subaction_idx, float r_rotation[4])
bool WM_xr_session_state_nav_location_get(const wmXrData *xr, float r_location[3])
void WM_xr_session_state_nav_location_set(wmXrData *xr, const float location[3])
bool WM_xr_session_state_viewer_pose_location_get(const wmXrData *xr, float r_location[3])
bool WM_xr_session_exists(const wmXrData *xr)
void WM_xr_session_state_nav_rotation_set(wmXrData *xr, const float rotation[4])
bool WM_xr_session_state_viewer_pose_rotation_get(const wmXrData *xr, float r_rotation[4])
bool WM_xr_session_state_nav_rotation_get(const wmXrData *xr, float r_rotation[4])