55 return component_path;
89 bool replace_existing)
102# ifdef WITH_XR_OPENXR
114# ifdef WITH_XR_OPENXR
119 "ActionMapBinding '%s' cannot be removed from '%s'",
132# ifdef WITH_XR_OPENXR
143# ifdef WITH_XR_OPENXR
151static int rna_XrActionMapBinding_component_paths_length(
PointerRNA *
ptr)
153# ifdef WITH_XR_OPENXR
162static int rna_XrActionMapBinding_axis0_region_get(
PointerRNA *
ptr)
164# ifdef WITH_XR_OPENXR
178static void rna_XrActionMapBinding_axis0_region_set(
PointerRNA *
ptr,
int value)
180# ifdef WITH_XR_OPENXR
189static int rna_XrActionMapBinding_axis1_region_get(
PointerRNA *
ptr)
191# ifdef WITH_XR_OPENXR
205static void rna_XrActionMapBinding_axis1_region_set(
PointerRNA *
ptr,
int value)
207# ifdef WITH_XR_OPENXR
218# ifdef WITH_XR_OPENXR
240# ifdef WITH_XR_OPENXR
253# ifdef WITH_XR_OPENXR
267# ifdef WITH_XR_OPENXR
278 bool replace_existing)
280# ifdef WITH_XR_OPENXR
291# ifdef WITH_XR_OPENXR
301# ifdef WITH_XR_OPENXR
305 reports,
RPT_ERROR,
"ActionMapItem '%s' cannot be removed from '%s'", ami->
name, am->
name);
316# ifdef WITH_XR_OPENXR
326# ifdef WITH_XR_OPENXR
334static int rna_XrActionMapItem_user_paths_length(
PointerRNA *
ptr)
336# ifdef WITH_XR_OPENXR
345static void rna_XrActionMapItem_op_name_get(
PointerRNA *
ptr,
char *value)
347# ifdef WITH_XR_OPENXR
357 strcpy(value, ami->
op);
366static int rna_XrActionMapItem_op_name_length(
PointerRNA *
ptr)
368# ifdef WITH_XR_OPENXR
377 return strlen(ami->
op);
387# ifdef WITH_XR_OPENXR
400# ifdef WITH_XR_OPENXR
411static void rna_XrActionMapItem_bimanual_set(
PointerRNA *
ptr,
bool value)
413# ifdef WITH_XR_OPENXR
421static bool rna_XrActionMapItem_haptic_match_user_paths_get(
PointerRNA *
ptr)
423# ifdef WITH_XR_OPENXR
434static void rna_XrActionMapItem_haptic_match_user_paths_set(
PointerRNA *
ptr,
bool value)
436# ifdef WITH_XR_OPENXR
444static int rna_XrActionMapItem_haptic_mode_get(
PointerRNA *
ptr)
446# ifdef WITH_XR_OPENXR
461static void rna_XrActionMapItem_haptic_mode_set(
PointerRNA *
ptr,
int value)
463# ifdef WITH_XR_OPENXR
472static bool rna_XrActionMapItem_pose_is_controller_grip_get(
PointerRNA *
ptr)
474# ifdef WITH_XR_OPENXR
485static void rna_XrActionMapItem_pose_is_controller_grip_set(
PointerRNA *
ptr,
bool value)
487# ifdef WITH_XR_OPENXR
495static bool rna_XrActionMapItem_pose_is_controller_aim_get(
PointerRNA *
ptr)
497# ifdef WITH_XR_OPENXR
508static void rna_XrActionMapItem_pose_is_controller_aim_set(
PointerRNA *
ptr,
bool value)
510# ifdef WITH_XR_OPENXR
520# ifdef WITH_XR_OPENXR
528static int rna_XrActionMapItem_bindings_length(
PointerRNA *
ptr)
530# ifdef WITH_XR_OPENXR
541# ifdef WITH_XR_OPENXR
559# ifdef WITH_XR_OPENXR
569# ifdef WITH_XR_OPENXR
580# ifdef WITH_XR_OPENXR
591# ifdef WITH_XR_OPENXR
606# ifdef WITH_XR_OPENXR
617# ifdef WITH_XR_OPENXR
627# ifdef WITH_XR_OPENXR
638# ifdef WITH_XR_OPENXR
655static bool rna_XrSessionSettings_use_positional_tracking_get(
PointerRNA *
ptr)
657# ifdef WITH_XR_OPENXR
658 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
666static void rna_XrSessionSettings_use_positional_tracking_set(
PointerRNA *
ptr,
bool value)
668# ifdef WITH_XR_OPENXR
676static bool rna_XrSessionSettings_use_absolute_tracking_get(
PointerRNA *
ptr)
678# ifdef WITH_XR_OPENXR
679 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
687static void rna_XrSessionSettings_use_absolute_tracking_set(
PointerRNA *
ptr,
bool value)
689# ifdef WITH_XR_OPENXR
697static int rna_XrSessionSettings_icon_from_show_object_viewport_get(
PointerRNA *
ptr)
699# ifdef WITH_XR_OPENXR
700 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
722static bool rna_XrSessionState_is_running(
bContext *
C)
724# ifdef WITH_XR_OPENXR
733static void rna_XrSessionState_reset_to_base_pose(
bContext *
C)
735# ifdef WITH_XR_OPENXR
745# ifdef WITH_XR_OPENXR
754static bool rna_XrSessionState_action_create(
bContext *
C,
758# ifdef WITH_XR_OPENXR
770 if (is_button_action) {
791 is_button_action ? &haptic_duration_msec :
nullptr,
803static bool rna_XrSessionState_action_binding_create(
bContext *
C,
808# ifdef WITH_XR_OPENXR
812 if (count_user_paths < 1 || (count_user_paths != count_component_paths)) {
819 float float_thresholds[2];
823 if (is_float_action) {
826 if (is_button_action) {
829 if (is_pose_action) {
833 memcpy(&poses[1], &poses[0],
sizeof(poses[1]));
842 is_float_action ? float_thresholds :
nullptr,
843 is_button_action ? axis_flags :
nullptr,
844 is_pose_action ? poses :
nullptr);
851bool rna_XrSessionState_active_action_set_set(
bContext *
C,
const char *action_set_name)
853# ifdef WITH_XR_OPENXR
862bool rna_XrSessionState_controller_pose_actions_set(
bContext *
C,
863 const char *action_set_name,
864 const char *grip_action_name,
865 const char *aim_action_name)
867# ifdef WITH_XR_OPENXR
870 &wm->
xr, action_set_name, grip_action_name, aim_action_name);
872 UNUSED_VARS(
C, action_set_name, grip_action_name, aim_action_name);
877void rna_XrSessionState_action_state_get(
bContext *
C,
878 const char *action_set_name,
879 const char *action_name,
880 const char *user_path,
883# ifdef WITH_XR_OPENXR
885 wmXrActionState
state;
887 switch (
state.type) {
893 r_state[0] =
state.state_float;
906 UNUSED_VARS(
C, action_set_name, action_name, user_path);
911bool rna_XrSessionState_haptic_action_apply(
bContext *
C,
912 const char *action_set_name,
913 const char *action_name,
914 const char *user_path,
919# ifdef WITH_XR_OPENXR
925 user_path[0] ? user_path :
nullptr,
930 UNUSED_VARS(
C, action_set_name, action_name, user_path, duration, frequency, amplitude);
935void rna_XrSessionState_haptic_action_stop(
bContext *
C,
936 const char *action_set_name,
937 const char *action_name,
938 const char *user_path)
940# ifdef WITH_XR_OPENXR
943 &wm->
xr, action_set_name, action_name, user_path[0] ? user_path :
nullptr);
945 UNUSED_VARS(
C, action_set_name, action_name, user_path);
949static void rna_XrSessionState_controller_grip_location_get(
bContext *
C,
953# ifdef WITH_XR_OPENXR
962static void rna_XrSessionState_controller_grip_rotation_get(
bContext *
C,
966# ifdef WITH_XR_OPENXR
975static void rna_XrSessionState_controller_aim_location_get(
bContext *
C,
979# ifdef WITH_XR_OPENXR
988static void rna_XrSessionState_controller_aim_rotation_get(
bContext *
C,
992# ifdef WITH_XR_OPENXR
1001static void rna_XrSessionState_viewer_pose_location_get(
PointerRNA *
ptr,
float *r_values)
1003# ifdef WITH_XR_OPENXR
1004 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1012static void rna_XrSessionState_viewer_pose_rotation_get(
PointerRNA *
ptr,
float *r_values)
1014# ifdef WITH_XR_OPENXR
1015 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1023static void rna_XrSessionState_nav_location_get(
PointerRNA *
ptr,
float *r_values)
1025# ifdef WITH_XR_OPENXR
1026 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1034static void rna_XrSessionState_nav_location_set(
PointerRNA *
ptr,
const float *values)
1036# ifdef WITH_XR_OPENXR
1044static void rna_XrSessionState_nav_rotation_get(
PointerRNA *
ptr,
float *r_values)
1046# ifdef WITH_XR_OPENXR
1047 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1055static void rna_XrSessionState_nav_rotation_set(
PointerRNA *
ptr,
const float *values)
1057# ifdef WITH_XR_OPENXR
1065static float rna_XrSessionState_nav_scale_get(
PointerRNA *
ptr)
1068# ifdef WITH_XR_OPENXR
1069 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1078static void rna_XrSessionState_nav_scale_set(
PointerRNA *
ptr,
float value)
1080# ifdef WITH_XR_OPENXR
1090# ifdef WITH_XR_OPENXR
1099static int rna_XrSessionState_actionmaps_length(
PointerRNA *
ptr)
1101# ifdef WITH_XR_OPENXR
1111static int rna_XrSessionState_active_actionmap_get(
PointerRNA *
ptr)
1113# ifdef WITH_XR_OPENXR
1114 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1122static void rna_XrSessionState_active_actionmap_set(
PointerRNA *
ptr,
int value)
1124# ifdef WITH_XR_OPENXR
1132static int rna_XrSessionState_selected_actionmap_get(
PointerRNA *
ptr)
1134# ifdef WITH_XR_OPENXR
1135 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1143static void rna_XrSessionState_selected_actionmap_set(
PointerRNA *
ptr,
int value)
1145# ifdef WITH_XR_OPENXR
1159static void rna_XrEventData_action_set_get(
PointerRNA *
ptr,
char *r_value)
1161# ifdef WITH_XR_OPENXR
1162 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1163 strcpy(r_value,
data->action_set);
1170static int rna_XrEventData_action_set_length(
PointerRNA *
ptr)
1172# ifdef WITH_XR_OPENXR
1173 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1174 return strlen(
data->action_set);
1181static void rna_XrEventData_action_get(
PointerRNA *
ptr,
char *r_value)
1183# ifdef WITH_XR_OPENXR
1184 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1185 strcpy(r_value,
data->action);
1194# ifdef WITH_XR_OPENXR
1195 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1196 return strlen(
data->action);
1203static void rna_XrEventData_user_path_get(
PointerRNA *
ptr,
char *r_value)
1205# ifdef WITH_XR_OPENXR
1206 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1207 strcpy(r_value,
data->user_path);
1216# ifdef WITH_XR_OPENXR
1217 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1218 return strlen(
data->user_path);
1225static void rna_XrEventData_user_path_other_get(
PointerRNA *
ptr,
char *r_value)
1227# ifdef WITH_XR_OPENXR
1228 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1229 strcpy(r_value,
data->user_path_other);
1236static int rna_XrEventData_user_path_other_length(
PointerRNA *
ptr)
1238# ifdef WITH_XR_OPENXR
1239 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1240 return strlen(
data->user_path_other);
1249# ifdef WITH_XR_OPENXR
1250 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1258static void rna_XrEventData_state_get(
PointerRNA *
ptr,
float r_values[2])
1260# ifdef WITH_XR_OPENXR
1261 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1269static void rna_XrEventData_state_other_get(
PointerRNA *
ptr,
float r_values[2])
1271# ifdef WITH_XR_OPENXR
1272 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1280static float rna_XrEventData_float_threshold_get(
PointerRNA *
ptr)
1282# ifdef WITH_XR_OPENXR
1283 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1284 return data->float_threshold;
1291static void rna_XrEventData_controller_location_get(
PointerRNA *
ptr,
float r_values[3])
1293# ifdef WITH_XR_OPENXR
1294 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1302static void rna_XrEventData_controller_rotation_get(
PointerRNA *
ptr,
float r_values[4])
1304# ifdef WITH_XR_OPENXR
1305 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1313static void rna_XrEventData_controller_location_other_get(
PointerRNA *
ptr,
float r_values[3])
1315# ifdef WITH_XR_OPENXR
1316 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1324static void rna_XrEventData_controller_rotation_other_get(
PointerRNA *
ptr,
float r_values[4])
1326# ifdef WITH_XR_OPENXR
1327 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1337# ifdef WITH_XR_OPENXR
1338 const wmXrActionData *
data =
static_cast<const wmXrActionData *
>(
ptr->data);
1339 return data->bimanual;
1357 "Float action, representing either a digital or analog button"},
1362 "2D float vector action, representing a thumbstick or trackpad"},
1367 "3D pose action, representing a controller's location and rotation"},
1372 "Haptic vibration output action, to be applied with a duration, frequency, and amplitude"},
1373 {0,
nullptr, 0,
nullptr,
nullptr},
1381 "Execute operator on button press (non-modal operators only)"},
1386 "Execute operator on button release (non-modal operators only)"},
1387 {
XR_OP_MODAL,
"MODAL", 0,
"Modal",
"Use modal execution (modal operators only)"},
1388 {0,
nullptr, 0,
nullptr,
nullptr},
1392 {
XR_HAPTIC_PRESS,
"PRESS", 0,
"Press",
"Apply haptics on button press"},
1393 {
XR_HAPTIC_RELEASE,
"RELEASE", 0,
"Release",
"Apply haptics on button release"},
1398 "Apply haptics on button press and release"},
1403 "Apply haptics repeatedly for the duration of the button press"},
1404 {0,
nullptr, 0,
nullptr,
nullptr},
1408 {0,
"ANY", 0,
"Any",
"Use any axis region for operator execution"},
1413 "Use positive axis region only for operator execution"},
1418 "Use negative axis region only for operator execution"},
1419 {0,
nullptr, 0,
nullptr,
nullptr},
1423 {0,
"ANY", 0,
"Any",
"Use any axis region for operator execution"},
1428 "Use positive axis region only for operator execution"},
1433 "Use negative axis region only for operator execution"},
1434 {0,
nullptr, 0,
nullptr,
nullptr},
1457 func,
"component_path",
"XrComponentPath",
"Component Path",
"Added component path");
1461 parm =
RNA_def_pointer(func,
"component_path",
"XrComponentPath",
"Component Path",
"");
1473 "The component path with the given path");
1495 "Replace any existing binding with the same name");
1498 func,
"binding",
"XrActionMapBinding",
"Binding",
"Added action map binding");
1501 func =
RNA_def_function(srna,
"new_from_binding",
"rna_XrActionMapBinding_new_from_binding");
1503 func,
"binding",
"XrActionMapBinding",
"Binding",
"Binding to use as a reference");
1506 func,
"result",
"XrActionMapBinding",
"Binding",
"Added action map binding");
1511 parm =
RNA_def_pointer(func,
"binding",
"XrActionMapBinding",
"Binding",
"");
1520 "XrActionMapBinding",
1522 "The action map binding with the given name");
1541 parm =
RNA_def_pointer(func,
"user_path",
"XrUserPath",
"User Path",
"Added user path");
1545 parm =
RNA_def_pointer(func,
"user_path",
"XrUserPath",
"User Path",
"");
1554 func,
"user_path",
"XrUserPath",
"User Path",
"The user path with the given path");
1576 "Replace any existing item with the same name");
1578 parm =
RNA_def_pointer(func,
"item",
"XrActionMapItem",
"Item",
"Added action map item");
1581 func =
RNA_def_function(srna,
"new_from_item",
"rna_XrActionMapItem_new_from_item");
1582 parm =
RNA_def_pointer(func,
"item",
"XrActionMapItem",
"Item",
"Item to use as a reference");
1584 parm =
RNA_def_pointer(func,
"result",
"XrActionMapItem",
"Item",
"Added action map item");
1597 func,
"item",
"XrActionMapItem",
"Item",
"The action map item with the given name");
1613 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1621 "Replace any existing actionmap with the same name");
1623 parm =
RNA_def_pointer(func,
"actionmap",
"XrActionMap",
"Action Map",
"Added action map");
1626 func =
RNA_def_function(srna,
"new_from_actionmap",
"rna_XrActionMap_new_from_actionmap");
1628 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1631 func,
"actionmap",
"XrActionMap",
"Action Map",
"Action map to use as a reference");
1633 parm =
RNA_def_pointer(func,
"result",
"XrActionMap",
"Action Map",
"Added action map");
1638 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1640 parm =
RNA_def_pointer(func,
"actionmap",
"XrActionMap",
"Action Map",
"Removed action map");
1646 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1651 func,
"actionmap",
"XrActionMap",
"Action Map",
"The action map with the given name");
1674 "rna_XrActionMap_items_begin",
1675 "rna_iterator_listbase_next",
1676 "rna_iterator_listbase_end",
1677 "rna_iterator_listbase_get",
1678 "rna_XrActionMap_items_length",
1685 "Items in the action map, mapping an XR event to an operator, pose, or haptic output");
1719 "rna_XrActionMapItem_user_paths_begin",
1720 "rna_iterator_listbase_next",
1721 "rna_iterator_listbase_end",
1722 "rna_iterator_listbase_get",
1723 "rna_XrActionMapItem_user_paths_length",
1738 prop,
"Operator Name",
"Name of operator (translated) to call on action event");
1740 prop,
"rna_XrActionMapItem_op_name_get",
"rna_XrActionMapItem_op_name_length",
nullptr);
1745 prop,
"rna_XrActionMapItem_op_properties_get",
nullptr,
nullptr,
nullptr);
1747 prop,
"Operator Properties",
"Properties to set when the operator is called");
1757 prop,
"rna_XrActionMapItem_bimanual_get",
"rna_XrActionMapItem_bimanual_set");
1759 prop,
"Bimanual",
"The action depends on the states/poses of both user paths");
1763 "rna_XrActionMapItem_pose_is_controller_grip_get",
1764 "rna_XrActionMapItem_pose_is_controller_grip_set");
1766 prop,
"Is Controller Grip",
"The action poses will be used for the VR controller grips");
1770 "rna_XrActionMapItem_pose_is_controller_aim_get",
1771 "rna_XrActionMapItem_pose_is_controller_aim_set");
1773 prop,
"Is Controller Aim",
"The action poses will be used for the VR controller aims");
1777 prop,
"Haptic Name",
"Name of the haptic action to apply when executing this action");
1781 "rna_XrActionMapItem_haptic_match_user_paths_get",
1782 "rna_XrActionMapItem_haptic_match_user_paths_set");
1785 "Haptic Match User Paths",
1786 "Apply haptics to the same user paths for the haptic action and this action");
1792 "Haptic duration in seconds. 0.0 is the minimum supported duration.");
1798 "Frequency of the haptic vibration in hertz. 0.0 specifies the OpenXR "
1799 "runtime's default frequency.");
1804 prop,
"Haptic Amplitude",
"Intensity of the haptic vibration, ranging from 0.0 to 1.0");
1809 prop,
"rna_XrActionMapItem_haptic_mode_get",
"rna_XrActionMapItem_haptic_mode_set",
nullptr);
1815 "rna_XrActionMapItem_bindings_begin",
1816 "rna_iterator_listbase_next",
1817 "rna_iterator_listbase_end",
1818 "rna_iterator_listbase_get",
1819 "rna_XrActionMapItem_bindings_length",
1824 prop,
"Bindings",
"Bindings for the action map item, mapping the action to an XR input");
1857 "rna_XrActionMapBinding_component_paths_begin",
1858 "rna_iterator_listbase_next",
1859 "rna_iterator_listbase_end",
1860 "rna_iterator_listbase_get",
1861 "rna_XrActionMapBinding_component_paths_length",
1876 "rna_XrActionMapBinding_axis0_region_get",
1877 "rna_XrActionMapBinding_axis0_region_set",
1880 prop,
"Axis 0 Region",
"Action execution region for the first input axis");
1885 "rna_XrActionMapBinding_axis1_region_get",
1886 "rna_XrActionMapBinding_axis1_region_set",
1889 prop,
"Axis 1 Region",
"Action execution region for the second input axis");
1914 "Follow the active scene camera to define the VR view's base pose"},
1919 "Follow the transformation of an object to define the VR view's base pose"},
1924 "Follow a custom transformation to define the VR view's base pose"},
1925 {0,
nullptr, 0,
nullptr,
nullptr},
1935 "Draw dark controller with aiming axis ray"},
1940 "Draw light controller with aiming axis ray"},
1941 {0,
nullptr, 0,
nullptr,
nullptr},
1958 "Define where the location and rotation for the VR view come from, to which "
1959 "translation and rotation deltas from the VR headset will be applied to");
1966 "Object to take the location and rotation to which translation and "
1967 "rotation deltas from the VR headset will be applied to");
1972 "Base Pose Location",
1973 "Coordinates to apply translation deltas from the VR headset to");
1981 "Rotation angle around the Z-Axis to apply the rotation deltas from the VR headset to");
2014 prop,
"Show Controllers",
"Show VR controllers (requires VR actions for controller poses)");
2025 prop,
"Show Object Extras",
"Show object extras, including empties, lights, and cameras");
2032 prop,
"Controller Draw Style",
"Style to use when drawing VR controllers");
2056 "rna_XrSessionSettings_use_positional_tracking_get",
2057 "rna_XrSessionSettings_use_positional_tracking_set");
2060 "Positional Tracking",
2061 "Allow VR headsets to affect the location in virtual space, in addition to the rotation");
2066 "rna_XrSessionSettings_use_absolute_tracking_get",
2067 "rna_XrSessionSettings_use_absolute_tracking_set");
2070 "Absolute Tracking",
2071 "Allow the VR tracking origin to be defined independently of the headset location");
2079 prop,
"rna_XrSessionSettings_icon_from_show_object_viewport_get",
nullptr,
nullptr);
2099 func =
RNA_def_function(srna,
"is_running",
"rna_XrSessionState_is_running");
2107 func =
RNA_def_function(srna,
"reset_to_base_pose",
"rna_XrSessionState_reset_to_base_pose");
2113 func =
RNA_def_function(srna,
"action_set_create",
"rna_XrSessionState_action_set_create");
2123 func =
RNA_def_function(srna,
"action_create",
"rna_XrSessionState_action_create");
2130 parm =
RNA_def_pointer(func,
"actionmap_item",
"XrActionMapItem",
"",
"");
2136 srna,
"action_binding_create",
"rna_XrSessionState_action_binding_create");
2143 parm =
RNA_def_pointer(func,
"actionmap_item",
"XrActionMapItem",
"",
"");
2145 parm =
RNA_def_pointer(func,
"actionmap_binding",
"XrActionMapBinding",
"",
"");
2151 srna,
"active_action_set_set",
"rna_XrSessionState_active_action_set_set");
2162 srna,
"controller_pose_actions_set",
"rna_XrSessionState_controller_pose_actions_set");
2174 "Name of the action representing the controller grips");
2181 "Name of the action representing the controller aims");
2186 func =
RNA_def_function(srna,
"action_state_get",
"rna_XrSessionState_action_state_get");
2192 func,
"action_set_name",
nullptr,
MAX_NAME,
"Action Set",
"Action set name");
2207 "Current state of the VR action. Second float value is only set for 2D vector type actions.",
2212 func =
RNA_def_function(srna,
"haptic_action_apply",
"rna_XrSessionState_haptic_action_apply");
2218 func,
"action_set_name",
nullptr,
MAX_NAME,
"Action Set",
"Action set name");
2228 "Optional OpenXR user path. If not set, the action will be applied to all paths.");
2236 "Haptic duration in seconds. 0.0 is the minimum supported duration.",
2246 "Frequency of the haptic vibration in hertz. 0.0 specifies the OpenXR "
2247 "runtime's default frequency.",
2257 "Haptic amplitude, ranging from 0.0 to 1.0",
2264 func =
RNA_def_function(srna,
"haptic_action_stop",
"rna_XrSessionState_haptic_action_stop");
2270 func,
"action_set_name",
nullptr,
MAX_NAME,
"Action Set",
"Action set name");
2280 "Optional OpenXR user path. If not set, the action will be stopped for all paths.");
2284 srna,
"controller_grip_location_get",
"rna_XrSessionState_controller_grip_location_get");
2286 "Get the last known controller grip location in world space");
2290 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2299 "Controller grip location",
2305 srna,
"controller_grip_rotation_get",
"rna_XrSessionState_controller_grip_rotation_get");
2307 func,
"Get the last known controller grip rotation (quaternion) in world space");
2311 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2320 "Controller grip quaternion rotation",
2328 srna,
"controller_aim_location_get",
"rna_XrSessionState_controller_aim_location_get");
2330 "Get the last known controller aim location in world space");
2334 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2343 "Controller aim location",
2349 srna,
"controller_aim_rotation_get",
"rna_XrSessionState_controller_aim_rotation_get");
2351 func,
"Get the last known controller aim rotation (quaternion) in world space");
2355 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2364 "Controller aim quaternion rotation",
2374 prop,
"rna_XrSessionState_viewer_pose_location_get",
nullptr,
nullptr);
2378 "Viewer Pose Location",
2379 "Last known location of the viewer pose (center between the eyes) in world space");
2384 prop,
"rna_XrSessionState_viewer_pose_rotation_get",
nullptr,
nullptr);
2388 "Viewer Pose Rotation",
2389 "Last known rotation of the viewer pose (center between the eyes) in world space");
2394 prop,
"rna_XrSessionState_nav_location_get",
"rna_XrSessionState_nav_location_set",
nullptr);
2397 "Navigation Location",
2398 "Location offset to apply to base pose when determining viewer location");
2403 prop,
"rna_XrSessionState_nav_rotation_get",
"rna_XrSessionState_nav_rotation_set",
nullptr);
2406 "Navigation Rotation",
2407 "Rotation offset to apply to base pose when determining viewer rotation");
2411 prop,
"rna_XrSessionState_nav_scale_get",
"rna_XrSessionState_nav_scale_set",
nullptr);
2415 "Additional scale multiplier to apply to base scale when determining viewer scale");
2420 "rna_XrSessionState_actionmaps_begin",
2421 "rna_iterator_listbase_next",
2422 "rna_iterator_listbase_end",
2423 "rna_iterator_listbase_get",
2424 "rna_XrSessionState_actionmaps_length",
2433 "rna_XrSessionState_active_actionmap_get",
2434 "rna_XrSessionState_active_actionmap_set",
2440 "rna_XrSessionState_selected_actionmap_get",
2441 "rna_XrSessionState_selected_actionmap_set",
2463 prop,
"rna_XrEventData_action_set_get",
"rna_XrEventData_action_set_length",
nullptr);
2469 prop,
"rna_XrEventData_action_get",
"rna_XrEventData_action_length",
nullptr);
2475 prop,
"rna_XrEventData_user_path_get",
"rna_XrEventData_user_path_length",
nullptr);
2481 "rna_XrEventData_user_path_other_get",
2482 "rna_XrEventData_user_path_other_length",
2485 prop,
"User Path Other",
"Other user path, for bimanual actions. E.g. \"/user/hand/right\"");
2504 prop,
"State Other",
"State of the other user path for bimanual actions");
2516 "Controller Location",
2517 "Location of the action's corresponding controller aim in world space");
2524 "Controller Rotation",
2525 "Rotation of the action's corresponding controller aim in world space");
2531 prop,
"rna_XrEventData_controller_location_other_get",
nullptr,
nullptr);
2533 "Controller Location Other",
2534 "Controller aim location of the other user path for bimanual actions");
2540 prop,
"rna_XrEventData_controller_rotation_other_get",
nullptr,
nullptr);
2542 "Controller Rotation Other",
2543 "Controller aim rotation of the other user path for bimanual actions");
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()
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const 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 * STRNCPY(char(&dst)[N], const char *src)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLT_I18NCONTEXT_COLOR
@ V3D_OFSDRAW_SHOW_OBJECT_EXTRAS
@ V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_OFSDRAW_SHOW_GRIDFLOOR
@ V3D_OFSDRAW_XR_SHOW_PASSTHROUGH
@ 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_TRANSLATION_PREC_DEFAULT
#define ND_XR_DATA_CHANGED
BMesh const char void * data
void * MEM_callocN(size_t len, const char *str)
const PointerRNA PointerRNA_NULL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_define_animate_sdna(bool animate)
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)
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)
PropertyRNA * RNA_def_float_translation(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
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)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
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)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
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)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
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, const char *update_func)
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
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
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 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)
XrActionMapItem * WM_xr_actionmap_item_find(XrActionMap *actionmap, const char *name)
void WM_xr_actionmap_ensure_unique(wmXrRuntimeData *runtime, XrActionMap *actionmap)
XrActionMap * WM_xr_actionmap_find(wmXrRuntimeData *runtime, const char *name)
XrActionMapItem * WM_xr_actionmap_item_add_copy(XrActionMap *actionmap, XrActionMapItem *ami_src)
XrActionMapItem * WM_xr_actionmap_item_new(XrActionMap *actionmap, const char *name, bool replace_existing)
void WM_xr_actionmap_selected_index_set(wmXrRuntimeData *runtime, short idx)
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)
XrActionMapBinding * WM_xr_actionmap_binding_find(XrActionMapItem *ami, const char *name)
void WM_xr_actionmap_active_index_set(wmXrRuntimeData *runtime, short idx)
short WM_xr_actionmap_selected_index_get(const wmXrRuntimeData *runtime)
void WM_xr_actionmap_item_ensure_unique(XrActionMap *actionmap, XrActionMapItem *ami)
XrActionMap * WM_xr_actionmap_new(wmXrRuntimeData *runtime, const char *name, bool replace_existing)
bool WM_xr_actionmap_binding_remove(XrActionMapItem *ami, XrActionMapBinding *amb)
ListBase * WM_xr_actionmaps_get(wmXrRuntimeData *runtime)
void WM_xr_actionmap_binding_ensure_unique(XrActionMapItem *ami, XrActionMapBinding *amb)
XrActionMap * WM_xr_actionmap_add_copy(wmXrRuntimeData *runtime, XrActionMap *am_src)
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)
void WM_xr_session_state_nav_scale_set(wmXrData *xr, float scale)
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_aim_location_get(const wmXrData *xr, uint subaction_idx, float r_location[3])
bool WM_xr_session_state_controller_aim_rotation_get(const wmXrData *xr, uint 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)
bool WM_xr_session_state_controller_grip_location_get(const wmXrData *xr, uint subaction_idx, float r_location[3])
bool WM_xr_session_state_controller_grip_rotation_get(const wmXrData *xr, uint subaction_idx, float r_rotation[4])
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])