Skip to content

Commit

Permalink
Rename the Godot OpenXR Loaders plugin to Godot OpenXR Vendors plugin (
Browse files Browse the repository at this point in the history
…#55)

This reflects the expansion in roles and capabilities of the plugin.
  • Loading branch information
m4gr3d authored Oct 25, 2023
1 parent dd9a4e2 commit a3499d9
Show file tree
Hide file tree
Showing 49 changed files with 181 additions and 262 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build-addon-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@ jobs:
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Create Godot OpenXR loader AARs
- name: Create Godot OpenXR Vendors AARs
run: |
cd aar
./gradlew build
cd ..
# GODOT 4.2 ADDON GENERATION SECTION
- name: Create Godot OpenXR loader Addon
- name: Create Godot OpenXR Vendors Addon
run: |
mkdir asset
cp -r aar/demo/addons asset
cp aar/CHANGES.md asset/addons/godotopenxr/GodotOpenXRLoaders_CHANGES.md
cp aar/CHANGES.md asset/addons/godotopenxrvendors/GodotOpenXRVendors_CHANGES.md
- name: Adding vendor licences
run: |
cp aar/godotopenxrmeta/LICENSE.txt asset/addons/godotopenxr/export/meta/
cp aar/godotopenxrpico/src/main/jniLibs/arm64-v8a/README.md asset/addons/godotopenxr/export/pico/LICENSE.md
cp aar/godotopenxrkhr/LICENSE asset/addons/godotopenxr/export/khr/LICENSE
- name: Create Godot OpenXR loader addon artifact
cp aar/godotopenxrmeta/LICENSE.txt asset/addons/godotopenxrvendors/meta/
cp aar/godotopenxrpico/src/main/jniLibs/arm64-v8a/README.md asset/addons/godotopenxrvendors/pico/LICENSE.md
cp aar/godotopenxrkhronos/LICENSE asset/addons/godotopenxrvendors/khronos/LICENSE
- name: Create Godot OpenXR Vendor addon artifact
uses: actions/upload-artifact@v3
with:
name: GodotOpenXRLoadersAddon
name: GodotOpenXRVendorsAddon
path: |
asset
- name: Zip addon
run: |
zip -qq -r godotopenxrloadersaddon.zip asset
zip -qq -r godotopenxrvendorsaddon.zip asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
- name: Create and upload asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "godotopenxrloadersaddon.zip"
artifacts: "godotopenxrvendorsaddon.zip"
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Update the directory structure for the v2 plugin
- Update Meta OpenXR mobile SDK to version 57
- Update the java version to 17
- Rename the plugin to 'Godot OpenXR Vendors'

## 1.1.0
- Update Meta OpenXR loader to version 54
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Godot OpenXR Loaders
# Godot OpenXR Vendors plugin

This repository builds the Android plugin addon required for Godot 4.2 (and higher) to export XR
applications to the Android devices.
This plugin provides the functionality to support vendor-specific XR
devices (e.g: Meta, Pico devices) and access vendor-specific OpenXR extensions

**Note:**

Expand Down Expand Up @@ -50,19 +50,22 @@ If you have build the asset from source, you need to create the `addons` folder
if it doesn't exist already, and then copy the content of the `demo/addons` folder to `addons`
in your project.

Once the asset is added to your project, navigate to `Project` -> `Project Settings...` -> `Plugins`
and enable the plugin.

### Configuring your export

Back in Godot open the `Project` menu and select `Export...`:
- If it doesn't already exist, create an Android export configuration by pressing `Add...` and
selecting `Android`
- Tick the `Use Gradle Build` tickbox
- Select `OpenXR` as the **XR Mode** under the **XR Features** section
- Enable the loader you need to use
- Enable the XR vendor you need to use
- Scroll down to the bottom to see additional features for specific platforms.

**Note:**
**Do not** select multiple loaders in the same export template!
You can instead create multiple export templates, one for each loader.
**Do not** select multiple vendors in the same export template!
You can instead create multiple export templates, one for each vendor.

## License

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:$versions.gradlePluginVersion"
classpath "io.github.gradle-nexus:publish-plugin:$versions.nexusPublishVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion"
}
}

Expand Down
4 changes: 3 additions & 1 deletion config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ ext {
minSdk : 21,
targetSdk : 33,
javaVersion : JavaVersion.VERSION_17,
nexusPublishVersion : '1.3.0'
nexusPublishVersion : '1.3.0',
kotlinVersion : '1.7.22',
coreKtxVersion : '1.12.0',
]

