Skip to content

Commit fa3242f

Browse files
committed
Update apk export to check vendor repo project settings
1 parent 21adb57 commit fa3242f

File tree

3 files changed

+23
-38
lines changed

3 files changed

+23
-38
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
local.properties
1818
/thirdparty/ovr_platform_sdk/
1919
/toolkit/src/gen/
20+
compile_commands.json
2021

2122
# Binaries
2223
*.o

toolkit/src/main/cpp/export/meta_toolkit_export_plugin.cpp

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,6 @@ PackedStringArray MetaToolkitExportPlugin::_get_android_libraries(const Ref<godo
223223
return dependencies;
224224
}
225225

226-
bool MetaToolkitExportPlugin::_is_eye_tracking_enabled() const {
227-
bool eye_tracking_project_setting_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/eye_gaze_interaction");
228-
if (!eye_tracking_project_setting_enabled) {
229-
return false;
230-
}
231-
232-
int eye_tracking_option_value = _get_int_option("meta_xr_features/eye_tracking", EYE_TRACKING_NONE_VALUE);
233-
return eye_tracking_option_value > EYE_TRACKING_NONE_VALUE;
234-
}
235-
236226
PackedStringArray MetaToolkitExportPlugin::_get_supported_devices() const {
237227
PackedStringArray supported_devices;
238228

@@ -265,48 +255,49 @@ void MetaToolkitExportPlugin::_get_manifest_entries(Vector<godot::String> &r_per
265255
r_metadata.append(supported_devices_metadata);
266256

267257
// Check for eye tracking.
268-
if (_is_eye_tracking_enabled()) {
258+
bool eye_tracking_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/eye_gaze_interaction");
259+
if (eye_tracking_enabled) {
269260
r_permissions.append("com.oculus.permission.EYE_TRACKING");
270261

271262
FeatureInfo eye_tracking_feature = {
272263
"oculus.software.eye_tracking",
273-
_get_int_option("meta_xr_features/eye_tracking", EYE_TRACKING_NONE_VALUE) == EYE_TRACKING_REQUIRED_VALUE,
264+
_get_int_option("meta_xr_features/eye_tracking", EYE_TRACKING_OPTIONAL_VALUE) == EYE_TRACKING_REQUIRED_VALUE,
274265
};
275266
r_features.append(eye_tracking_feature);
276267
}
277268

278269
// Check for face tracking.
279-
int face_tracking_value = _get_int_option("meta_xr_features/face_tracking", FACE_TRACKING_NONE_VALUE);
280-
if (face_tracking_value > FACE_TRACKING_NONE_VALUE) {
270+
bool face_tracking_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/face_tracking");
271+
if (face_tracking_enabled) {
281272
r_permissions.append("com.oculus.permission.FACE_TRACKING");
282273

283274
FeatureInfo face_tracking_info = {
284275
"oculus.software.face_tracking",
285-
face_tracking_value == FACE_TRACKING_REQUIRED_VALUE
276+
_get_int_option("meta_xr_features/face_tracking", FACE_TRACKING_OPTIONAL_VALUE) == FACE_TRACKING_REQUIRED_VALUE,
286277
};
287278
r_features.append(face_tracking_info);
288279
}
289280

290281
// Check for body tracking.
291-
int body_tracking_value = _get_int_option("meta_xr_features/body_tracking", BODY_TRACKING_NONE_VALUE);
292-
if (body_tracking_value > BODY_TRACKING_NONE_VALUE) {
282+
bool body_tracking_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/body_tracking");
283+
if (body_tracking_enabled) {
293284
r_permissions.append("com.oculus.permission.BODY_TRACKING");
294285

295286
FeatureInfo body_tracking_info = {
296287
"com.oculus.software.body_tracking",
297-
body_tracking_value == BODY_TRACKING_REQUIRED_VALUE
288+
_get_int_option("meta_xr_features/body_tracking", BODY_TRACKING_OPTIONAL_VALUE) == BODY_TRACKING_REQUIRED_VALUE,
298289
};
299290
r_features.append(body_tracking_info);
300291
}
301292

302293
// Check for hand tracking.
303-
int hand_tracking_value = _get_int_option("meta_xr_features/hand_tracking", HAND_TRACKING_NONE_VALUE);
304-
if (hand_tracking_value > HAND_TRACKING_NONE_VALUE) {
294+
bool hand_tracking_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/hand_tracking");
295+
if (hand_tracking_enabled) {
305296
r_permissions.append("com.oculus.permission.HAND_TRACKING");
306297

307298
FeatureInfo hand_tracking_info = {
308299
"oculus.software.handtracking",
309-
hand_tracking_value == HAND_TRACKING_REQUIRED_VALUE
300+
_get_int_option("meta_xr_features/hand_tracking", HAND_TRACKING_OPTIONAL_VALUE) == HAND_TRACKING_REQUIRED_VALUE,
310301
};
311302
r_features.append(hand_tracking_info);
312303

@@ -326,40 +317,41 @@ void MetaToolkitExportPlugin::_get_manifest_entries(Vector<godot::String> &r_per
326317
}
327318

328319
// Check for passthrough.
329-
int passthrough_mode = _get_int_option("meta_xr_features/passthrough", PASSTHROUGH_NONE_VALUE);
330-
if (passthrough_mode > PASSTHROUGH_NONE_VALUE) {
320+
bool passthrough_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/passthrough");
321+
if (passthrough_enabled) {
331322
FeatureInfo passthrough_info = {
332323
"com.oculus.feature.PASSTHROUGH",
333-
passthrough_mode == PASSTHROUGH_REQUIRED_VALUE
324+
_get_int_option("meta_xr_features/passthrough", PASSTHROUGH_OPTIONAL_VALUE) == PASSTHROUGH_REQUIRED_VALUE,
334325
};
335326
r_features.append(passthrough_info);
336327
}
337328

338329
// Check for render model.
339-
int render_model_value = _get_int_option("meta_xr_features/render_model", RENDER_MODEL_NONE_VALUE);
340-
if (render_model_value > RENDER_MODEL_NONE_VALUE) {
330+
bool render_model_enabled = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/render_model");
331+
if (render_model_enabled) {
341332
r_permissions.append("com.oculus.permission.RENDER_MODEL");
342333

343334
FeatureInfo render_model_info = {
344335
"com.oculus.feature.RENDER_MODEL",
345-
render_model_value == RENDER_MODEL_REQUIRED_VALUE
336+
_get_int_option("meta_xr_features/render_model", RENDER_MODEL_OPTIONAL_VALUE) == RENDER_MODEL_REQUIRED_VALUE,
346337
};
338+
r_features.append(render_model_info);
347339
}
348340

349341
// Check for anchor api.
350-
bool use_anchor_api = _get_bool_option("meta_xr_features/use_anchor_api");
342+
bool use_anchor_api = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/anchor_api");
351343
if (use_anchor_api) {
352344
r_permissions.append("com.oculus.permission.USE_ANCHOR_API");
353345
}
354346

355347
// Check for anchor sharing.
356-
bool use_anchor_sharing = _get_bool_option("meta_xr_features/use_anchor_sharing");
348+
bool use_anchor_sharing = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/anchor_sharing");
357349
if (use_anchor_sharing) {
358350
r_permissions.append("com.oculus.permission.IMPORT_EXPORT_IOT_MAP_DATA");
359351
}
360352

361353
// Check for scene api.
362-
bool use_scene_api = _get_bool_option("meta_xr_features/use_scene_api");
354+
bool use_scene_api = ProjectSettings::get_singleton()->get_setting_with_override("xr/openxr/extensions/meta/scene_api");
363355
if (use_scene_api) {
364356
r_permissions.append("com.oculus.permission.USE_SCENE");
365357
}

toolkit/src/main/cpp/include/export/meta_toolkit_export_plugin.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,21 @@ using namespace godot;
1010
class MetaToolkitExportPlugin : public EditorExportPlugin {
1111
GDCLASS(MetaToolkitExportPlugin, EditorExportPlugin)
1212

13-
static const int EYE_TRACKING_NONE_VALUE = 0;
1413
static const int EYE_TRACKING_OPTIONAL_VALUE = 1;
1514
static const int EYE_TRACKING_REQUIRED_VALUE = 2;
1615

17-
static const int FACE_TRACKING_NONE_VALUE = 0;
1816
static const int FACE_TRACKING_OPTIONAL_VALUE = 1;
1917
static const int FACE_TRACKING_REQUIRED_VALUE = 2;
2018

21-
static const int BODY_TRACKING_NONE_VALUE = 0;
2219
static const int BODY_TRACKING_OPTIONAL_VALUE = 1;
2320
static const int BODY_TRACKING_REQUIRED_VALUE = 2;
2421

25-
static const int PASSTHROUGH_NONE_VALUE = 0;
2622
static const int PASSTHROUGH_OPTIONAL_VALUE = 1;
2723
static const int PASSTHROUGH_REQUIRED_VALUE = 2;
2824

29-
static const int RENDER_MODEL_NONE_VALUE = 0;
3025
static const int RENDER_MODEL_OPTIONAL_VALUE = 1;
3126
static const int RENDER_MODEL_REQUIRED_VALUE = 2;
3227

33-
static const int HAND_TRACKING_NONE_VALUE = 0;
3428
static const int HAND_TRACKING_OPTIONAL_VALUE = 1;
3529
static const int HAND_TRACKING_REQUIRED_VALUE = 2;
3630

@@ -90,8 +84,6 @@ class MetaToolkitExportPlugin : public EditorExportPlugin {
9084

9185
bool _is_plugin_enabled() const;
9286

93-
bool _is_eye_tracking_enabled() const;
94-
9587
void _get_manifest_entries(Vector<String> &r_permissions, Vector<FeatureInfo> &r_features, Vector<MetadataInfo> &r_metadata) const;
9688

9789
PackedStringArray _get_supported_devices() const;

0 commit comments

Comments
 (0)