Remove deprecated xr features properties. These properties are now provided directly by the plugin.
This commit is contained in:
parent
f6e5ea774b
commit
abb21844d8
3 changed files with 4 additions and 72 deletions
|
@ -855,7 +855,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
bool screen_support_xlarge = p_preset->get("screen/support_xlarge");
|
bool screen_support_xlarge = p_preset->get("screen/support_xlarge");
|
||||||
|
|
||||||
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
||||||
bool focus_awareness = p_preset->get("xr_features/focus_awareness");
|
|
||||||
|
|
||||||
Vector<String> perms;
|
Vector<String> perms;
|
||||||
// Write permissions into the perms variable.
|
// Write permissions into the perms variable.
|
||||||
|
@ -921,7 +920,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
String tname = string_table[name];
|
String tname = string_table[name];
|
||||||
uint32_t attrcount = decode_uint32(&p_manifest[iofs + 20]);
|
uint32_t attrcount = decode_uint32(&p_manifest[iofs + 20]);
|
||||||
iofs += 28;
|
iofs += 28;
|
||||||
bool is_focus_aware_metadata = false;
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < attrcount; i++) {
|
for (uint32_t i = 0; i < attrcount; i++) {
|
||||||
uint32_t attr_nspace = decode_uint32(&p_manifest[iofs]);
|
uint32_t attr_nspace = decode_uint32(&p_manifest[iofs]);
|
||||||
|
@ -973,28 +971,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: `attr_value != 0xFFFFFFFF` below added as a stopgap measure for GH-32553,
|
|
||||||
// but the issue should be debugged further and properly addressed.
|
|
||||||
if (tname == "meta-data" && attrname == "name" && value == "xr_mode_metadata_name") {
|
|
||||||
// Update the meta-data 'android:name' attribute based on the selected XR mode.
|
|
||||||
if (xr_mode_index == 1 /* XRMode.OVR */) {
|
|
||||||
string_table.write[attr_value] = "com.samsung.android.vr.application.mode";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tname == "meta-data" && attrname == "value" && value == "xr_mode_metadata_value") {
|
|
||||||
// Update the meta-data 'android:value' attribute based on the selected XR mode.
|
|
||||||
if (xr_mode_index == 1 /* XRMode.OVR */) {
|
|
||||||
string_table.write[attr_value] = "vr_only";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tname == "meta-data" && attrname == "value" && is_focus_aware_metadata) {
|
|
||||||
// Update the focus awareness meta-data value
|
|
||||||
encode_uint32(xr_mode_index == /* XRMode.OVR */ 1 && focus_awareness ? 0xFFFFFFFF : 0, &p_manifest.write[iofs + 16]);
|
|
||||||
}
|
|
||||||
|
|
||||||
is_focus_aware_metadata = tname == "meta-data" && attrname == "name" && value == "com.oculus.vr.focusaware";
|
|
||||||
iofs += 20;
|
iofs += 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1010,15 +986,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
Vector<int> feature_versions;
|
Vector<int> feature_versions;
|
||||||
|
|
||||||
if (xr_mode_index == 1 /* XRMode.OVR */) {
|
if (xr_mode_index == 1 /* XRMode.OVR */) {
|
||||||
// Check for degrees of freedom
|
|
||||||
int dof_index = p_preset->get("xr_features/degrees_of_freedom"); // 0: none, 1: 3dof and 6dof, 2: 6dof
|
|
||||||
|
|
||||||
if (dof_index > 0) {
|
|
||||||
feature_names.push_back("android.hardware.vr.headtracking");
|
|
||||||
feature_required_list.push_back(dof_index == 2);
|
|
||||||
feature_versions.push_back(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for hand tracking
|
// Check for hand tracking
|
||||||
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
||||||
if (hand_tracking_index > 0) {
|
if (hand_tracking_index > 0) {
|
||||||
|
@ -1708,9 +1675,7 @@ public:
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/opengl_debug"), false));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/opengl_debug"), false));
|
||||||
|
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/xr_mode", PROPERTY_HINT_ENUM, "Regular,Oculus Mobile VR"), 0));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/xr_mode", PROPERTY_HINT_ENUM, "Regular,Oculus Mobile VR"), 0));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/degrees_of_freedom", PROPERTY_HINT_ENUM, "None,3DOF and 6DOF,6DOF"), 0));
|
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/hand_tracking", PROPERTY_HINT_ENUM, "None,Optional,Required"), 0));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/hand_tracking", PROPERTY_HINT_ENUM, "None,Optional,Required"), 0));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "xr_features/focus_awareness"), false));
|
|
||||||
|
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/immersive_mode"), true));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/immersive_mode"), true));
|
||||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_small"), true));
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_small"), true));
|
||||||
|
@ -2159,27 +2124,13 @@ public:
|
||||||
|
|
||||||
// Validate the Xr features are properly populated
|
// Validate the Xr features are properly populated
|
||||||
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
||||||
int degrees_of_freedom = p_preset->get("xr_features/degrees_of_freedom");
|
|
||||||
int hand_tracking = p_preset->get("xr_features/hand_tracking");
|
int hand_tracking = p_preset->get("xr_features/hand_tracking");
|
||||||
bool focus_awareness = p_preset->get("xr_features/focus_awareness");
|
|
||||||
if (xr_mode_index != /* XRMode.OVR*/ 1) {
|
if (xr_mode_index != /* XRMode.OVR*/ 1) {
|
||||||
if (degrees_of_freedom > 0) {
|
|
||||||
valid = false;
|
|
||||||
err += TTR("\"Degrees Of Freedom\" is only valid when \"Xr Mode\" is \"Oculus Mobile VR\".");
|
|
||||||
err += "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hand_tracking > 0) {
|
if (hand_tracking > 0) {
|
||||||
valid = false;
|
valid = false;
|
||||||
err += TTR("\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VR\".");
|
err += TTR("\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VR\".");
|
||||||
err += "\n";
|
err += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (focus_awareness) {
|
|
||||||
valid = false;
|
|
||||||
err += TTR("\"Focus Awareness\" is only valid when \"Xr Mode\" is \"Oculus Mobile VR\".");
|
|
||||||
err += "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (int(p_preset->get("custom_template/export_format")) == EXPORT_FORMAT_AAB &&
|
if (int(p_preset->get("custom_template/export_format")) == EXPORT_FORMAT_AAB &&
|
||||||
|
|
|
@ -241,12 +241,6 @@ String _get_xr_features_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||||
String manifest_xr_features;
|
String manifest_xr_features;
|
||||||
bool uses_xr = (int)(p_preset->get("xr_features/xr_mode")) == 1;
|
bool uses_xr = (int)(p_preset->get("xr_features/xr_mode")) == 1;
|
||||||
if (uses_xr) {
|
if (uses_xr) {
|
||||||
int dof_index = p_preset->get("xr_features/degrees_of_freedom"); // 0: none, 1: 3dof and 6dof, 2: 6dof
|
|
||||||
if (dof_index == 1) {
|
|
||||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"android.hardware.vr.headtracking\" android:required=\"false\" android:version=\"1\" />\n";
|
|
||||||
} else if (dof_index == 2) {
|
|
||||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"android.hardware.vr.headtracking\" android:required=\"true\" android:version=\"1\" />\n";
|
|
||||||
}
|
|
||||||
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
||||||
if (hand_tracking_index == 1) {
|
if (hand_tracking_index == 1) {
|
||||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"oculus.software.handtracking\" android:required=\"false\" />\n";
|
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"oculus.software.handtracking\" android:required=\"false\" />\n";
|
||||||
|
@ -278,10 +272,7 @@ String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||||
"tools:replace=\"android:screenOrientation\" "
|
"tools:replace=\"android:screenOrientation\" "
|
||||||
"android:screenOrientation=\"%s\">\n",
|
"android:screenOrientation=\"%s\">\n",
|
||||||
orientation);
|
orientation);
|
||||||
if (uses_xr) {
|
if (!uses_xr) {
|
||||||
String focus_awareness = bool_to_string(p_preset->get("xr_features/focus_awareness"));
|
|
||||||
manifest_activity_text += vformat(" <meta-data tools:node=\"replace\" android:name=\"com.oculus.vr.focusaware\" android:value=\"%s\" />\n", focus_awareness);
|
|
||||||
} else {
|
|
||||||
manifest_activity_text += " <meta-data tools:node=\"remove\" android:name=\"com.oculus.vr.focusaware\" />\n";
|
manifest_activity_text += " <meta-data tools:node=\"remove\" android:name=\"com.oculus.vr.focusaware\" />\n";
|
||||||
}
|
}
|
||||||
manifest_activity_text += " </activity>\n";
|
manifest_activity_text += " </activity>\n";
|
||||||
|
@ -289,16 +280,11 @@ String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String _get_application_tag(const Ref<EditorExportPreset> &p_preset) {
|
String _get_application_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||||
bool uses_xr = (int)(p_preset->get("xr_features/xr_mode")) == 1;
|
|
||||||
String manifest_application_text =
|
String manifest_application_text =
|
||||||
" <application android:label=\"@string/godot_project_name_string\"\n"
|
" <application android:label=\"@string/godot_project_name_string\"\n"
|
||||||
" android:allowBackup=\"false\" tools:ignore=\"GoogleAppIndexingWarning\"\n"
|
" android:allowBackup=\"false\" tools:ignore=\"GoogleAppIndexingWarning\"\n"
|
||||||
" android:icon=\"@mipmap/icon\">\n\n"
|
" android:icon=\"@mipmap/icon\">\n\n";
|
||||||
" <meta-data tools:node=\"remove\" android:name=\"xr_mode_metadata_name\" />\n";
|
|
||||||
|
|
||||||
if (uses_xr) {
|
|
||||||
manifest_application_text += " <meta-data tools:node=\"replace\" android:name=\"com.samsung.android.vr.application.mode\" android:value=\"vr_only\" />\n";
|
|
||||||
}
|
|
||||||
manifest_application_text += _get_activity_tag(p_preset);
|
manifest_application_text += _get_activity_tag(p_preset);
|
||||||
manifest_application_text += " </application>\n";
|
manifest_application_text += " </application>\n";
|
||||||
return manifest_application_text;
|
return manifest_application_text;
|
||||||
|
|
|
@ -30,11 +30,6 @@
|
||||||
<!-- The following metadata values are replaced when Godot exports, modifying them here has no effect. -->
|
<!-- The following metadata values are replaced when Godot exports, modifying them here has no effect. -->
|
||||||
<!-- Do these changes in the export preset. Adding new ones is fine. -->
|
<!-- Do these changes in the export preset. Adding new ones is fine. -->
|
||||||
|
|
||||||
<!-- XR mode metadata. This is modified by the exporter based on the selected xr mode. DO NOT CHANGE the values here. -->
|
|
||||||
<meta-data
|
|
||||||
android:name="xr_mode_metadata_name"
|
|
||||||
android:value="xr_mode_metadata_value" />
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".GodotApp"
|
android:name=".GodotApp"
|
||||||
android:label="@string/godot_project_name_string"
|
android:label="@string/godot_project_name_string"
|
||||||
|
@ -45,8 +40,8 @@
|
||||||
android:resizeableActivity="false"
|
android:resizeableActivity="false"
|
||||||
tools:ignore="UnusedAttribute" >
|
tools:ignore="UnusedAttribute" >
|
||||||
|
|
||||||
<!-- Focus awareness metadata is updated at export time if the user enables it in the 'Xr Features' section. -->
|
<!-- Focus awareness metadata is removed at export time if the xr mode is not VR. -->
|
||||||
<meta-data android:name="com.oculus.vr.focusaware" android:value="false" />
|
<meta-data android:name="com.oculus.vr.focusaware" android:value="true" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
Loading…
Reference in a new issue