libraries = [
Expand Down
2 changes: 1 addition & 1 deletion demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Godot 4+ specific ignores
.godot/
/addons/godotopenxr/.bin/**/*.aar
/addons/godotopenxrvendors/*/.bin
/android/
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const META_VENDOR_NAME = "meta"
const PICO_VENDOR_NAME = "pico"
const LYNX_VENDOR_NAME = "lynx"
const KHRONOS_VENDOR_NAME = "khr"
const KHRONOS_VENDOR_NAME = "khronos"

const VENDORS_LIST = [
META_VENDOR_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var globals = preload("globals.gd")
var meta_export_plugin : GodotOpenXREditorExportPlugin
var pico_export_plugin : GodotOpenXREditorExportPlugin
var lynx_export_plugin : GodotOpenXREditorExportPlugin
var khr_export_plugin : GodotOpenXREditorExportPlugin
var khronos_export_plugin : GodotOpenXREditorExportPlugin


func _enter_tree():
Expand All @@ -23,26 +23,26 @@ func _enter_tree():
lynx_export_plugin = preload("lynx/godot_openxr_lynx_editor_export_plugin.gd").new()
lynx_export_plugin._setup(globals.LYNX_VENDOR_NAME, plugin_version)

khr_export_plugin = preload("khr/godot_openxr_khr_editor_export_plugin.gd").new()
khr_export_plugin._setup(globals.KHRONOS_VENDOR_NAME, plugin_version)
khronos_export_plugin = preload("khronos/godot_openxr_khronos_editor_export_plugin.gd").new()
khronos_export_plugin._setup(globals.KHRONOS_VENDOR_NAME, plugin_version)

add_export_plugin(meta_export_plugin)
add_export_plugin(pico_export_plugin)
add_export_plugin(lynx_export_plugin)
add_export_plugin(khr_export_plugin)
add_export_plugin(khronos_export_plugin)


func _exit_tree():
# Cleaning up the export plugins
remove_export_plugin(meta_export_plugin)
remove_export_plugin(pico_export_plugin)
remove_export_plugin(lynx_export_plugin)
remove_export_plugin(khr_export_plugin)
remove_export_plugin(khronos_export_plugin)

meta_export_plugin = null
pico_export_plugin = null
lynx_export_plugin = null
khr_export_plugin = null
khronos_export_plugin = null


class GodotOpenXREditorExportPlugin extends EditorExportPlugin:
Expand All @@ -67,12 +67,12 @@ class GodotOpenXREditorExportPlugin extends EditorExportPlugin:
# If this is not available, we fall back to the maven central dependency
func _get_android_aar_file_path(debug: bool) -> String:
var debug_label = "debug" if debug else "release"
return "res://addons/godotopenxr/.bin/" + _vendor + "/" + debug_label + "/godotopenxr" + _vendor + "-" + debug_label + ".aar"
return "res://addons/godotopenxrvendors/" + _vendor + "/.bin/" + debug_label + "/godotopenxr" + _vendor + "-" + debug_label + ".aar"


# Maven central dependency used as fall back when the Android library aar file is not available
func _get_android_maven_central_dependency() -> String:
return "org.godotengine:godot-openxr-loaders-" + _vendor + ":" + _plugin_version
return "org.godotengine:godot-openxr-vendors-" + _vendor + ":" + _plugin_version


func _get_vendor_toggle_option_name(vendor_name: String = _vendor) -> String:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[plugin]

name="GodotOpenXR"
description="Godot OpenXR loader plugin"
name="GodotOpenXRVendors"
description="Godot OpenXR Vendors plugin"
author="https://github.com/GodotVR/godot_openxr_loaders/blob/master/CONTRIBUTORS.md"
version="2.0.0-dev-SNAPSHOT"
script="export/godot_openxr_export_plugin.gd"
script="godot_openxr_export_plugin.gd"
8 changes: 4 additions & 4 deletions demo/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ architectures/x86=false
architectures/x86_64=false
version/code=1
version/name="1.0"
package/unique_name="org.godotengine.openxr.demo"
package/unique_name="org.godotengine.openxr.vendors.demo"
package/name=""
package/signed=true
package/app_category=2
Expand Down Expand Up @@ -201,11 +201,11 @@ permissions/write_sync_settings=false
permissions/write_user_dictionary=false
xr_features/enable_meta_plugin=true
meta_xr_features/hand_tracking=1
meta_xr_features/hand_tracking_frequency=0
meta_xr_features/passthrough=1
meta_xr_features/hand_tracking_frequency=1
meta_xr_features/passthrough=0
xr_features/enable_pico_plugin=false
xr_features/enable_lynx_plugin=false
xr_features/enable_khr_plugin=false
xr_features/enable_khronos_plugin=false
meta_xr_features/eye_tracking=1
meta_xr_features/quest_1_support=false
meta_xr_features/quest_2_support=true
Expand Down
2 changes: 1 addition & 1 deletion demo/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ settings/stdout/verbose_stdout=true

[editor_plugins]

enabled=PackedStringArray("res://addons/godotopenxr/plugin.cfg")
enabled=PackedStringArray("res://addons/godotopenxrvendors/plugin.cfg")

[rendering]

Expand Down
21 changes: 0 additions & 21 deletions godotopenxrkhr/proguard-rules.pro

This file was deleted.

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion godotopenxrkhr/README.md → godotopenxrkhronos/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Godot OpenXR KHR Android loader
# Godot OpenXR Khronos Android plugin

Binaries taken from the Official OpenXR working group repo at:
https://github.com/KhronosGroup/OpenXR-SDK-Source/releases/download/release-1.0.26/openxr_loader_for_android-1.0.26.aar
Expand Down
25 changes: 12 additions & 13 deletions godotopenxrkhr/build.gradle → godotopenxrkhronos/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}


ext {
PUBLISH_ARTIFACT_ID = 'godot-openxr-loaders-khr'
PUBLISH_ARTIFACT_ID = 'godot-openxr-vendors-khronos'
}

apply from: "../scripts/publish-module.gradle"
Expand All @@ -22,14 +23,7 @@ android {
}
}

namespace = "org.godotengine.openxrloaders.khr"

buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
namespace = "org.godotengine.openxr.vendors.khronos"

packagingOptions {
doNotStrip '**/*.so'
Expand All @@ -40,6 +34,10 @@ android {
targetCompatibility versions.javaVersion
}

kotlinOptions {
jvmTarget = versions.javaVersion
}

publishing {
singleVariant("release") {
withSourcesJar()
Expand All @@ -49,19 +47,20 @@ android {
}

dependencies {
implementation "androidx.core:core-ktx:$versions.coreKtxVersion"
compileOnly libraries.godotAndroidLib
}

task copyDebugAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrkhr-debug.aar'
into '../demo/addons/godotopenxr/.bin/khr/debug'
include 'godotopenxrkhronos-debug.aar'
into '../demo/addons/godotopenxrvendors/khronos/.bin/debug'
}

task copyReleaseAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrkhr-release.aar'
into '../demo/addons/godotopenxr/.bin/khr/release'
include 'godotopenxrkhronos-release.aar'
into '../demo/addons/godotopenxrvendors/khronos/.bin/release'
}

assemble.finalizedBy(copyDebugAARToAddons)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.godotengine.openxrloaders.khr">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Tell the system this app works in either 3dof or 6dof mode -->
<uses-feature
Expand All @@ -21,8 +20,8 @@

<application>
<meta-data
android:name="org.godotengine.plugin.v2.GodotOpenXRKHR"
android:value="org.godotengine.openxrloaders.khr.GodotOpenXRKHR" />
android:name="org.godotengine.plugin.v2.GodotOpenXRKhronos"
android:value="org.godotengine.openxr.vendors.khronos.GodotOpenXRKhronos" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.godotengine.openxr.vendors.khronos

import org.godotengine.godot.Godot
import org.godotengine.godot.plugin.GodotPlugin

/**
* \brief GodotOpenXRKhronos is the OpenXR Khronos plugin for Godot.
*
* When using OpenXR for your application on Android make sure that
* the IMMERSIVE_HMD category is added to your activities intent-filter.
*
* <intent-filter>
* <action android:name="android.intent.action.MAIN"></action>
* <category android:name="android.intent.category.LAUNCHER"></category>
* <category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD"></category>
</intent-filter> *
*
* more details can be found here:
* https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#android-runtime-category
*
*/
class GodotOpenXRKhronos(godot: Godot?) : GodotPlugin(godot) {
override fun getPluginName(): String {
return "GodotOpenXRKhronos"
}
}
Loading

0 comments on commit a3499d9

Please sign in to comment.