60 return component_path;
94 bool replace_existing)
107# ifdef WITH_XR_OPENXR
119# ifdef WITH_XR_OPENXR
124 "ActionMapBinding '%s' cannot be removed from '%s'",
137# ifdef WITH_XR_OPENXR
148# ifdef WITH_XR_OPENXR
156static int rna_XrActionMapBinding_component_paths_length(
PointerRNA *
ptr)
158# ifdef WITH_XR_OPENXR
167static int rna_XrActionMapBinding_axis0_region_get(
PointerRNA *
ptr)
169# ifdef WITH_XR_OPENXR
183static void rna_XrActionMapBinding_axis0_region_set(
PointerRNA *
ptr,
int value)
185# ifdef WITH_XR_OPENXR
194static int rna_XrActionMapBinding_axis1_region_get(
PointerRNA *
ptr)
196# ifdef WITH_XR_OPENXR
210static void rna_XrActionMapBinding_axis1_region_set(
PointerRNA *
ptr,
int value)
212# ifdef WITH_XR_OPENXR
223# ifdef WITH_XR_OPENXR
245# ifdef WITH_XR_OPENXR
258# ifdef WITH_XR_OPENXR
272# ifdef WITH_XR_OPENXR
283 bool replace_existing)
285# ifdef WITH_XR_OPENXR
296# ifdef WITH_XR_OPENXR
306# ifdef WITH_XR_OPENXR
310 reports,
RPT_ERROR,
"ActionMapItem '%s' cannot be removed from '%s'", ami->
name, am->
name);
321# ifdef WITH_XR_OPENXR
331# ifdef WITH_XR_OPENXR
339static int rna_XrActionMapItem_user_paths_length(
PointerRNA *
ptr)
341# ifdef WITH_XR_OPENXR
350static void rna_XrActionMapItem_op_name_get(
PointerRNA *
ptr,
char *value)
352# ifdef WITH_XR_OPENXR
362 strcpy(value, ami->
op);
371static int rna_XrActionMapItem_op_name_length(
PointerRNA *
ptr)
373# ifdef WITH_XR_OPENXR
382 return strlen(ami->
op);
392# ifdef WITH_XR_OPENXR
405# ifdef WITH_XR_OPENXR
416static void rna_XrActionMapItem_bimanual_set(
PointerRNA *
ptr,
bool value)
418# ifdef WITH_XR_OPENXR
426static bool rna_XrActionMapItem_haptic_match_user_paths_get(
PointerRNA *
ptr)
428# ifdef WITH_XR_OPENXR
439static void rna_XrActionMapItem_haptic_match_user_paths_set(
PointerRNA *
ptr,
bool value)
441# ifdef WITH_XR_OPENXR
449static int rna_XrActionMapItem_haptic_mode_get(
PointerRNA *
ptr)
451# ifdef WITH_XR_OPENXR
466static void rna_XrActionMapItem_haptic_mode_set(
PointerRNA *
ptr,
int value)
468# ifdef WITH_XR_OPENXR
477static bool rna_XrActionMapItem_pose_is_controller_grip_get(
PointerRNA *
ptr)
479# ifdef WITH_XR_OPENXR
490static void rna_XrActionMapItem_pose_is_controller_grip_set(
PointerRNA *
ptr,
bool value)
492# ifdef WITH_XR_OPENXR
500static bool rna_XrActionMapItem_pose_is_controller_aim_get(
PointerRNA *
ptr)
502# ifdef WITH_XR_OPENXR
513static void rna_XrActionMapItem_pose_is_controller_aim_set(
PointerRNA *
ptr,
bool value)
515# ifdef WITH_XR_OPENXR
525# ifdef WITH_XR_OPENXR
533static int rna_XrActionMapItem_bindings_length(
PointerRNA *
ptr)
535# ifdef WITH_XR_OPENXR
546# ifdef WITH_XR_OPENXR
564# ifdef WITH_XR_OPENXR
574# ifdef WITH_XR_OPENXR
585# ifdef WITH_XR_OPENXR
596# ifdef WITH_XR_OPENXR
611# ifdef WITH_XR_OPENXR
622# ifdef WITH_XR_OPENXR
632# ifdef WITH_XR_OPENXR
643# ifdef WITH_XR_OPENXR
660static bool rna_XrSessionSettings_use_positional_tracking_get(
PointerRNA *
ptr)
662# ifdef WITH_XR_OPENXR
663 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
671static void rna_XrSessionSettings_use_positional_tracking_set(
PointerRNA *
ptr,
bool value)
673# ifdef WITH_XR_OPENXR
681static bool rna_XrSessionSettings_use_absolute_tracking_get(
PointerRNA *
ptr)
683# ifdef WITH_XR_OPENXR
684 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
692static void rna_XrSessionSettings_use_absolute_tracking_set(
PointerRNA *
ptr,
bool value)
694# ifdef WITH_XR_OPENXR
702static int rna_XrSessionSettings_icon_from_show_object_viewport_get(
PointerRNA *
ptr)
704# ifdef WITH_XR_OPENXR
705 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
727static bool rna_XrSessionState_is_running(
bContext *C)
729# ifdef WITH_XR_OPENXR
738static void rna_XrSessionState_reset_to_base_pose(
bContext *C)
740# ifdef WITH_XR_OPENXR
750# ifdef WITH_XR_OPENXR
759static bool rna_XrSessionState_action_create(
bContext *C,
763# ifdef WITH_XR_OPENXR
775 if (is_button_action) {
796 is_button_action ? &haptic_duration_msec : nullptr,
797 is_button_action ? &ami->haptic_frequency : nullptr,
798 is_button_action ? &ami->haptic_amplitude : nullptr,
808static bool rna_XrSessionState_action_binding_create(
bContext *C,
813# ifdef WITH_XR_OPENXR
817 if (count_user_paths < 1 || (count_user_paths != count_component_paths)) {
824 float float_thresholds[2];
828 if (is_float_action) {
831 if (is_button_action) {
834 if (is_pose_action) {
838 memcpy(&poses[1], &poses[0],
sizeof(poses[1]));
847 is_float_action ? float_thresholds : nullptr,
848 is_button_action ? axis_flags : nullptr,
849 is_pose_action ? poses : nullptr);
856bool rna_XrSessionState_active_action_set_set(
bContext *C,
const char *action_set_name)
858# ifdef WITH_XR_OPENXR
867bool rna_XrSessionState_controller_pose_actions_set(
bContext *C,
868 const char *action_set_name,
869 const char *grip_action_name,
870 const char *aim_action_name)
872# ifdef WITH_XR_OPENXR
875 &wm->
xr, action_set_name, grip_action_name, aim_action_name);
877 UNUSED_VARS(C, action_set_name, grip_action_name, aim_action_name);
882void rna_XrSessionState_action_state_get(
bContext *C,
883 const char *action_set_name,
884 const char *action_name,
885 const char *user_path,
888# ifdef WITH_XR_OPENXR
890 wmXrActionState
state;
892 switch (
state.type) {
898 r_state[0] =
state.state_float;
911 UNUSED_VARS(C, action_set_name, action_name, user_path);
916bool rna_XrSessionState_haptic_action_apply(
bContext *C,
917 const char *action_set_name,
918 const char *action_name,
919 const char *user_path,
924# ifdef WITH_XR_OPENXR
930 user_path[0] ? user_path : nullptr,
935 UNUSED_VARS(C, action_set_name, action_name, user_path, duration, frequency, amplitude);
940void rna_XrSessionState_haptic_action_stop(
bContext *C,
941 const char *action_set_name,
942 const char *action_name,
943 const char *user_path)
945# ifdef WITH_XR_OPENXR
948 &wm->
xr, action_set_name, action_name, user_path[0] ? user_path : nullptr);
950 UNUSED_VARS(C, action_set_name, action_name, user_path);
954static void rna_XrSessionState_controller_grip_location_get(
bContext *C,
958# ifdef WITH_XR_OPENXR
967static void rna_XrSessionState_controller_grip_rotation_get(
bContext *C,
971# ifdef WITH_XR_OPENXR
980static void rna_XrSessionState_controller_aim_location_get(
bContext *C,
984# ifdef WITH_XR_OPENXR
993static void rna_XrSessionState_controller_aim_rotation_get(
bContext *C,
997# ifdef WITH_XR_OPENXR
1006static void rna_XrSessionState_viewer_pose_location_get(
PointerRNA *
ptr,
float *r_values)
1008# ifdef WITH_XR_OPENXR
1009 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1017static void rna_XrSessionState_viewer_pose_rotation_get(
PointerRNA *
ptr,
float *r_values)
1019# ifdef WITH_XR_OPENXR
1020 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1028static void rna_XrSessionState_nav_location_get(
PointerRNA *
ptr,
float *r_values)
1030# ifdef WITH_XR_OPENXR
1031 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1039static void rna_XrSessionState_nav_location_set(
PointerRNA *
ptr,
const float *values)
1041# ifdef WITH_XR_OPENXR
1049static void rna_XrSessionState_nav_rotation_get(
PointerRNA *
ptr,
float *r_values)
1051# ifdef WITH_XR_OPENXR
1052 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1060static void rna_XrSessionState_nav_rotation_set(
PointerRNA *
ptr,
const float *values)
1062# ifdef WITH_XR_OPENXR
1070static float rna_XrSessionState_nav_scale_get(
PointerRNA *
ptr)
1073# ifdef WITH_XR_OPENXR
1074 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1083static void rna_XrSessionState_nav_scale_set(
PointerRNA *
ptr,
float value)
1085# ifdef WITH_XR_OPENXR
1095# ifdef WITH_XR_OPENXR
1104static int rna_XrSessionState_actionmaps_length(
PointerRNA *
ptr)
1106# ifdef WITH_XR_OPENXR
1116static int rna_XrSessionState_active_actionmap_get(
PointerRNA *
ptr)
1118# ifdef WITH_XR_OPENXR
1119 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1127static void rna_XrSessionState_active_actionmap_set(
PointerRNA *
ptr,
int value)
1129# ifdef WITH_XR_OPENXR
1137static int rna_XrSessionState_selected_actionmap_get(
PointerRNA *
ptr)
1139# ifdef WITH_XR_OPENXR
1140 const wmXrData *xr = rna_XrSession_wm_xr_data_get(
ptr);
1148static void rna_XrSessionState_selected_actionmap_set(
PointerRNA *
ptr,
int value)
1150# ifdef WITH_XR_OPENXR
1164static void rna_XrEventData_action_set_get(
PointerRNA *
ptr,
char *r_value)
1166# ifdef WITH_XR_OPENXR
1167 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1168 strcpy(r_value, data->action_set);
1175static int rna_XrEventData_action_set_length(
PointerRNA *
ptr)
1177# ifdef WITH_XR_OPENXR
1178 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1179 return strlen(data->action_set);
1186static void rna_XrEventData_action_get(
PointerRNA *
ptr,
char *r_value)
1188# ifdef WITH_XR_OPENXR
1189 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1190 strcpy(r_value, data->action);
1199# ifdef WITH_XR_OPENXR
1200 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1201 return strlen(data->action);
1208static void rna_XrEventData_user_path_get(
PointerRNA *
ptr,
char *r_value)
1210# ifdef WITH_XR_OPENXR
1211 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1212 strcpy(r_value, data->user_path);
1221# ifdef WITH_XR_OPENXR
1222 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1223 return strlen(data->user_path);
1230static void rna_XrEventData_user_path_other_get(
PointerRNA *
ptr,
char *r_value)
1232# ifdef WITH_XR_OPENXR
1233 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1234 strcpy(r_value, data->user_path_other);
1241static int rna_XrEventData_user_path_other_length(
PointerRNA *
ptr)
1243# ifdef WITH_XR_OPENXR
1244 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1245 return strlen(data->user_path_other);
1254# ifdef WITH_XR_OPENXR
1255 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1263static void rna_XrEventData_state_get(
PointerRNA *
ptr,
float r_values[2])
1265# ifdef WITH_XR_OPENXR
1266 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1274static void rna_XrEventData_state_other_get(
PointerRNA *
ptr,
float r_values[2])
1276# ifdef WITH_XR_OPENXR
1277 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1285static float rna_XrEventData_float_threshold_get(
PointerRNA *
ptr)
1287# ifdef WITH_XR_OPENXR
1288 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1289 return data->float_threshold;
1296static void rna_XrEventData_controller_location_get(
PointerRNA *
ptr,
float r_values[3])
1298# ifdef WITH_XR_OPENXR
1299 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1307static void rna_XrEventData_controller_rotation_get(
PointerRNA *
ptr,
float r_values[4])
1309# ifdef WITH_XR_OPENXR
1310 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1318static void rna_XrEventData_controller_location_other_get(
PointerRNA *
ptr,
float r_values[3])
1320# ifdef WITH_XR_OPENXR
1321 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1322 copy_v3_v3(r_values, data->controller_loc_other);
1329static void rna_XrEventData_controller_rotation_other_get(
PointerRNA *
ptr,
float r_values[4])
1331# ifdef WITH_XR_OPENXR
1332 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1333 copy_qt_qt(r_values, data->controller_rot_other);
1342# ifdef WITH_XR_OPENXR
1343 const wmXrActionData *data =
static_cast<const wmXrActionData *
>(
ptr->
data);
1344 return data->bimanual;
1362 "Float action, representing either a digital or analog button"},
1367 "2D float vector action, representing a thumbstick or trackpad"},
1372 "3D pose action, representing a controller's location and rotation"},
1377 "Haptic vibration output action, to be applied with a duration, frequency, and amplitude"},
1378 {0,
nullptr, 0,
nullptr,
nullptr},
1386 "Execute operator on button press (non-modal operators only)"},
1391 "Execute operator on button release (non-modal operators only)"},
1392 {
XR_OP_MODAL,
"MODAL", 0,
"Modal",
"Use modal execution (modal operators only)"},
1393 {0,
nullptr, 0,
nullptr,
nullptr},
1397 {
XR_HAPTIC_PRESS,
"PRESS", 0,
"Press",
"Apply haptics on button press"},
1398 {
XR_HAPTIC_RELEASE,
"RELEASE", 0,
"Release",
"Apply haptics on button release"},
1403 "Apply haptics on button press and release"},
1408 "Apply haptics repeatedly for the duration of the button press"},
1409 {0,
nullptr, 0,
nullptr,
nullptr},
1413 {0,
"ANY", 0,
"Any",
"Use any axis region for operator execution"},
1418 "Use positive axis region only for operator execution"},
1423 "Use negative axis region only for operator execution"},
1424 {0,
nullptr, 0,
nullptr,
nullptr},
1428 {0,
"ANY", 0,
"Any",
"Use any axis region for operator execution"},
1433 "Use positive axis region only for operator execution"},
1438 "Use negative axis region only for operator execution"},
1439 {0,
nullptr, 0,
nullptr,
nullptr},
1462 func,
"component_path",
"XrComponentPath",
"Component Path",
"Added component path");
1466 parm =
RNA_def_pointer(func,
"component_path",
"XrComponentPath",
"Component Path",
"");
1478 "The component path with the given path");
1500 "Replace any existing binding with the same name");
1503 func,
"binding",
"XrActionMapBinding",
"Binding",
"Added action map binding");
1506 func =
RNA_def_function(srna,
"new_from_binding",
"rna_XrActionMapBinding_new_from_binding");
1508 func,
"binding",
"XrActionMapBinding",
"Binding",
"Binding to use as a reference");
1511 func,
"result",
"XrActionMapBinding",
"Binding",
"Added action map binding");
1516 parm =
RNA_def_pointer(func,
"binding",
"XrActionMapBinding",
"Binding",
"");
1525 "XrActionMapBinding",
1527 "The action map binding with the given name");
1546 parm =
RNA_def_pointer(func,
"user_path",
"XrUserPath",
"User Path",
"Added user path");
1550 parm =
RNA_def_pointer(func,
"user_path",
"XrUserPath",
"User Path",
"");
1559 func,
"user_path",
"XrUserPath",
"User Path",
"The user path with the given path");
1581 "Replace any existing item with the same name");
1583 parm =
RNA_def_pointer(func,
"item",
"XrActionMapItem",
"Item",
"Added action map item");
1586 func =
RNA_def_function(srna,
"new_from_item",
"rna_XrActionMapItem_new_from_item");
1587 parm =
RNA_def_pointer(func,
"item",
"XrActionMapItem",
"Item",
"Item to use as a reference");
1589 parm =
RNA_def_pointer(func,
"result",
"XrActionMapItem",
"Item",
"Added action map item");
1602 func,
"item",
"XrActionMapItem",
"Item",
"The action map item with the given name");
1618 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1626 "Replace any existing actionmap with the same name");
1628 parm =
RNA_def_pointer(func,
"actionmap",
"XrActionMap",
"Action Map",
"Added action map");
1631 func =
RNA_def_function(srna,
"new_from_actionmap",
"rna_XrActionMap_new_from_actionmap");
1633 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1636 func,
"actionmap",
"XrActionMap",
"Action Map",
"Action map to use as a reference");
1638 parm =
RNA_def_pointer(func,
"result",
"XrActionMap",
"Action Map",
"Added action map");
1643 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1645 parm =
RNA_def_pointer(func,
"actionmap",
"XrActionMap",
"Action Map",
"Removed action map");
1651 parm =
RNA_def_pointer(func,
"xr_session_state",
"XrSessionState",
"XR Session State",
"");
1656 func,
"actionmap",
"XrActionMap",
"Action Map",
"The action map with the given name");
1679 "rna_XrActionMap_items_begin",
1680 "rna_iterator_listbase_next",
1681 "rna_iterator_listbase_end",
1682 "rna_iterator_listbase_get",
1683 "rna_XrActionMap_items_length",
1690 "Items in the action map, mapping an XR event to an operator, pose, or haptic output");
1724 "rna_XrActionMapItem_user_paths_begin",
1725 "rna_iterator_listbase_next",
1726 "rna_iterator_listbase_end",
1727 "rna_iterator_listbase_get",
1728 "rna_XrActionMapItem_user_paths_length",
1743 prop,
"Operator Name",
"Name of operator (translated) to call on action event");
1745 prop,
"rna_XrActionMapItem_op_name_get",
"rna_XrActionMapItem_op_name_length",
nullptr);
1750 prop,
"rna_XrActionMapItem_op_properties_get",
nullptr,
nullptr,
nullptr);
1752 prop,
"Operator Properties",
"Properties to set when the operator is called");
1762 prop,
"rna_XrActionMapItem_bimanual_get",
"rna_XrActionMapItem_bimanual_set");
1764 prop,
"Bimanual",
"The action depends on the states/poses of both user paths");
1768 "rna_XrActionMapItem_pose_is_controller_grip_get",
1769 "rna_XrActionMapItem_pose_is_controller_grip_set");
1771 prop,
"Is Controller Grip",
"The action poses will be used for the VR controller grips");
1775 "rna_XrActionMapItem_pose_is_controller_aim_get",
1776 "rna_XrActionMapItem_pose_is_controller_aim_set");
1778 prop,
"Is Controller Aim",
"The action poses will be used for the VR controller aims");
1782 prop,
"Haptic Name",
"Name of the haptic action to apply when executing this action");
1786 "rna_XrActionMapItem_haptic_match_user_paths_get",
1787 "rna_XrActionMapItem_haptic_match_user_paths_set");
1790 "Haptic Match User Paths",
1791 "Apply haptics to the same user paths for the haptic action and this action");
1797 "Haptic duration in seconds. 0.0 is the minimum supported duration.");
1803 "Frequency of the haptic vibration in hertz. 0.0 specifies the OpenXR "
1804 "runtime's default frequency.");
1809 prop,
"Haptic Amplitude",
"Intensity of the haptic vibration, ranging from 0.0 to 1.0");
1814 prop,
"rna_XrActionMapItem_haptic_mode_get",
"rna_XrActionMapItem_haptic_mode_set",
nullptr);
1820 "rna_XrActionMapItem_bindings_begin",
1821 "rna_iterator_listbase_next",
1822 "rna_iterator_listbase_end",
1823 "rna_iterator_listbase_get",
1824 "rna_XrActionMapItem_bindings_length",
1829 prop,
"Bindings",
"Bindings for the action map item, mapping the action to an XR input");
1862 "rna_XrActionMapBinding_component_paths_begin",
1863 "rna_iterator_listbase_next",
1864 "rna_iterator_listbase_end",
1865 "rna_iterator_listbase_get",
1866 "rna_XrActionMapBinding_component_paths_length",
1881 "rna_XrActionMapBinding_axis0_region_get",
1882 "rna_XrActionMapBinding_axis0_region_set",
1885 prop,
"Axis 0 Region",
"Action execution region for the first input axis");
1890 "rna_XrActionMapBinding_axis1_region_get",
1891 "rna_XrActionMapBinding_axis1_region_set",
1894 prop,
"Axis 1 Region",
"Action execution region for the second input axis");
1919 "Follow the active scene camera to define the VR view's base pose"},
1924 "Follow the transformation of an object to define the VR view's base pose"},
1929 "Follow a custom transformation to define the VR view's base pose"},
1930 {0,
nullptr, 0,
nullptr,
nullptr},
1940 "Draw dark controller with aiming axis ray"},
1945 "Draw light controller with aiming axis ray"},
1946 {0,
nullptr, 0,
nullptr,
nullptr},
1963 "Define where the location and rotation for the VR view come from, to which "
1964 "translation and rotation deltas from the VR headset will be applied to");
1971 "Object to take the location and rotation to which translation and "
1972 "rotation deltas from the VR headset will be applied to");
1977 "Base Pose Location",
1978 "Coordinates to apply translation deltas from the VR headset to");
1986 "Rotation angle around the Z-Axis to apply the rotation deltas from the VR headset to");
2019 prop,
"Show Controllers",
"Show VR controllers (requires VR actions for controller poses)");
2030 prop,
"Show Object Extras",
"Show object extras, including empties, lights, and cameras");
2037 prop,
"Controller Draw Style",
"Style to use when drawing VR controllers");
2055 "rna_XrSessionSettings_use_positional_tracking_get",
2056 "rna_XrSessionSettings_use_positional_tracking_set");
2059 "Positional Tracking",
2060 "Allow VR headsets to affect the location in virtual space, in addition to the rotation");
2065 "rna_XrSessionSettings_use_absolute_tracking_get",
2066 "rna_XrSessionSettings_use_absolute_tracking_set");
2069 "Absolute Tracking",
2070 "Allow the VR tracking origin to be defined independently of the headset location");
2078 prop,
"rna_XrSessionSettings_icon_from_show_object_viewport_get",
nullptr,
nullptr);
2098 func =
RNA_def_function(srna,
"is_running",
"rna_XrSessionState_is_running");
2106 func =
RNA_def_function(srna,
"reset_to_base_pose",
"rna_XrSessionState_reset_to_base_pose");
2112 func =
RNA_def_function(srna,
"action_set_create",
"rna_XrSessionState_action_set_create");
2122 func =
RNA_def_function(srna,
"action_create",
"rna_XrSessionState_action_create");
2129 parm =
RNA_def_pointer(func,
"actionmap_item",
"XrActionMapItem",
"",
"");
2135 srna,
"action_binding_create",
"rna_XrSessionState_action_binding_create");
2142 parm =
RNA_def_pointer(func,
"actionmap_item",
"XrActionMapItem",
"",
"");
2144 parm =
RNA_def_pointer(func,
"actionmap_binding",
"XrActionMapBinding",
"",
"");
2150 srna,
"active_action_set_set",
"rna_XrSessionState_active_action_set_set");
2161 srna,
"controller_pose_actions_set",
"rna_XrSessionState_controller_pose_actions_set");
2173 "Name of the action representing the controller grips");
2180 "Name of the action representing the controller aims");
2185 func =
RNA_def_function(srna,
"action_state_get",
"rna_XrSessionState_action_state_get");
2191 func,
"action_set_name",
nullptr,
MAX_NAME,
"Action Set",
"Action set name");
2206 "Current state of the VR action. Second float value is only set for 2D vector type actions.",
2211 func =
RNA_def_function(srna,
"haptic_action_apply",
"rna_XrSessionState_haptic_action_apply");
2217 func,
"action_set_name",
nullptr,
MAX_NAME,
"Action Set",
"Action set name");
2227 "Optional OpenXR user path. If not set, the action will be applied to all paths.");
2235 "Haptic duration in seconds. 0.0 is the minimum supported duration.",
2245 "Frequency of the haptic vibration in hertz. 0.0 specifies the OpenXR "
2246 "runtime's default frequency.",
2256 "Haptic amplitude, ranging from 0.0 to 1.0",
2263 func =
RNA_def_function(srna,
"haptic_action_stop",
"rna_XrSessionState_haptic_action_stop");
2269 func,
"action_set_name",
nullptr,
MAX_NAME,
"Action Set",
"Action set name");
2279 "Optional OpenXR user path. If not set, the action will be stopped for all paths.");
2283 srna,
"controller_grip_location_get",
"rna_XrSessionState_controller_grip_location_get");
2285 "Get the last known controller grip location in world space");
2289 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2298 "Controller grip location",
2304 srna,
"controller_grip_rotation_get",
"rna_XrSessionState_controller_grip_rotation_get");
2306 func,
"Get the last known controller grip rotation (quaternion) in world space");
2310 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2319 "Controller grip quaternion rotation",
2327 srna,
"controller_aim_location_get",
"rna_XrSessionState_controller_aim_location_get");
2329 "Get the last known controller aim location in world space");
2333 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2342 "Controller aim location",
2348 srna,
"controller_aim_rotation_get",
"rna_XrSessionState_controller_aim_rotation_get");
2350 func,
"Get the last known controller aim rotation (quaternion) in world space");
2354 parm =
RNA_def_int(func,
"index", 0, 0, 255,
"Index",
"Controller index", 0, 255);
2363 "Controller aim quaternion rotation",
2373 prop,
"rna_XrSessionState_viewer_pose_location_get",
nullptr,
nullptr);
2377 "Viewer Pose Location",
2378 "Last known location of the viewer pose (center between the eyes) in world space");
2383 prop,
"rna_XrSessionState_viewer_pose_rotation_get",
nullptr,
nullptr);
2387 "Viewer Pose Rotation",
2388 "Last known rotation of the viewer pose (center between the eyes) in world space");
2393 prop,
"rna_XrSessionState_nav_location_get",
"rna_XrSessionState_nav_location_set",
nullptr);
2396 "Navigation Location",
2397 "Location offset to apply to base pose when determining viewer location");
2402 prop,
"rna_XrSessionState_nav_rotation_get",
"rna_XrSessionState_nav_rotation_set",
nullptr);
2405 "Navigation Rotation",
2406 "Rotation offset to apply to base pose when determining viewer rotation");
2410 prop,
"rna_XrSessionState_nav_scale_get",
"rna_XrSessionState_nav_scale_set",
nullptr);
2414 "Additional scale multiplier to apply to base scale when determining viewer scale");
2419 "rna_XrSessionState_actionmaps_begin",
2420 "rna_iterator_listbase_next",
2421 "rna_iterator_listbase_end",
2422 "rna_iterator_listbase_get",
2423 "rna_XrSessionState_actionmaps_length",
2432 "rna_XrSessionState_active_actionmap_get",
2433 "rna_XrSessionState_active_actionmap_set",
2439 "rna_XrSessionState_selected_actionmap_get",
2440 "rna_XrSessionState_selected_actionmap_set",
2462 prop,
"rna_XrEventData_action_set_get",
"rna_XrEventData_action_set_length",
nullptr);
2468 prop,
"rna_XrEventData_action_get",
"rna_XrEventData_action_length",
nullptr);
2474 prop,
"rna_XrEventData_user_path_get",
"rna_XrEventData_user_path_length",
nullptr);
2480 "rna_XrEventData_user_path_other_get",
2481 "rna_XrEventData_user_path_other_length",
2484 prop,
"User Path Other",
"Other user path, for bimanual actions. E.g. \"/user/hand/right\"");
2503 prop,
"State Other",
"State of the other user path for bimanual actions");
2515 "Controller Location",
2516 "Location of the action's corresponding controller aim in world space");
2523 "Controller Rotation",
2524 "Rotation of the action's corresponding controller aim in world space");
2530 prop,
"rna_XrEventData_controller_location_other_get",
nullptr,
nullptr);
2532 "Controller Location Other",
2533 "Controller aim location of the other user path for bimanual actions");
2539 prop,
"rna_XrEventData_controller_rotation_other_get",
nullptr,
nullptr);
2541 "Controller Rotation Other",
2542 "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()
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT 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)
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])
#define STRNCPY(dst, 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_POINTER_INVALIDATE(ptr)
#define RNA_TRANSLATION_PREC_DEFAULT
constexpr PointerRNA PointerRNA_NULL
#define ND_XR_DATA_CHANGED
draw_view in_light_buf[] float
void *(* MEM_callocN)(size_t len, const char *str)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
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_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)
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])