├── docs ├── img │ └── logo.png ├── .python-version ├── .gitignore ├── _templates │ └── breadcrumbs.html ├── manual │ ├── img │ │ └── xr_simulator_tool.png │ ├── platform_sdk │ │ ├── img │ │ │ ├── downloadable_content_dlc_export.png │ │ │ └── downloadable_content_project_export.png │ │ └── index.rst │ └── xr_simulator.rst ├── requirements.txt ├── Makefile ├── make.bat ├── index.rst ├── README.md ├── conf.py └── _static │ └── css │ └── custom.css ├── thirdparty ├── ovr_platform_sdk │ └── .keep └── godot_cpp_build_profile │ ├── build_profile.json │ └── create_build_profile.py ├── demo ├── local.gd.uid ├── main.gd.uid ├── raycast.gd.uid ├── addons │ └── godot_meta_toolkit │ │ ├── .gitignore │ │ ├── toolkit.gdextension.uid │ │ └── toolkit.gdextension ├── .gitattributes ├── .gitignore ├── raycast.gd ├── dlc │ └── durable_addon.tscn ├── project.godot ├── icon.svg ├── icon.svg.import └── README.md ├── toolkit ├── .gitignore ├── src │ └── main │ │ ├── assets │ │ └── .gitignore │ │ ├── cpp │ │ ├── include │ │ │ ├── register_types.h │ │ │ ├── util.h │ │ │ ├── platform_sdk │ │ │ │ └── meta_platform_sdk_request.h │ │ │ ├── editor │ │ │ │ ├── meta_toolkit_editor_plugin.h │ │ │ │ └── meta_xr_simulator_dialog.h │ │ │ └── export │ │ │ │ └── meta_toolkit_export_plugin.h │ │ ├── platform_sdk │ │ │ └── meta_platform_sdk_request.cpp │ │ ├── editor │ │ │ └── meta_toolkit_editor_plugin.cpp │ │ └── register_types.cpp │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── meta │ │ └── w4 │ │ └── godot │ │ └── toolkit │ │ └── GodotMetaToolkit.kt ├── CMakeLists.txt └── build.gradle ├── .gitattributes ├── .gitmodules ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── doc_classes ├── MetaPlatformSDK_BlockedUser.xml ├── MetaPlatformSDK_Pid.xml ├── MetaPlatformSDK_CowatchingState.xml ├── MetaPlatformSDK_PartyID.xml ├── MetaPlatformSDK_SendInvitesResult.xml ├── MetaPlatformSDK_UserProof.xml ├── MetaPlatformSDK_ShareMediaResult.xml ├── MetaPlatformSDK_AbuseReportRecording.xml ├── MetaPlatformSDK_AvatarEditorResult.xml ├── MetaPlatformSDK_RejoinDialogResult.xml ├── MetaPlatformSDK_UserDataStoreUpdateResponse.xml ├── MetaPlatformSDK_InvitePanelResultInfo.xml ├── MetaPlatformSDK_OrgScopedID.xml ├── MetaPlatformSDK_UserAccountAgeCategory.xml ├── MetaPlatformSDK_NetSyncSetSessionPropertyResult.xml ├── MetaPlatformSDK_PushNotificationResult.xml ├── MetaPlatformSDK_LaunchInvitePanelFlowResult.xml ├── MetaPlatformSDK_PlatformInitialize.xml ├── MetaPlatformSDK_AvatarEditorOptions.xml ├── MetaPlatformSDK_UserReportID.xml ├── MetaPlatformSDK_LivestreamingStartResult.xml ├── MetaPlatformSDK_CowatchViewer.xml ├── MetaPlatformSDK_LivestreamingApplicationStatus.xml ├── MetaPlatformSDK_AssetFileDownloadResult.xml ├── MetaPlatformSDK_SupplementaryMetric.xml ├── MetaPlatformSDK_NetSyncVoipAttenuationValue.xml ├── MetaPlatformSDK_CowatchViewerUpdate.xml ├── MetaPlatformSDK_MultiplayerErrorOptions.xml ├── MetaPlatformSDK_LaunchReportFlowResult.xml ├── MetaPlatformSDK_LaunchUnblockFlowResult.xml ├── MetaPlatformSDK_LaunchBlockFlowResult.xml ├── MetaPlatformSDK_SdkAccount.xml ├── MetaPlatformSDK_AchievementUpdate.xml ├── MetaPlatformSDK_PaidOffer.xml ├── MetaPlatformSDK_AppDownloadResult.xml ├── MetaPlatformSDK_InviteOptions.xml ├── MetaPlatformSDK_MicrophoneAvailabilityState.xml ├── MetaPlatformSDK_LaunchFriendRequestFlowResult.xml ├── MetaPlatformSDK_SystemVoipState.xml ├── MetaPlatformSDK_NetSyncSessionsChangedNotification.xml ├── MetaPlatformSDK_AssetFileDeleteResult.xml ├── MetaPlatformSDK_LanguagePackInfo.xml ├── MetaPlatformSDK_Request.xml ├── MetaPlatformSDK_BillingPlan.xml ├── MetaPlatformSDK_AssetFileDownloadCancelResult.xml ├── MetaPlatformSDK_Packet.xml ├── MetaPlatformSDK_PidArray.xml ├── MetaPlatformSDK_LinkedAccount.xml ├── MetaPlatformSDK_LivestreamingVideoStats.xml ├── MetaPlatformSDK_RosterOptions.xml ├── MetaPlatformSDK_SdkAccountArray.xml ├── MetaPlatformSDK_TrialOfferArray.xml ├── MetaPlatformSDK_AssetDetailsArray.xml ├── MetaPlatformSDK_BillingPlanArray.xml ├── MetaPlatformSDK_AbuseReportOptions.xml ├── MetaPlatformSDK_LinkedAccountArray.xml ├── MetaPlatformSDK_NetSyncSessionArray.xml ├── MetaPlatformSDK_AppDownloadProgressResult.xml ├── MetaPlatformSDK_InstalledApplicationArray.xml ├── MetaPlatformSDK_Price.xml ├── MetaPlatformSDK_Leaderboard.xml ├── MetaPlatformSDK_AssetFileDownloadUpdate.xml ├── MetaPlatformSDK_GroupPresenceLeaveIntent.xml ├── MetaPlatformSDK_NetSyncVoipAttenuationValueArray.xml ├── MetaPlatformSDK_TrialOffer.xml ├── MetaPlatformSDK_HttpTransferUpdate.xml ├── MetaPlatformSDK_UserCapability.xml ├── MetaPlatformSDK_AchievementDefinition.xml ├── MetaPlatformSDK_NetSyncSession.xml ├── MetaPlatformSDK_NetSyncOptions.xml ├── MetaPlatformSDK_Party.xml ├── MetaPlatformSDK_GroupPresenceJoinIntent.xml ├── MetaPlatformSDK_AchievementProgress.xml ├── MetaPlatformSDK_InstalledApplication.xml ├── MetaPlatformSDK_UserArray.xml ├── MetaPlatformSDK_LeaderboardUpdateStatus.xml ├── MetaPlatformSDK_ProductArray.xml ├── MetaPlatformSDK_PurchaseArray.xml ├── MetaPlatformSDK_DestinationArray.xml ├── MetaPlatformSDK_BlockedUserArray.xml ├── MetaPlatformSDK_CowatchViewerArray.xml ├── MetaPlatformSDK_UserCapabilityArray.xml ├── MetaPlatformSDK_ApplicationInviteArray.xml ├── MetaPlatformSDK_NetSyncConnection.xml ├── MetaPlatformSDK_Destination.xml ├── MetaPlatformSDK_AchievementDefinitionArray.xml ├── MetaPlatformSDK_AchievementProgressArray.xml ├── MetaPlatformSDK_LivestreamingStatus.xml ├── MetaPlatformSDK_UserOptions.xml ├── MetaPlatformSDK_DataStore.xml ├── MetaPlatformSDK_ApplicationInvite.xml ├── MetaPlatformSDK_ApplicationVersion.xml ├── MetaPlatformSDK_LeaderboardArray.xml ├── MetaPlatformSDK_ApplicationOptions.xml ├── MetaPlatformSDK_Error.xml ├── MetaPlatformSDK_PartyUpdateNotification.xml ├── MetaPlatformSDK_ChallengeArray.xml ├── MetaPlatformSDK_Purchase.xml ├── MetaPlatformSDK_ChallengeEntryArray.xml ├── MetaPlatformSDK_LeaderboardEntryArray.xml ├── MetaPlatformSDK_AssetDetails.xml ├── MetaPlatformSDK_ChallengeEntry.xml ├── MetaPlatformSDK_LaunchDetails.xml ├── MetaPlatformSDK_ManagedInfo.xml ├── MetaPlatformSDK_ContentRating.xml ├── MetaPlatformSDK_Challenge.xml ├── MetaPlatformSDK_AdvancedAbuseReportOptions.xml ├── MetaPlatformSDK_GroupPresenceOptions.xml ├── MetaPlatformSDK_LeaderboardEntry.xml └── MetaPlatformSDK_Product.xml ├── .github └── workflows │ ├── static_checks.yml │ ├── documentation.yml │ └── scripts │ ├── clang_format.sh │ └── file_format.sh ├── scripts └── update_doc_classes_xml.sh ├── settings.gradle ├── CHANGES.md ├── LICENSE.txt ├── config.gradle ├── gradle.properties ├── README.md ├── gradlew.bat └── SConstruct /docs/img/logo.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.python-version: -------------------------------------------------------------------------------- 1 | 3.10.6 2 | -------------------------------------------------------------------------------- /thirdparty/ovr_platform_sdk/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/local.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dgqj2064jec2n 2 | -------------------------------------------------------------------------------- /demo/main.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bp3gnieyxmcir 2 | -------------------------------------------------------------------------------- /demo/raycast.gd.uid: -------------------------------------------------------------------------------- 1 | uid://qb2g8p5s3m8x 2 | -------------------------------------------------------------------------------- /toolkit/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /gen 3 | /src/main/libs 4 | -------------------------------------------------------------------------------- /toolkit/src/main/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /demo/addons/godot_meta_toolkit/.gitignore: -------------------------------------------------------------------------------- 1 | .bin/ 2 | build/ 3 | -------------------------------------------------------------------------------- /demo/addons/godot_meta_toolkit/toolkit.gdextension.uid: -------------------------------------------------------------------------------- 1 | uid://dm6egj4nekw7o 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.so filter=lfs diff=lfs merge=lfs -text 2 | *.dll filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /demo/.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize EOL for all files that Git considers text files. 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /api/ 2 | /_build/ 3 | .env 4 | __pycache__ 5 | *.pyc 6 | /.vscode/ 7 | /python.env/ 8 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # Godot 4+ specific ignores 2 | .godot/ 3 | android/ 4 | 5 | addons/godotopenxrvendors/ 6 | local.gd 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "thirdparty/godot-cpp"] 2 | path = thirdparty/godot-cpp 3 | url = https://github.com/godotengine/godot-cpp 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-sdk-integrations/godot-meta-toolkit/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /docs/_templates/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {%- extends "sphinx_rtd_theme/breadcrumbs.html" %} 2 | 3 | {% block breadcrumbs_aside %} 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /docs/manual/img/xr_simulator_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-sdk-integrations/godot-meta-toolkit/HEAD/docs/manual/img/xr_simulator_tool.png -------------------------------------------------------------------------------- /docs/manual/platform_sdk/img/downloadable_content_dlc_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-sdk-integrations/godot-meta-toolkit/HEAD/docs/manual/platform_sdk/img/downloadable_content_dlc_export.png -------------------------------------------------------------------------------- /docs/manual/platform_sdk/img/downloadable_content_project_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godot-sdk-integrations/godot-meta-toolkit/HEAD/docs/manual/platform_sdk/img/downloadable_content_project_export.png -------------------------------------------------------------------------------- /docs/manual/platform_sdk/index.rst: -------------------------------------------------------------------------------- 1 | :github_url: hide 2 | 3 | Platform SDK 4 | ============ 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | :name: toc-manual-platform-sdk 9 | 10 | getting_started 11 | in_app_purchases 12 | downloadable_content 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 25 17:51:26 PDT 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/include/register_types.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | using namespace godot; 8 | 9 | void initialize_toolkit_module(ModuleInitializationLevel p_level); 10 | void terminate_toolkit_module(ModuleInitializationLevel p_level); 11 | -------------------------------------------------------------------------------- /toolkit/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | /.vscode/ 12 | /.cache/ 13 | .DS_Store 14 | /build 15 | /captures 16 | .externalNativeBuild 17 | .cxx 18 | local.properties 19 | /thirdparty/ovr_platform_sdk/ 20 | /toolkit/src/gen/ 21 | compile_commands.json 22 | 23 | # Binaries 24 | *.o 25 | *.os 26 | *.obj 27 | *.bc 28 | *.pyc 29 | *.dblite 30 | *.pdb 31 | *.lib 32 | -------------------------------------------------------------------------------- /demo/raycast.gd: -------------------------------------------------------------------------------- 1 | extends RayCast3D 2 | 3 | @onready var mesh_instance_3d: MeshInstance3D = $MeshInstance3D 4 | 5 | func _process(delta: float) -> void: 6 | var mat = mesh_instance_3d.get_surface_override_material(0) 7 | 8 | if not is_colliding(): 9 | mesh_instance_3d.mesh.height = 10 10 | mesh_instance_3d.position.y = -5 11 | mat.albedo_color = Color.RED 12 | else: 13 | var height = (get_collision_point() - global_position).length() 14 | mesh_instance_3d.mesh.height = height 15 | mesh_instance_3d.position.y = -(height / 2) 16 | mat.albedo_color = Color.GREEN 17 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/include/util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | struct CharStringList { 8 | LocalVector list; 9 | LocalVector pointers; 10 | 11 | CharStringList(const PackedStringArray &p_array) { 12 | list.resize(p_array.size()); 13 | pointers.resize(p_array.size()); 14 | for (int i = 0; i < p_array.size(); i++) { 15 | list[i] = p_array[i].utf8(); 16 | pointers[i] = list[i].get_data(); 17 | } 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | alabaster==0.7.13 2 | Babel==2.12.1 3 | certifi==2022.12.7 4 | charset-normalizer==3.1.0 5 | docutils==0.18.1 6 | idna==3.4 7 | imagesize==1.4.1 8 | Jinja2==3.1.2 9 | MarkupSafe==2.1.2 10 | packaging==23.1 11 | Pygments==2.15.1 12 | requests==2.29.0 13 | snowballstemmer==2.2.0 14 | Sphinx==6.2.1 15 | sphinx-rtd-theme==1.2.0 16 | sphinxcontrib-applehelp==1.0.4 17 | sphinxcontrib-devhelp==1.0.2 18 | sphinxcontrib-htmlhelp==2.0.1 19 | sphinxcontrib-jquery==4.1 20 | sphinxcontrib-jsmath==1.0.1 21 | sphinxcontrib-qthelp==1.0.3 22 | sphinxcontrib-serializinghtml==1.1.5 23 | urllib3==1.26.15 24 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/platform_sdk/meta_platform_sdk_request.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #include "platform_sdk/meta_platform_sdk_request.h" 4 | 5 | #include 6 | 7 | void MetaPlatformSDK_Request::_bind_methods() { 8 | ClassDB::bind_method(D_METHOD("get_id"), &MetaPlatformSDK_Request::get_id); 9 | ADD_SIGNAL(MethodInfo("completed", PropertyInfo(Variant::OBJECT, "message", PROPERTY_HINT_RESOURCE_TYPE, "MetaPlatformSDK_Message"))); 10 | } 11 | 12 | MetaPlatformSDK_Request::MetaPlatformSDK_Request() { 13 | } 14 | -------------------------------------------------------------------------------- /demo/dlc/durable_addon.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=3 uid="uid://bxyiss6phjvb4"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://cmm67scocnrpg" path="res://icon.svg" id="1_vnc7s"] 4 | 5 | [node name="DurableAddon" type="Node3D" unique_id=1042427277] 6 | 7 | [node name="Label3D" type="Label3D" parent="." unique_id=415037986] 8 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.22882777, 0) 9 | text = "This is Durable 10 | Addon DLC!" 11 | 12 | [node name="Sprite3D" type="Sprite3D" parent="." unique_id=856975715] 13 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1061535, 0) 14 | pixel_size = 0.005 15 | texture = ExtResource("1_vnc7s") 16 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_BlockedUser.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a blocked user. 5 | 6 | 7 | Represents a blocked user. 8 | 9 | 10 | 11 | 12 | 13 | User ID that has been blocked by the logged in user. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.github/workflows/static_checks.yml: -------------------------------------------------------------------------------- 1 | name: 📊 Static Checks 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | static-checks: 7 | name: Formatting (clang-format, file format) 8 | runs-on: ubuntu-22.04 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v4 12 | 13 | - name: Install dependencies 14 | run: | 15 | sudo apt-get install -qq dos2unix recode clang-format 16 | 17 | - name: File formatting checks (file_format.sh) 18 | run: | 19 | bash ./.github/workflows/scripts/file_format.sh 20 | 21 | - name: Style checks via clang-format (clang_format.sh) 22 | run: | 23 | bash ./.github/workflows/scripts/clang_format.sh 24 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Pid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a PID. 5 | 6 | 7 | Represents a PID. 8 | 9 | 10 | 11 | 12 | 13 | Unique identifier assigned to each process running in a system, used for tracking and managing purposes. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /scripts/update_doc_classes_xml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 4 | 5 | GODOT=${GODOT:-godot} 6 | PROJECT=${PROJECT:-$SCRIPT_DIR/../demo} 7 | 8 | die() { 9 | echo "$@" >/dev/stderr 10 | exit 1 11 | } 12 | 13 | # Regenerate the XML data from the API. 14 | $GODOT --doctool "$SCRIPT_DIR/.." --path "$PROJECT" --gdextension-docs --xr-mode off \ 15 | || die "Failed to regenerate XML using Godot's --doctool" 16 | 17 | if [ -n "$GODOT_OPENXR_VENDORS_SOURCE" ]; then 18 | openxr_vendors_classes=$(cd "$GODOT_OPENXR_VENDORS_SOURCE/doc_classes" && ls *.xml) 19 | for x in $openxr_vendors_classes; do 20 | rm -f "$SCRIPT_DIR/../doc_classes/$x" 21 | done 22 | fi 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_CowatchingState.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the cowatching state. 5 | 6 | 7 | Represents the cowatching state. 8 | 9 | 10 | 11 | 12 | 13 | Indicates if the current user is in a cowatching session. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PartyID.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a party ID. 5 | 6 | 7 | Represents a party ID. 8 | 9 | 10 | 11 | 12 | 13 | The party ID can be used to retrieve a [MetaPlatformSDK_Party]. Every party will have a unique ID that is associated with it. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_SendInvitesResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of sending invites. 5 | 6 | 7 | Represents the result of sending invites. 8 | 9 | 10 | 11 | 12 | 13 | The list of invites that was sent. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserProof.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents proof that this user is logged in. 5 | 6 | 7 | Represents proof that this user is logged in. 8 | 9 | 10 | 11 | 12 | 13 | A one-time use string, used to prove this user is logged in. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ShareMediaResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of sharing media. 5 | 6 | 7 | Represents the result of sharing media. 8 | 9 | 10 | 11 | 12 | 13 | The status of the share media result. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AbuseReportRecording.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an abuse report recording. 5 | 6 | 7 | Represents an abuse report recording. 8 | 9 | 10 | 11 | 12 | 13 | A UUID associated with the Abuse Report recording. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AvatarEditorResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of requesting the avatar editor. 5 | 6 | 7 | Represents the result of requesting the avatar editor. 8 | 9 | 10 | 11 | 12 | 13 | Whether the request has sent. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_RejoinDialogResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of the rejoin dialog. 5 | 6 | 7 | Represents the result of the rejoin dialog. 8 | 9 | 10 | 11 | 12 | 13 | Will be [code]true[/code] if the user decided to rejoin. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserDataStoreUpdateResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the response to a user data store update. 5 | 6 | 7 | Represents the response to a user data store update. 8 | 9 | 10 | 11 | 12 | 13 | Whether the update request was successful. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_InvitePanelResultInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result to using the invite panel. 5 | 6 | 7 | Represents the result to using the invite panel. 8 | 9 | 10 | 11 | 12 | 13 | A boolean for whether or not any invites has been sent. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_OrgScopedID.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an ID which is unique per organization. 5 | 6 | 7 | Represents an ID which is unique per organization. Allows different apps within the same organization to identify the user. 8 | 9 | 10 | 11 | 12 | 13 | The org-scoped ID number. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserAccountAgeCategory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a user account age category. 5 | 6 | 7 | Represents a user account age category. 8 | 9 | 10 | 11 | 12 | 13 | Age category of the user's Meta account. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncSetSessionPropertyResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of setting a net sync property. 5 | 6 | 7 | Represents the result of setting a net sync property. 8 | 9 | 10 | 11 | 12 | 13 | Which session the operation was modifying. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | apply from: 'config.gradle' 3 | 4 | plugins { 5 | id 'com.android.library' version versions.gradlePluginVersion 6 | id 'org.jetbrains.kotlin.android' version versions.kotlinVersion 7 | } 8 | 9 | repositories { 10 | google() 11 | mavenCentral() 12 | gradlePluginPortal() 13 | } 14 | } 15 | 16 | dependencyResolutionManagement { 17 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 18 | repositories { 19 | google() 20 | mavenCentral() 21 | maven { url "https://plugins.gradle.org/m2/" } 22 | maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/"} 23 | } 24 | } 25 | 26 | rootProject.name = "Godot Meta Toolkit" 27 | include ':toolkit' 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PushNotificationResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of registering for push notifications. 5 | 6 | 7 | Represents the result of registering for push notifications. 8 | 9 | 10 | 11 | 12 | 13 | The registered notification ID, which you can push notifications to. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LaunchInvitePanelFlowResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of launching the invite panel flow. 5 | 6 | 7 | Represents the result of launching the invite panel flow. 8 | 9 | 10 | 11 | 12 | 13 | A list of users that were sent an invitation to the session. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PlatformInitialize.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of initializing the Meta Platform SDK. 5 | 6 | 7 | Represents the result of initializing the Meta Platform SDK. 8 | 9 | 10 | 11 | 12 | 13 | The result of attempting to initialize the platform. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AvatarEditorOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options for the avatar editor. 5 | 6 | 7 | Represents options for the avatar editor. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Optional: Override for where the request is coming from. 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserReportID.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a user report ID. 5 | 6 | 7 | Represents a user report ID. 8 | 9 | 10 | 11 | 12 | 13 | Whether the viewer chose to cancel the report flow. 14 | 15 | 16 | The ID of the user report. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/include/platform_sdk/meta_platform_sdk_request.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #ifdef ANDROID_ENABLED 6 | #include 7 | #endif // ANDROID_ENABLED 8 | 9 | #include 10 | 11 | using namespace godot; 12 | 13 | class MetaPlatformSDK_Request : public RefCounted { 14 | GDCLASS(MetaPlatformSDK_Request, RefCounted); 15 | 16 | friend class MetaPlatformSDK; 17 | 18 | #ifdef ANDROID_ENABLED 19 | ovrRequest id = 0; 20 | #endif // ANDROID_ENABLED 21 | 22 | protected: 23 | static void _bind_methods(); 24 | 25 | public: 26 | inline uint64_t get_id() { 27 | #ifdef ANDROID_ENABLED 28 | return id; 29 | #else 30 | return 0; 31 | #endif // ANDROID_ENABLED 32 | } 33 | 34 | MetaPlatformSDK_Request(); 35 | }; 36 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LivestreamingStartResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of starting to livestream. 5 | 6 | 7 | Represents the result of starting to livestream. 8 | 9 | 10 | 11 | 12 | 13 | This livestreaming result represents the start status of your livestream. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_CowatchViewer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a viewer participating in cowatching. 5 | 6 | 7 | Represents a viewer participating in cowatching. 8 | 9 | 10 | 11 | 12 | 13 | Viewer data set by this cowatching viewer. 14 | 15 | 16 | User ID of the owner of data. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LivestreamingApplicationStatus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the status of livestreaming for this application. 5 | 6 | 7 | Represents the status of livestreaming for this application. 8 | 9 | 10 | 11 | 12 | 13 | This is a boolean field and represents whether the app is allowed to do the livestreaming or not. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/include/editor/meta_toolkit_editor_plugin.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | #include "export/meta_toolkit_export_plugin.h" 8 | 9 | using namespace godot; 10 | class MetaXRSimulatorDialog; 11 | 12 | class MetaToolkitEditorPlugin : public EditorPlugin { 13 | GDCLASS(MetaToolkitEditorPlugin, EditorPlugin); 14 | 15 | Ref _meta_toolkit_export_plugin; 16 | MetaXRSimulatorDialog *_meta_xr_simulator_dialog = nullptr; 17 | 18 | void _configure_xr_simulator(); 19 | 20 | protected: 21 | static void _bind_methods(); 22 | 23 | void _notification(uint32_t p_what); 24 | 25 | public: 26 | virtual String _get_plugin_name() const override { 27 | return "MetaToolkitEditorPlugin"; 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /demo/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=5 10 | 11 | [animation] 12 | 13 | compatibility/default_parent_skeleton_in_mesh_instance_3d=true 14 | 15 | [application] 16 | 17 | config/name="Godot Meta Toolkit Demo" 18 | run/main_scene="res://main.tscn" 19 | config/features=PackedStringArray("4.6", "GL Compatibility") 20 | config/icon="res://icon.svg" 21 | 22 | [rendering] 23 | 24 | renderer/rendering_method="gl_compatibility" 25 | renderer/rendering_method.mobile="gl_compatibility" 26 | textures/vram_compression/import_etc2_astc=true 27 | 28 | [xr] 29 | 30 | openxr/enabled=true 31 | openxr/reference_space=2 32 | shaders/enabled=true 33 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AssetFileDownloadResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of downloading an asset file. 5 | 6 | 7 | Represents the result of downloading an asset file. 8 | 9 | 10 | 11 | 12 | 13 | ID of the asset file. 14 | 15 | 16 | File path of the asset file. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_SupplementaryMetric.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a supplementary metric. 5 | 6 | 7 | Represents a supplementary metric. 8 | 9 | 10 | 11 | 12 | 13 | The ID of the leaderboard that this supplementary metric belongs to. 14 | 15 | 16 | This is the metric that is used to determine tiebreaks. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | # Build the RST for the API. 16 | api: 17 | rm -rf "$(SOURCEDIR)/api" 18 | python "$(SOURCEDIR)/make_rst.py" "$(SOURCEDIR)/../doc_classes" --output "$(SOURCEDIR)/api" 19 | 20 | .PHONY: help api Makefile 21 | 22 | # Catch-all target: route all unknown targets to Sphinx using the new 23 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 24 | %: Makefile 25 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 26 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncVoipAttenuationValue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a net sync VoIP attenuation value. 5 | 6 | 7 | Represents a net sync VoIP attenuation value. 8 | 9 | 10 | 11 | 12 | 13 | Decibel fall-off value. 14 | 15 | 16 | The starting distance of this attenuation value. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_CowatchViewerUpdate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an update to the cowatching viewers. 5 | 6 | 7 | Represents an update to the cowatching viewers. 8 | 9 | 10 | 11 | 12 | 13 | List of viewer data of all cowatching participants. 14 | 15 | 16 | User ID of the user with updated viewer data. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_MultiplayerErrorOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options for configuring multiplayer errors. 5 | 6 | 7 | Represents options for configuring multiplayer errors. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Sets the key associated with the predefined error message to be shown to users. 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /demo/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LaunchReportFlowResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of launching the report flow. 5 | 6 | 7 | Represents the result of launching the report flow. 8 | 9 | 10 | 11 | 12 | 13 | Whether the viewer chose to cancel the report flow. 14 | 15 | 16 | ID of the report created by the user. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LaunchUnblockFlowResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The result of launching the user unblock flow. 5 | 6 | 7 | The result of launching the user unblock flow. 8 | 9 | 10 | 11 | 12 | 13 | Whether the viewer chose to cancel the unblock flow. 14 | 15 | 16 | Whether the viewer successfully unblocked the user. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LaunchBlockFlowResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of launching the user block flow. 5 | 6 | 7 | Represents the result of launching the user block flow. 8 | 9 | 10 | 11 | 12 | 13 | Whether the viewer successfully blocked the user. 14 | 15 | 16 | Whether the viewer chose to cancel the block flow. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_SdkAccount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an SDK account. 5 | 6 | 7 | Represents an SDK account. 8 | 9 | 10 | 11 | 12 | 13 | The specific type of account that this sdk account represents. 14 | 15 | 16 | The ID of the user of the sdk account. This is a unique value for every [MetaPlatformSDK_User]. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AchievementUpdate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an achievement update. 5 | 6 | 7 | Represents an achievement update. 8 | 9 | 10 | 11 | 12 | 13 | This indicates if this update caused the achievement to unlock. 14 | 15 | 16 | The unique name used to reference the updated achievement, as specified in the developer dashboard. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PaidOffer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a paid offer. 5 | 6 | 7 | Represents a paid offer. 8 | 9 | 10 | 11 | 12 | 13 | The [MetaPlatformSDK_Price] of the paid offer contains the currency code, the amount in hundredths, and the formatted string representation. 14 | 15 | 16 | Specifies the term of the offer. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AppDownloadResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of downloading an app. 5 | 6 | 7 | Represents the result of downloading an app. 8 | 9 | 10 | 11 | 12 | 13 | Result of the download or install operation returned by the installer. 14 | 15 | 16 | Timestamp in milliseconds when the operation finished. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_InviteOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options to an invite. 5 | 6 | 7 | Represents options to an invite. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Adds suggested users to the invitable users list. 17 | 18 | 19 | 20 | 21 | 22 | Clears suggested users from the invitable users list. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_MicrophoneAvailabilityState.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the microphone availability state. 5 | 6 | 7 | Represents the microphone availability state. 8 | 9 | 10 | 11 | 12 | 13 | Indicates whether the microphone is currently available or not. If there is any update on the microphone availability, it will be retrieved as a notification using [constant MetaPlatformSDK.MESSAGE_NOTIFICATION_VOIP_MICROPHONE_AVAILABILITY_STATE_UPDATE]. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LaunchFriendRequestFlowResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of launching the friend request flow. 5 | 6 | 7 | Represents the result of launching the friend request flow. 8 | 9 | 10 | 11 | 12 | 13 | Whether the viewer chose to cancel the friend request flow. 14 | 15 | 16 | Whether the viewer successfully sent the friend request. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_SystemVoipState.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the System VoIP state. 5 | 6 | 7 | Represents the System VoIP state. 8 | 9 | 10 | 11 | 12 | 13 | A flag that is used to indicate the current state of the microphone. 14 | 15 | 16 | The status enum that indicates the current state of the system VoIP. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncSessionsChangedNotification.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a notification about net sync sessions having changed. 5 | 6 | 7 | Represents a notification about net sync sessions having changed. 8 | 9 | 10 | 11 | 12 | 13 | An ID which can be used to uniquely identify the network synchronization connection. 14 | 15 | 16 | The new list of sessions. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AssetFileDeleteResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of deleting an asset file. 5 | 6 | 7 | Represents the result of deleting an asset file. 8 | 9 | 10 | 11 | 12 | 13 | ID of the asset file. 14 | 15 | 16 | File path of the asset file. 17 | 18 | 19 | Whether the asset file deletion was successful. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LanguagePackInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents info about a language pack. 5 | 6 | 7 | Represents info about a language pack. 8 | 9 | 10 | 11 | 12 | 13 | Language name in English language. 14 | 15 | 16 | Language name in the native language. 17 | 18 | 19 | Language tag in BCP47 format. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /thirdparty/godot_cpp_build_profile/build_profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled_classes": [ 3 | "AcceptDialog", 4 | "BaseButton", 5 | "BoxContainer", 6 | "Button", 7 | "CanvasItem", 8 | "ConfirmationDialog", 9 | "Container", 10 | "Control", 11 | "EditorExportPlatform", 12 | "EditorExportPlatformAndroid", 13 | "EditorExportPlugin", 14 | "EditorFileDialog", 15 | "EditorInterface", 16 | "EditorPlugin", 17 | "EditorSettings", 18 | "Engine", 19 | "FileAccess", 20 | "HBoxContainer", 21 | "Label", 22 | "LineEdit", 23 | "MainLoop", 24 | "Node", 25 | "OS", 26 | "ProjectSettings", 27 | "RefCounted", 28 | "Resource", 29 | "RichTextLabel", 30 | "ScrollContainer", 31 | "Shortcut", 32 | "TextServer", 33 | "Texture", 34 | "Texture2D", 35 | "VBoxContainer", 36 | "Viewport", 37 | "Window" 38 | ] 39 | } -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an asynchronous request to the Meta Platform SDK. 5 | 6 | 7 | Represents an asynchronous request to the Meta Platform SDK. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Gets the requests unique ID. 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Emitted when the request is complete, with a message containing the result of the request. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_BillingPlan.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a billing plan. 5 | 6 | 7 | Represents a billing plan. 8 | 9 | 10 | 11 | 12 | 13 | The paid offer associated with this billing plan. 14 | 15 | 16 | A list of trial offers associated with the billing plan. 17 | This method may return [code]null[/code]. This indicates that the value is not present or that the current app or user is not permitted to access it. 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AssetFileDownloadCancelResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the result of canceling an asset file download. 5 | 6 | 7 | Represents the result of canceling an asset file download. 8 | 9 | 10 | 11 | 12 | 13 | ID of the asset file. 14 | 15 | 16 | File path of the asset file. 17 | 18 | 19 | Whether the cancel request was successful. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Packet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a network packet. 5 | 6 | 7 | Represents a network packet. 8 | 9 | 10 | 11 | 12 | 13 | The packet data. Ideally, it is recommended to keep a message under 1200 bytes so that data can fit into a single packet. 14 | 15 | 16 | Represents the id of the sender of the packet. 17 | 18 | 19 | The number of bytes in the packet. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PidArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of PIDs. 5 | 6 | 7 | An array of [MetaPlatformSDK_Pid]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LinkedAccount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a user's linked account. 5 | 6 | 7 | Represents a user's linked account. 8 | 9 | 10 | 11 | 12 | 13 | Access token of the linked account. 14 | 15 | 16 | Service provider with which the linked account is associated. 17 | 18 | 19 | User ID of the linked account. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # Change history for the Godot Meta Toolkit plugin 2 | 3 | ## 1.0.3 4 | - Modernize class registration 5 | - Fix clang format issues 6 | - Windows: Convert forward slashes from file dialog to backslashes for Meta XR simulator 7 | - Update for Meta Platform SDK v77 8 | 9 | ## 1.0.2 10 | - Include API documentation in the editor 11 | - Update for Meta Platform SDK v72 12 | - Add demo project demonstrating the Platform SDK 13 | 14 | ## 1.0.1 15 | - Fix `MetaPlatformSDK_LeaderboardEntry::get_extra_data()` and `MetaPlatformSDK_ChallengeEntry::get_extra_data()` to return `PackedByteArray` 16 | - Change `MetaPlatformSDK_Message.get_error()` method into `error` property 17 | - Encode `PackedStringArray` as UTF-8 before passing to underlying Meta Platform SDK functions 18 | - Get API documentation coverage up to 100% and other small documentation improvements 19 | - Remove `*_long` suffix from `MetaPlatformSDK_AssetFileDownloadUpdate.get_bytes_total_long()` and `.get_bytes_transferred_long()` 20 | 21 | ## 1.0.0 22 | - Initial release 23 | - Support for Meta Platform SDK v71 24 | - Tool for configuring the Meta XR Simulator 25 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LivestreamingVideoStats.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents livestreaming video stats. 5 | 6 | 7 | Represents livestreaming video stats. 8 | 9 | 10 | 11 | 12 | 13 | The total number of comments left for your livestream video. 14 | 15 | 16 | The total number of reactions your livestream video received. 17 | 18 | 19 | The total number of views of your livestream video. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_RosterOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options for launching the roster panel. 5 | 6 | 7 | Represents options for launching the roster panel. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Adds a suggested user to the invitable users list. From the roster panel, the user can open the invite list, where the suggested users will be shown. 17 | 18 | 19 | 20 | 21 | 22 | Clear suggested users from the invitable users list. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/include/editor/meta_xr_simulator_dialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | namespace godot { 8 | class RichTextLabel; 9 | class LineEdit; 10 | class EditorFileDialog; 11 | } //namespace godot 12 | 13 | using namespace godot; 14 | 15 | class MetaXRSimulatorDialog : public AcceptDialog { 16 | GDCLASS(MetaXRSimulatorDialog, AcceptDialog); 17 | 18 | RichTextLabel *_message = nullptr; 19 | LineEdit *_path_field = nullptr; 20 | EditorFileDialog *_file_dialog = nullptr; 21 | 22 | void _update(); 23 | 24 | void _on_path_changed(const String &p_path); 25 | void _on_browse_button_pressed(); 26 | void _on_file_selected(const String &p_path); 27 | void _on_meta_clicked(const String &p_meta); 28 | 29 | String _get_simulator_path(); 30 | void _set_simulator_path(const String &p_path); 31 | 32 | protected: 33 | static void _bind_methods(); 34 | 35 | void _notification(uint32_t p_what); 36 | 37 | public: 38 | void show(); 39 | 40 | MetaXRSimulatorDialog(); 41 | }; 42 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_SdkAccountArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of SDK accounts. 5 | 6 | 7 | An array of [MetaPlatformSDK_SdkAccount]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_TrialOfferArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of trial offers. 5 | 6 | 7 | An array of [MetaPlatformSDK_TrialOffer]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AssetDetailsArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of asset details. 5 | 6 | 7 | An array of [MetaPlatformSDK_AssetDetails]. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_BillingPlanArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of billing plans. 5 | 6 | 7 | An array of [MetaPlatformSDK_BillingPlan]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AbuseReportOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options for an abuse report. 5 | 6 | 7 | Represents options for an abuse report. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Set whether or not to show the user selection step in the report dialog. 17 | 18 | 19 | 20 | 21 | 22 | 23 | The intended entity being reported, whether user or object/content. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /demo/addons/godot_meta_toolkit/toolkit.gdextension: -------------------------------------------------------------------------------- 1 | [configuration] 2 | 3 | entry_symbol = "toolkit_library_init" 4 | compatibility_minimum = "4.3" 5 | android_aar_plugin = true 6 | 7 | [libraries] 8 | 9 | android.debug.arm64 = "res://addons/godot_meta_toolkit/.bin/android/template_debug/arm64/libgodot_meta_toolkit.so" 10 | android.release.arm64 = "res://addons/godot_meta_toolkit/.bin/android/template_release/arm64/libgodot_meta_toolkit.so" 11 | macos.debug = "res://addons/godot_meta_toolkit/.bin/macos/template_debug/libgodot_meta_toolkit.macos.framework" 12 | macos.release = "res://addons/godot_meta_toolkit/.bin/macos/template_release/libgodot_meta_toolkit.macos.framework" 13 | windows.debug.x86_64 = "res://addons/godot_meta_toolkit/.bin/windows/template_debug/x86_64/libgodot_meta_toolkit.dll" 14 | windows.release.x86_64 = "res://addons/godot_meta_toolkit/.bin/windows/template_release/x86_64/libgodot_meta_toolkit.dll" 15 | linux.debug.x86_64 = "res://addons/godot_meta_toolkit/.bin/linux/template_debug/x86_64/libgodot_meta_toolkit.so" 16 | linux.release.x86_64 = "res://addons/godot_meta_toolkit/.bin/linux/template_release/x86_64/libgodot_meta_toolkit.so" 17 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LinkedAccountArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of linked accounts. 5 | 6 | 7 | An array of [MetaPlatformSDK_LinkedAccount]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncSessionArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of net sync sessions. 5 | 6 | 7 | An array of [MetaPlatformSDK_NetSyncSession]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AppDownloadProgressResult.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the progress of downloading an app. 5 | 6 | 7 | Represents the progress of downloading an app. 8 | 9 | 10 | 11 | 12 | 13 | Total number of bytes that need to be downloaded. 14 | 15 | 16 | Number of bytes that have already been downloaded. 17 | 18 | 19 | Status code of the current app status. Can be used to find if app is downloading, etc. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_InstalledApplicationArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of installed applications. 5 | 6 | 7 | An array of [MetaPlatformSDK_InstalledApplication]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Price.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a price. 5 | 6 | 7 | Represents a price. 8 | 9 | 10 | 11 | 12 | 13 | The price of the product in hundredths of currency units. 14 | 15 | 16 | The ISO 4217 currency code for the price of the product. For example, "USD", "GBP", "JPY". 17 | 18 | 19 | The formatted string representation of the price, e.g., "$0.78". The value depends on the [member currency] and [member amount_in_hundredths]. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /config.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | versions = [ 3 | gradlePluginVersion : '8.2.0', 4 | compileSdk : 34, 5 | minSdk : 21, 6 | targetSdk : 34, 7 | javaVersion : JavaVersion.VERSION_17, 8 | kotlinVersion : '1.9.20', 9 | ndkVersion : '23.2.8568313' 10 | ] 11 | 12 | libraries = [ 13 | godotAndroidLib: "org.godotengine:godot:4.2.1.stable", 14 | ] 15 | } 16 | 17 | // Parse the release version from the gradle project properties (e.g: -Prelease_version=) 18 | ext.getReleaseVersion = { -> 19 | final String defaultVersion = "0.1.0-dev-SNAPSHOT" 20 | 21 | String releaseVersion = project.hasProperty("release_version") ? project.property("release_version") : defaultVersion 22 | if (releaseVersion == null || releaseVersion.isEmpty()) { 23 | releaseVersion = defaultVersion 24 | } 25 | 26 | if (!releaseVersion.endsWithIgnoreCase("-stable") && !releaseVersion.endsWithIgnoreCase("-snapshot")) { 27 | releaseVersion += "-SNAPSHOT" 28 | } 29 | 30 | return releaseVersion 31 | } 32 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Leaderboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a leaderboard. 5 | 6 | 7 | Represents a leaderboard. 8 | 9 | 10 | 11 | 12 | 13 | The API name of this leaderboard. This is a unique string that your application will refer to this leaderboard in your app code. 14 | 15 | 16 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 17 | 18 | 19 | The generated GUID of this leaderboard. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/manual/xr_simulator.rst: -------------------------------------------------------------------------------- 1 | .. _manual_xr_simulator: 2 | 3 | XR Simulator 4 | ============ 5 | 6 | The `Meta XR Simulator `_ allows developers to test XR applications on their desktop computer (Windows or MacOS), 7 | leading to faster iteration, because the app doesn't need to be deployed to the headset, and the developer doesn't need to constantly put the headset on and off. 8 | 9 | Godot can be configured to launch the Meta XR Simulator when you run your game, and the Godot Meta Toolkit includes a tool to help you with that configuration! 10 | 11 | Step-by-step instructions 12 | ------------------------- 13 | 14 | 1. Download the `Meta XR Simulator `_ and extract it somewhere on your computer. 15 | 16 | 2. In the Godot editor, click **Project** -> **Tools** -> **Configure Meta XR Simulator...** 17 | 18 | .. image:: img/xr_simulator_tool.png 19 | :alt: Shows the "Configure Meta XR Simulator..." option in the menu 20 | 21 | 3. Follow the instructions in the dialog, in order to point Godot to the location where you extracted the Meta XR Simulator. 22 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AssetFileDownloadUpdate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an update about downloading an asset file. 5 | 6 | 7 | Represents an update about downloading an asset file. 8 | 9 | 10 | 11 | 12 | 13 | ID of the asset file. 14 | 15 | 16 | Total number of bytes. 17 | 18 | 19 | Number of bytes that have been downloaded. 20 | 21 | 22 | Flag indicating a download is completed. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /toolkit/src/main/java/com/meta/w4/godot/toolkit/GodotMetaToolkit.kt: -------------------------------------------------------------------------------- 1 | package com.meta.w4.godot.toolkit 2 | 3 | import android.app.Activity 4 | import android.util.Log 5 | import org.godotengine.godot.Godot 6 | import org.godotengine.godot.plugin.GodotPlugin 7 | 8 | /** 9 | * Godot plugin for the Godot Meta Toolkit 10 | */ 11 | class GodotMetaToolkit(godot: Godot?) : GodotPlugin(godot) { 12 | companion object { 13 | private val TAG = GodotMetaToolkit::class.java.simpleName 14 | 15 | init { 16 | try { 17 | Log.v(TAG, "Loading godot_meta_toolkit library") 18 | System.loadLibrary("godot_meta_toolkit") 19 | } catch (e: UnsatisfiedLinkError) { 20 | Log.e(TAG, "Unable to load godot_meta_toolkit shared library") 21 | } 22 | } 23 | } 24 | 25 | override fun getPluginName() = "GodotMetaToolkit" 26 | 27 | override fun getPluginGDExtensionLibrariesPaths() = setOf("res://addons/godot_meta_toolkit/toolkit.gdextension") 28 | 29 | override fun onGodotSetupCompleted() { 30 | initPlatformSDK(getActivity()); 31 | } 32 | 33 | private external fun initPlatformSDK(activity: Activity?); 34 | } 35 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_GroupPresenceLeaveIntent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the intent to leave group presence. 5 | 6 | 7 | Represents the intent to leave group presence. 8 | 9 | 10 | 11 | 12 | 13 | If populated, the destination the current user wants to leave. 14 | 15 | 16 | If populated, the lobby session the current user wants to leave. 17 | 18 | 19 | If populated, the match session the current user wants to leave. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncVoipAttenuationValueArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of net sync VoIP attenuation values. 5 | 6 | 7 | An array of [MetaPlatformSDK_NetSyncVoipAttenuationValue]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns the size of the array. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.github/workflows/documentation.yml: -------------------------------------------------------------------------------- 1 | name: Documentation 2 | 3 | permissions: 4 | contents: read 5 | pages: write 6 | id-token: write 7 | 8 | on: [push, pull_request] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v4 17 | 18 | - name: Set up Python 19 | uses: actions/setup-python@v5 20 | with: 21 | python-version: '3.10' 22 | 23 | - name: Install dependencies 24 | run: | 25 | python -m pip install --upgrade pip 26 | pip install sphinx 27 | pip install -r docs/requirements.txt 28 | 29 | - name: Build Sphinx Documentation 30 | run: | 31 | cd docs 32 | make api html 33 | 34 | - name: Upload Pages Artifact 35 | uses: actions/upload-pages-artifact@v3 36 | with: 37 | path: docs/_build/html 38 | 39 | deploy: 40 | if: github.ref == 'refs/heads/main' 41 | needs: build 42 | runs-on: ubuntu-latest 43 | environment: 44 | name: github-pages 45 | url: ${{ steps.deploy-pages.outputs.page_url }} 46 | steps: 47 | - name: Deploy to GitHub Pages 48 | uses: actions/deploy-pages@v4 49 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to the Godot Meta Toolkit documentation! 2 | ================================================ 3 | 4 | The **Godot Meta Toolkit** is a GDExtension for Godot 4.3+, that exposes Meta SDKs (e.g Platform SDK), as well as Meta utilities for XR development with the Godot Engine. 5 | 6 | Key Features 7 | ------------ 8 | 9 | - Integration with the :ref:`Platform SDK` 10 | - :ref:`Tool for configuring the Meta XR Simulator` to work with Godot 11 | 12 | Maintenance and Sponsorship 13 | --------------------------- 14 | 15 | This project is maintained by `W4 Games `_ with sponsorship from `Meta `_. 16 | 17 | Contributions from the community are welcome! 18 | 19 | .. Below is the main table-of-content tree of the documentation website. 20 | It is hidden on the page itself, but it makes up the sidebar for navigation. 21 | 22 | .. toctree:: 23 | :hidden: 24 | :maxdepth: 1 25 | :caption: Manual 26 | :name: manual 27 | 28 | manual/platform_sdk/index 29 | manual/xr_simulator 30 | 31 | .. toctree:: 32 | :hidden: 33 | :maxdepth: 1 34 | :caption: API Reference 35 | :name: sec-class-reference 36 | 37 | api/index 38 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_TrialOffer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a trial offer. 5 | 6 | 7 | Represents a trial offer. 8 | 9 | 10 | 11 | 12 | 13 | The maximum term for which a the trial offer is valid. 14 | 15 | 16 | The price of the trial offer, which contains the currency code, the amount in hundredths, and the formatted string representation. 17 | 18 | 19 | The term of the trial offer. 20 | 21 | 22 | The type of trial. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_HttpTransferUpdate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an update about an HTTP transfer. 5 | 6 | 7 | Represents an update about an HTTP transfer. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Indicates whether the HTTP transfer has been completed or not. 16 | 17 | 18 | 19 | 20 | 21 | An array of bytes that represents the data being transferred. 22 | 23 | 24 | The ID of the HTTP transfer update. 25 | 26 | 27 | The number of bytes contained in [member bytes]. 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserCapability.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a user capability. 5 | 6 | 7 | Represents a user capability. 8 | 9 | 10 | 11 | 12 | 13 | Human readable description of the capability, describing what possessing it entails for a given user. 14 | 15 | 16 | Whether the capability is currently enabled for the user. 17 | 18 | 19 | Unique identifer for the capability. 20 | 21 | 22 | If present, specifies the reason the capability was enabled or disabled. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/editor/meta_toolkit_editor_plugin.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #include "editor/meta_toolkit_editor_plugin.h" 4 | #include "editor/meta_xr_simulator_dialog.h" 5 | 6 | void MetaToolkitEditorPlugin::_bind_methods() { 7 | } 8 | 9 | void MetaToolkitEditorPlugin::_notification(uint32_t p_what) { 10 | switch (p_what) { 11 | case NOTIFICATION_POSTINITIALIZE: { 12 | _meta_xr_simulator_dialog = memnew(MetaXRSimulatorDialog); 13 | add_child(_meta_xr_simulator_dialog); 14 | } break; 15 | 16 | case NOTIFICATION_ENTER_TREE: { 17 | add_tool_menu_item("Configure Meta XR Simulator...", callable_mp(this, &MetaToolkitEditorPlugin::_configure_xr_simulator)); 18 | 19 | // Initialize the editor export plugin 20 | _meta_toolkit_export_plugin.instantiate(); 21 | add_export_plugin(_meta_toolkit_export_plugin); 22 | } break; 23 | 24 | case NOTIFICATION_EXIT_TREE: { 25 | remove_tool_menu_item("Configure Meta XR Simulator..."); 26 | 27 | // Clean up the editor export plugin 28 | remove_export_plugin(_meta_toolkit_export_plugin); 29 | _meta_toolkit_export_plugin.unref(); 30 | } break; 31 | } 32 | } 33 | 34 | void MetaToolkitEditorPlugin::_configure_xr_simulator() { 35 | _meta_xr_simulator_dialog->show(); 36 | } 37 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AchievementDefinition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the definition of an acheivement. 5 | 6 | 7 | Represents the definition of an acheivement. 8 | 9 | 10 | 11 | 12 | 13 | The length of the bitfield, if the [member type] is [constant MetaPlatformSDK.ACHIEVEMENT_TYPE_BITFIELD]. 14 | 15 | 16 | The name of the achievement. 17 | 18 | 19 | The target count of the achievement, if the [member type] is [constant MetaPlatformSDK.ACHIEVEMENT_TYPE_COUNT]. 20 | 21 | 22 | The type of achievement. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncSession.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a net sync session. 5 | 6 | 7 | Represents a net sync session. 8 | 9 | 10 | 11 | 12 | 13 | Which connection this session exists within. 14 | 15 | 16 | True if the local session has muted this session. 17 | 18 | 19 | The cloud networking internal session ID that represents this connection. 20 | 21 | 22 | The ID of the user behind this session. 23 | 24 | 25 | The name of the VoIP group that this session is subscribed to. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options for net sync. 5 | 6 | 7 | Represents options for net sync. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | If provided, immediately set the voip_group to this value upon connection. 17 | 18 | 19 | 20 | 21 | 22 | 23 | When a new remote voip user connects, default that connection to this stream type by default. 24 | 25 | 26 | 27 | 28 | 29 | 30 | Set the unique identifier within the current application grouping. 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Party.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a party. 5 | 6 | 7 | Represents a party. 8 | 9 | 10 | 11 | 12 | 13 | A unique identifier of this party. 14 | 15 | 16 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 17 | 18 | 19 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 20 | 21 | 22 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_GroupPresenceJoinIntent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the intent to join group presence. 5 | 6 | 7 | Represents the intent to join group presence. 8 | 9 | 10 | 11 | 12 | 13 | An opaque string provided by the developer to help them deeplink to content. 14 | 15 | 16 | If populated, the destination the current user wants to go to. 17 | 18 | 19 | If populated, the lobby session the current user wants to go to. 20 | 21 | 22 | If populated, the match session the current user wants to go to. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /demo/icon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cmm67scocnrpg" 6 | path.s3tc="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex" 7 | path.etc2="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.etc2.ctex" 8 | metadata={ 9 | "imported_formats": ["s3tc_bptc", "etc2_astc"], 10 | "vram_texture": true 11 | } 12 | 13 | [deps] 14 | 15 | source_file="res://icon.svg" 16 | dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex", "res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.etc2.ctex"] 17 | 18 | [params] 19 | 20 | compress/mode=2 21 | compress/high_quality=false 22 | compress/lossy_quality=0.7 23 | compress/uastc_level=0 24 | compress/rdo_quality_loss=0.0 25 | compress/hdr_compression=1 26 | compress/normal_map=0 27 | compress/channel_pack=0 28 | mipmaps/generate=true 29 | mipmaps/limit=-1 30 | roughness/mode=0 31 | roughness/src_normal="" 32 | process/channel_remap/red=0 33 | process/channel_remap/green=1 34 | process/channel_remap/blue=2 35 | process/channel_remap/alpha=3 36 | process/fix_alpha_border=true 37 | process/premult_alpha=false 38 | process/normal_map_invert_y=false 39 | process/hdr_as_srgb=false 40 | process/hdr_clamp_exposure=false 41 | process/size_limit=0 42 | detect_3d/compress_to=0 43 | svg/scale=2.0 44 | editor/scale_with_editor_scale=false 45 | editor/convert_colors_with_editor_theme=false 46 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AchievementProgress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents progress on an achievement. 5 | 6 | 7 | Represents progress on an achievement. 8 | 9 | 10 | 11 | 12 | 13 | For bitfield achievements, the current bitfield state. 14 | 15 | 16 | For count achievements, the current counter state. 17 | 18 | 19 | If the user has already unlocked this achievement. 20 | 21 | 22 | The unique string that you use to reference the achievement in your app, as specified in the developer dashboard. 23 | 24 | 25 | If the achievement is unlocked, the time when it was unlocked. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /toolkit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | # Non functional cmake build file used to provide Android Studio editor support to the project. 4 | cmake_minimum_required(VERSION 3.22.1) 5 | project(godot_meta_toolkit LANGUAGES CXX) 6 | 7 | set(CMAKE_CXX_STANDARD 17) 8 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 9 | set(CMAKE_CXX_EXTENSIONS OFF) 10 | 11 | set(GODOT_CPP_DIR "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/godot-cpp") 12 | set(PLATFORM_SDK_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}../thirdparty/ovr_platform_sdk/Include") 13 | set(TOOLKIT_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/gen/include") 14 | set(COMMON_LIB_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/src/main/cpp/include") 15 | 16 | # Get sources 17 | file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp/*.c**) 18 | file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp/*.h**) 19 | file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_LIST_DIR}/src/gen/include/*.h**) 20 | 21 | add_library(${PROJECT_NAME} 22 | SHARED 23 | ${SOURCES} 24 | ${HEADERS} 25 | ) 26 | 27 | target_include_directories(${PROJECT_NAME} 28 | SYSTEM PUBLIC 29 | "${GODOT_CPP_DIR}/include" 30 | "${GODOT_CPP_DIR}/gen/include" 31 | "${GODOT_CPP_DIR}/gdextension" 32 | ${PLATFORM_SDK_HEADERS_DIR} 33 | ${TOOLKIT_GENERATED_HEADERS_DIR} 34 | ${COMMON_LIB_HEADERS_DIR} 35 | ) 36 | 37 | add_definitions(-DDEBUG_ENABLED) 38 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_InstalledApplication.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an installed app. 5 | 6 | 7 | Represents an installed app. 8 | 9 | 10 | 11 | 12 | 13 | Represents the ID of the application, which is a unique identifier for the app. 14 | 15 | 16 | The package name of the installed application. 17 | 18 | 19 | Represents the status of the installed application. 20 | 21 | 22 | Represents the current version code of the installed application. 23 | 24 | 25 | Represents the current version name of the installed application. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of users. 5 | 6 | 7 | An array of [MetaPlatformSDK_User]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LeaderboardUpdateStatus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a status update to a leaderboard. 5 | 6 | 7 | Represents a status update to a leaderboard. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | If the leaderboard is updated, this represents the updated challenge IDs. The updated challenge IDs can be used by [method MetaPlatformSDK.challenges_get_entries_async], [method MetaPlatformSDK.challenges_get_entries_after_rank_async] or [method MetaPlatformSDK.challenges_get_entries_by_ids_async]. 17 | 18 | 19 | 20 | 21 | 22 | A `boolean` indicates whether the leaderboard was updated. 23 | 24 | 25 | The count of challenge IDs available in [method get_updated_challenge_id]. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ProductArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of products. 5 | 6 | 7 | An array of [MetaPlatformSDK_Product]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PurchaseArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of purchases. 5 | 6 | 7 | An array of [MetaPlatformSDK_Purchase]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | # Enables namespacing of each library's R class so that its R class includes only the 23 | # resources declared in the library itself and none from the library's dependencies, 24 | # thereby reducing the size of the R class for that library 25 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_DestinationArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of destinations. 5 | 6 | 7 | An array of [MetaPlatformSDK_Destination]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_BlockedUserArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of blocked users. 5 | 6 | 7 | An array of [MetaPlatformSDK_BlockedUser]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_CowatchViewerArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of cowatching viewers. 5 | 6 | 7 | An array of [MetaPlatformSDK_CowatchViewer]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserCapabilityArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of user capabilities. 5 | 6 | 7 | An array of [MetaPlatformSDK_UserCapability]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ApplicationInviteArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of application invites. 5 | 6 | 7 | An array of [MetaPlatformSDK_ApplicationInvite]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_NetSyncConnection.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a net sync connection. 5 | 6 | 7 | Represents a net sync connection. 8 | 9 | 10 | 11 | 12 | 13 | An ID which can be used to uniquely identify the network synchronization connection. 14 | 15 | 16 | If status is disconnected, specifies the reason. 17 | 18 | 19 | The ID of the local session. Will be [code]null[/code] if the connection is not active. 20 | 21 | 22 | The status of the network synchronization connection. 23 | 24 | 25 | Represents the unique identifier within the current application grouping. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Destination.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an app destination. 5 | 6 | 7 | Represents an app destination. 8 | 9 | 10 | 11 | 12 | 13 | Pass it into [method MetaPlatformSDK_GroupPresenceOptions.set_destination_api_name] when calling [method MetaPlatformSDK.group_presence_set_async] to set this user's group presence. 14 | 15 | 16 | The information that will be in [member MetaPlatformSDK_LaunchDetails.deeplink_message] when a user enters via deeplink. Alternatively will be in [member MetaPlatformSDK_User.presence_deeplink_message] if the rich presence is set for the user. 17 | 18 | 19 | A displayable string of the destination name. 20 | 21 | 22 | A URL that allows the user to deeplink directly to this destination. 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AchievementDefinitionArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of achievement definitions. 5 | 6 | 7 | An array of [MetaPlatformSDK_AchievementDefinition]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AchievementProgressArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of achievement progress information. 5 | 6 | 7 | An array of [MetaPlatformSDK_AchievementProgress] objects. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns the size of the array. 30 | 31 | 32 | 33 | 34 | 35 | The URL used to request the next page of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | Documentation 2 | ============= 3 | 4 | How to build the documentation 5 | ------------------------------ 6 | 7 | ### One-time setup ### 8 | 9 | Install all the necessary Python dependencies for Sphinx: 10 | 11 | ```bash 12 | python -m venv python.env 13 | . python.env/bin/activate 14 | pip install -r requirements.txt 15 | ``` 16 | 17 | Next time, before you run any of the commands below, make sure to run this in your terminal first: 18 | 19 | ```bash 20 | . python.env/bin/activate 21 | ``` 22 | 23 | ### Updating the XML of the API docs ### 24 | 25 | It's possible to use Godot's `--doctool` to automatically update the XML for any new classes 26 | or members, by running: 27 | 28 | ```bash 29 | ../scripts/update_doc_classes_xml.sh 30 | ``` 31 | 32 | If your Godot isn't called `godot` or isn't on your `PATH`, then set the `GODOT` variable to 33 | point to your Godot 4 executable, for example: 34 | 35 | ```bash 36 | export GODOT=/path/to/godot 37 | ../scripts/update_doc_classes_xml.sh 38 | ``` 39 | 40 | Then you can edit the XML documentation in `../doc_classes`! 41 | 42 | ### Generating the RST from the XML ### 43 | 44 | To convert the API docs from XML into RST for Sphinx, run: 45 | 46 | ```bash 47 | make api 48 | ``` 49 | 50 | ### Generating the HTML documentation ### 51 | 52 | To use Sphinx to generate the HTML documentation, run: 53 | 54 | ```bash 55 | make html 56 | ``` 57 | 58 | Then you can open `_build/html/index.html` a web browser! 59 | 60 | Sphinx isn't that great at detecting changes, so if it doesn't seem to be picking up your edits, 61 | try running: 62 | 63 | ```bash 64 | make clean html 65 | ``` 66 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/include/export/meta_toolkit_export_plugin.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | 8 | using namespace godot; 9 | 10 | class MetaToolkitExportPlugin : public EditorExportPlugin { 11 | GDCLASS(MetaToolkitExportPlugin, EditorExportPlugin) 12 | 13 | public: 14 | MetaToolkitExportPlugin(); 15 | 16 | String _get_name() const override { 17 | return "Godot Meta Toolkit"; 18 | } 19 | 20 | PackedStringArray _get_android_libraries(const Ref &p_platform, bool p_debug) const override; 21 | 22 | String _get_export_option_warning(const Ref &p_platform, const String &p_option) const override; 23 | 24 | TypedArray _get_export_options(const Ref &p_platform) const override; 25 | 26 | Dictionary _get_export_options_overrides(const Ref &p_platform) const override; 27 | 28 | bool _supports_platform(const Ref &p_platform) const override; 29 | 30 | protected: 31 | static void _bind_methods(); 32 | 33 | private: 34 | static Dictionary _generate_export_option(const String &p_name, const String &p_class_name, 35 | Variant::Type p_type, 36 | PropertyHint p_property_hint, 37 | const String &p_hint_string, 38 | PropertyUsageFlags p_property_usage, 39 | const Variant &p_default_value, 40 | bool p_update_visibility); 41 | 42 | bool _get_bool_option(const String &p_option) const; 43 | 44 | Dictionary _enable_meta_toolkit_option; 45 | }; 46 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LivestreamingStatus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the current livestreaming status. 5 | 6 | 7 | Represents the current livestreaming status. 8 | 9 | 10 | 11 | 12 | 13 | Indicates if the comments from the audience in your livestreaming are visible. 14 | 15 | 16 | Indicates if your livestreaming in the app is paused or not. 17 | 18 | 19 | Indicates if your app is livestreaming enabled. If your app is enabled, you will receive a notification by #ovrMessage_Notification_Livestreaming_StatusChange when the livestreaming session gets updated. 20 | 21 | 22 | Indicates the type of your livestreaming. 23 | 24 | 25 | Indicates if your connected mic is enabled. The speaker will be muted if the field is false. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Godot Meta Toolkit 2 | 3 | The toolkit exposes Meta SDKs (e.g Platform SDK), as well as Meta utilities for XR development with the Godot Engine. 4 | 5 | > [!WARNING] 6 | > 7 | > Use of the toolkit requires **Godot 4.3** or higher. 8 | 9 | ## Build instructions 10 | 11 | After cloning the project, run the following command in the project root directory to initialize the submodules: 12 | ``` 13 | git submodule update --init --recursive 14 | ``` 15 | 16 | Then download the [Oculus Platform SDK](https://developer.oculus.com/downloads/package/oculus-platform-sdk/) and extract 17 | it into `thirdparty/ovr_platform_sdk`, such that `thirdparty/ovr_platform_sdk/Include/OVR_Platform.h` exists. 18 | 19 | We've tested with v77 of the Platform SDK. 20 | 21 | ### Build the toolkit 22 | 23 | #### Linux / MacOS 24 | Run the following command from the root directory to build the toolkit artifacts: 25 | ``` 26 | ./gradlew buildToolkit 27 | ``` 28 | 29 | #### Windows 30 | Run the following command from the root directory to build the toolkit artifacts: 31 | ``` 32 | gradlew.bat buildToolkit 33 | ``` 34 | 35 | ## Using the Platform SDK 36 | 37 | See [Getting Started with the Meta Platform SDK](https://godot-sdk-integrations.github.io/godot-meta-toolkit/manual/platform_sdk/getting_started.html) in the official docs. 38 | 39 | ## Documentation 40 | 41 | This README is intentionally kept short. 42 | 43 | See the [official documentation](https://godot-sdk-integrations.github.io/godot-meta-toolkit/) for more information. 44 | 45 | ## Maintenance and Sponsorship 46 | 47 | This project is maintained by [W4 Games](https://www.w4games.com/) with sponsorship from [Meta](https://www.meta.com/). 48 | 49 | Contributions from the community are welcome! 50 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_UserOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents user options. 5 | 6 | 7 | Represents user options. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Specifies a service provider for which linked accounts should be retrieved. Can be called multiple times to specify multiple service providers. 17 | 18 | 19 | 20 | 21 | 22 | Clears the list of services providers that was created by calling [method add_service_provider]. 23 | 24 | 25 | 26 | 27 | 28 | 29 | This field specifies the maximum number of users that should be returned in the response. 30 | 31 | 32 | 33 | 34 | 35 | 36 | This field specifies the time window in seconds for which the linked accounts should be retrieved. 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_DataStore.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a data store. 5 | 6 | 7 | Represents a data store. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | It's a method that takes a string key as a parameter and returns a boolean value indicating whether the key exists in the data store. 17 | 18 | 19 | 20 | 21 | 22 | 23 | It's a string that represents a single key in the data store. It allows you to retrieve a specific key from the data store by its index 24 | 25 | 26 | 27 | 28 | 29 | 30 | It's a generic field that can hold any type of data. It allows you to store and retrieve data using a string key, and it can be used to store a variety of data types 31 | 32 | 33 | 34 | 35 | 36 | It's an integer that represents the number of keys in the data store. 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /.github/workflows/scripts/clang_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script runs clang-format and fixes copyright headers on all relevant files in the repo. 4 | # This is the primary script responsible for fixing style violations. 5 | 6 | set -uo pipefail 7 | IFS=$'\n\t' 8 | 9 | CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".glsl") 10 | 11 | # Loops through all text files tracked by Git. 12 | git grep -zIl '' | 13 | while IFS= read -rd '' f; do 14 | # Exclude 3rd party files. 15 | if [[ "$f" == "thirdparty"* ]]; then 16 | continue 17 | elif [[ "$f" == "demo/addons"* ]]; then 18 | continue 19 | elif [[ "$f" == "gradle"* ]]; then 20 | continue 21 | elif [[ "$f" == "build"* ]]; then 22 | continue 23 | elif [[ "$f" == "android"* ]]; then 24 | continue 25 | elif [[ "$f" == ".github"* ]]; then 26 | continue 27 | fi 28 | for extension in ${CLANG_FORMAT_FILE_EXTS[@]}; do 29 | if [[ "$f" == *"$extension" ]]; then 30 | # Run clang-format. 31 | clang-format -i "$f" 32 | fi 33 | done 34 | done 35 | 36 | git diff > patch.patch 37 | 38 | # If no patch has been generated all is OK, clean up, and exit. 39 | if [ ! -s patch.patch ] ; then 40 | printf "Files in this commit comply with the clang-format style rules.\n" 41 | rm -f patch.patch 42 | exit 0 43 | fi 44 | 45 | # A patch has been created, notify the user, clean up, and exit. 46 | printf "\n*** The following differences were found between the code " 47 | printf "and the formatting rules:\n\n" 48 | cat patch.patch 49 | printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i '\n" 50 | rm -f patch.patch 51 | exit 1 52 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ApplicationInvite.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an application invite. 5 | 6 | 7 | Represents an application invite. 8 | 9 | 10 | 11 | 12 | 13 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 14 | 15 | 16 | The ID of the application invite. 17 | 18 | 19 | A boolean value indicating whether the invite is still active or not. 20 | 21 | 22 | The lobby session id to which the recipient is invited. 23 | 24 | 25 | The match session id to which the recipient is invited. 26 | 27 | 28 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ApplicationVersion.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an app version. 5 | 6 | 7 | Represents an app version. 8 | 9 | 10 | 11 | 12 | 13 | Version code number for the version of the application currently installed on the device. 14 | 15 | 16 | Version name string for the version of the application currently installed on the device. 17 | 18 | 19 | Version code number of the latest update of the application. This may or may not be currently installed on the device. 20 | 21 | 22 | Version name string of the latest update of the application. This may or may not be currently installed on the device. 23 | 24 | 25 | Seconds since the UNIX epoch when the latest application update was released. 26 | 27 | 28 | Size of the latest application update in bytes. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LeaderboardArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of leaderboards. 5 | 6 | 7 | An array of [MetaPlatformSDK_Leaderboard]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Access the indexed element in this list. Note that the index is zero-based, so the first element has an index of 0. 18 | 19 | 20 | 21 | 22 | 23 | Indicates whether there is a next page of elements that can be retrieved. If this value is true, you can use the next_url field to request the next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | The number of elements contained within this list. This is not equal to the total number of elements across multiple pages. 30 | 31 | 32 | 33 | 34 | 35 | The URL to request the next paginated list of elements. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | import sys, os, datetime 7 | 8 | sys.path.append(os.path.abspath('_extensions')) 9 | 10 | # -- Project information ----------------------------------------------------- 11 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 12 | 13 | project = 'Godot Meta Toolkit' 14 | copyright = ( 15 | "Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved." 16 | ) 17 | author = "Meta Platforms, Inc. and affiliates." 18 | 19 | # -- General configuration --------------------------------------------------- 20 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 21 | 22 | extensions = [ 23 | 'sphinx_rtd_theme', 24 | 'gdscript', 25 | ] 26 | 27 | templates_path = ['_templates'] 28 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'python.env'] 29 | 30 | # Add GDScript syntax highlighting. 31 | from gdscript import GDScriptLexer 32 | from sphinx.highlighting import lexers 33 | lexers['gdscript'] = GDScriptLexer() 34 | 35 | smartquotes = False 36 | 37 | # Pygments (syntax highlighting) style to use 38 | pygments_style = "sphinx" 39 | highlight_language = "gdscript" 40 | 41 | # -- Options for HTML output ------------------------------------------------- 42 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 43 | 44 | html_theme = 'sphinx_rtd_theme' 45 | html_theme_options = { 46 | #"logo_only": True, 47 | "collapse_navigation": False, 48 | } 49 | html_static_path = ['_static'] 50 | #html_logo = 'img/logo.png' 51 | html_css_files = [ 52 | "css/custom.css", 53 | ] 54 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ApplicationOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents the options for launching an app. 5 | 6 | 7 | Represents the options for launching an app. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | A message to be passed to a launched app, which can be retrieved from [method MetaPlatformSDK.application_lifecycle_get_launch_details] via the [member MetaPlatformSDK_LaunchDetails.deeplink_message] property. 17 | 18 | 19 | 20 | 21 | 22 | 23 | If provided, the intended destination to be passed to the launched app. 24 | 25 | 26 | 27 | 28 | 29 | 30 | If provided, the intended lobby where the launched app should take the user. All users with the same lobby_session_id should end up grouped together in the launched app. 31 | 32 | 33 | 34 | 35 | 36 | 37 | If provided, the intended instance of the destination that a user should be launched into. 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /toolkit/src/main/cpp/register_types.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024-present Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | #include "register_types.h" 4 | 5 | #include 6 | 7 | #include "editor/meta_toolkit_editor_plugin.h" 8 | #include "editor/meta_xr_simulator_dialog.h" 9 | #include "export/meta_toolkit_export_plugin.h" 10 | #include "platform_sdk/meta_platform_sdk.h" 11 | 12 | using namespace godot; 13 | 14 | void initialize_toolkit_module(ModuleInitializationLevel p_level) { 15 | switch (p_level) { 16 | case godot::MODULE_INITIALIZATION_LEVEL_SCENE: { 17 | GDREGISTER_CLASS(MetaPlatformSDK_Request); 18 | 19 | // Register generated classes last, because they may use the hand-written ones. 20 | MetaPlatformSDK::_register_generated_classes(); 21 | 22 | // Now that everything is registered, we can safely create our singleton. 23 | Engine::get_singleton()->register_singleton("MetaPlatformSDK", MetaPlatformSDK::get_singleton()); 24 | } break; 25 | case godot::MODULE_INITIALIZATION_LEVEL_EDITOR: { 26 | GDREGISTER_INTERNAL_CLASS(MetaToolkitExportPlugin); 27 | GDREGISTER_INTERNAL_CLASS(MetaXRSimulatorDialog); 28 | GDREGISTER_INTERNAL_CLASS(MetaToolkitEditorPlugin); 29 | EditorPlugins::add_by_type(); 30 | } break; 31 | } 32 | } 33 | 34 | void terminate_toolkit_module(ModuleInitializationLevel p_level) {} 35 | 36 | extern "C" { 37 | GDExtensionBool GDE_EXPORT 38 | toolkit_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, 39 | GDExtensionClassLibraryPtr p_library, 40 | GDExtensionInitialization *r_initialization) { 41 | godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization); 42 | 43 | init_obj.register_initializer(initialize_toolkit_module); 44 | init_obj.register_terminator(terminate_toolkit_module); 45 | init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE); 46 | 47 | return init_obj.init(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an error received from the Meta Platform SDK. 5 | 6 | 7 | Represents an error received from the Meta Platform SDK. 8 | Retrieved from [member MetaPlatformSDK_Message.error]. 9 | 10 | 11 | 12 | 13 | 14 | Represents the error code: 15 | - [code]UNKNOWN_ERROR[/code]: [code]1[/code] 16 | - [code]AUTHENTICATION_ERROR[/code]: [code]2[/code] 17 | - [code]NETWORK_ERROR[/code]: [code]3[/code] 18 | - [code]STORE_INSTALLATION_ERROR[/code]: [code]4[/code] 19 | - [code]CALLER_NOT_SIGNED[/code]: [code]5[/code] 20 | - [code]UNKNOWN_SERVER_ERROR[/code]: [code]6[/code] 21 | - [code]PERMISSIONS_FAILURE[/code]: [code]7[/code] 22 | 23 | 24 | Human readable description of the error that can be displayed to the user. Might be the empty string if there is no user-appropriate description available. Not intended to be parsed as it might change at any time or be translated. 25 | 26 | 27 | It contains the HTTP status code for the error. More information about the http code can be found [url=https://en.wikipedia.org/wiki/List_of_HTTP_status_codes]here[/url]. 28 | 29 | 30 | Technical description of what went wrong intended for developers. For use in logs or developer consoles. 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_PartyUpdateNotification.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a notification about an update to a party. 5 | 6 | 7 | Represents a notification about an update to a party. 8 | 9 | 10 | 11 | 12 | 13 | The type of action related to the party and user that this notification holds. 14 | 15 | 16 | The ID of the party that will be updated. 17 | 18 | 19 | The id of the [MetaPlatformSDK_User] who initiated the action that this party update status notification is in reference to. 20 | 21 | 22 | A timestamp denoting when the party action occurred that this status update notification refers to. 23 | 24 | 25 | The alias of the [MetaPlatformSDK_User] whose party status has changed. This is an alias that is set by the user. 26 | 27 | 28 | The ID of the user, whose party status has changed. 29 | 30 | 31 | The displayable name of the [MetaPlatformSDK_User] whose party status has changed. 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Visual tweaks to the ReadTheDocs theme. 3 | */ 4 | 5 | .wy-nav-side { 6 | background-color: #333f67; 7 | } 8 | .wy-side-nav-search { 9 | background-color: #333f67; 10 | padding-bottom: 1.618em; 11 | } 12 | 13 | .wy-side-nav-search > a img.logo { 14 | width: 64px; 15 | height: 64px 16 | } 17 | 18 | .wy-menu-vertical a { 19 | } 20 | .wy-menu-vertical a:hover { 21 | background-color: #29355c; 22 | } 23 | 24 | @media only screen and (min-width: 769px) { 25 | .wy-nav-side { 26 | left: auto; 27 | } 28 | .wy-body-for-nav { 29 | /* Center the page on wide displays for better readability */ 30 | max-width: 1200px; 31 | margin: 0 auto; 32 | } 33 | } 34 | 35 | /* Override table no-wrap */ 36 | 37 | /* The first column cells are not verbose, no need to wrap them */ 38 | .wy-table-responsive table td:not(:nth-child(1)), 39 | .wy-table-responsive table th:not(:nth-child(1)) { 40 | white-space: normal; 41 | } 42 | /* Allow to control wrapping behavior per table */ 43 | .wy-table-responsive table.wrap-normal td, 44 | .wy-table-responsive table.wrap-normal th { 45 | white-space: normal; 46 | } 47 | 48 | /* Make sure line blocks don't stretch tables */ 49 | .wy-table-responsive table .line-block { 50 | margin-bottom: 0; 51 | } 52 | 53 | 54 | /* Make sure not to wrap keyboard shortcuts */ 55 | .wy-table-responsive table td kbd { 56 | white-space: nowrap; 57 | } 58 | 59 | /* Artificially increasing specificity to make it override theme.css. */ 60 | html.writer-html5 .rst-content .wy-table-responsive > table td > p { 61 | line-height: 1.425rem; 62 | } 63 | html.writer-html5 .rst-content .wy-table-responsive > table th > p { 64 | line-height: 1.425rem; 65 | font-size: .95rem; 66 | font-weight: 600; 67 | } 68 | 69 | html.writer-html5 .rst-content .wy-table-responsive > table td > p tt.literal, 70 | html.writer-html5 .rst-content .wy-table-responsive > table td > p code.literal { 71 | font-size: .85rem; 72 | padding: 2px 5px; 73 | } 74 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ChallengeArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of challenges. 5 | 6 | 7 | An array of [MetaPlatformSDK_Challenge]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns [code]true[/code] if there is previous page of elements. 30 | 31 | 32 | 33 | 34 | 35 | Returns the size of the array. 36 | 37 | 38 | 39 | 40 | 41 | The URL used to request the next page of elements. 42 | 43 | 44 | The URL used to request the previous page of elements. 45 | 46 | 47 | The total count of elements on all pages. 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Purchase.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a purchase. 5 | 6 | 7 | Represents a purchase. 8 | 9 | 10 | 11 | 12 | 13 | The developer payload feature is unimplemented. 14 | 15 | 16 | The time when the purchased [MetaPlatformSDK_Product] expires. This value only applies to subscriptions, and will be null for durable and consumable IAP items. 17 | 18 | 19 | The timestamp that represents when the user was granted entitlement to the [MetaPlatformSDK_Product] that was purchased. 20 | 21 | 22 | The ID string of the purchase. 23 | 24 | 25 | The Reporting ID feature is not implemented. 26 | 27 | 28 | The SKU of the IAP [MetaPlatformSDK_Product] that was purchased. This value is case-sensitive. To retrieve the product information, you can use this value when calling [method MetaPlatformSDK.iap_get_products_by_sku_async]. 29 | 30 | 31 | The type of the IAP [MetaPlatformSDK_Product] that was purchased. 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ChallengeEntryArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of challenge entries. 5 | 6 | 7 | An array of [MetaPlatformSDK_ChallengeEntry]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns [code]true[/code] if there is previous page of elements. 30 | 31 | 32 | 33 | 34 | 35 | Returns the size of the array. 36 | 37 | 38 | 39 | 40 | 41 | The URL used to request the next page of elements. 42 | 43 | 44 | The URL used to request the previous page of elements. 45 | 46 | 47 | The total count of elements on all pages. 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LeaderboardEntryArray.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | An array of leaderboard entries. 5 | 6 | 7 | An array of [MetaPlatformSDK_LeaderboardEntry]s. 8 | [b]NOTE:[/b] This isn't a Godot [Array], but you can loop over it using [code]for x in arr[/code] just like a Godot [Array]. 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Returns an element in the array by index. 18 | 19 | 20 | 21 | 22 | 23 | Returns [code]true[/code] if there is next page of elements. 24 | 25 | 26 | 27 | 28 | 29 | Returns [code]true[/code] if there is previous page of elements. 30 | 31 | 32 | 33 | 34 | 35 | Returns the size of the array. 36 | 37 | 38 | 39 | 40 | 41 | The URL used to request the next page of elements. 42 | 43 | 44 | The URL used to request the previous page of elements. 45 | 46 | 47 | The total count of elements on all pages. 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AssetDetails.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents details about an asset file. 5 | 6 | 7 | Represents details about an asset file. 8 | 9 | 10 | 11 | 12 | 13 | ID of the asset file 14 | 15 | 16 | One of 'default', 'store', or 'language_pack'. The 'default' type denotes this Asset File is used purely as an implementation detail (to download extra content post-installation). The 'store' type indicates that the Asset File should be shown in Store. The 'language_pack' is a special type used to manage different languages and translation data, which can be downloaded post-installation. 17 | 18 | 19 | One of 'installed', 'available', or 'in-progress'. 20 | 21 | 22 | File path of the asset file. 23 | 24 | 25 | One of 'free', 'entitled', or 'not-entitled'. 26 | 27 | 28 | For 'language_pack' assets type, contains language info. 29 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 30 | 31 | 32 | Extra metadata associated with this asset file. 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ChallengeEntry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an entry to a challenge. 5 | 6 | 7 | Represents an entry to a challenge. 8 | 9 | 10 | 11 | 12 | 13 | A displayable score for this challenge entry. The score is formatted with thousands separators and the relevant units are appended based on the associated leaderboard's score type. 14 | 15 | 16 | A 2KB custom data field that is associated with the challenge entry. 17 | 18 | 19 | The length in bytes of [member extra_data]. 20 | 21 | 22 | The unique identifier of this challenge entry which can be used by [method MetaPlatformSDK.challenges_get_entries_by_ids_async] and [method MetaPlatformSDK.challenges_get_entries_async]. 23 | 24 | 25 | Challenges can be ranked by highest or lowest scores within a time period. This indicates the position of this challenge entry. 26 | 27 | 28 | The raw underlying value of the challenge entry score. It is a type of string that is returned by a long integer. 29 | 30 | 31 | The timestamp of the creation of this entry in the challenge. 32 | 33 | 34 | The user corresponding to this entry within the challenge. 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LaunchDetails.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents details about launching an app. 5 | 6 | 7 | Represents details about launching an app. 8 | 9 | 10 | 11 | 12 | 13 | An opaque string provided by the developer to help them deeplink to content on app startup. 14 | 15 | 16 | If provided, the intended destination the user would like to go to. 17 | 18 | 19 | A string typically used to distinguish where the deeplink came from. For instance, a DEEPLINK launch type could be coming from events or rich presence. 20 | 21 | 22 | A launch type that defines the different ways in which an application can be launched. 23 | 24 | 25 | If provided, the intended lobby the user would like to be in. 26 | 27 | 28 | If provided, the intended session the user would like to be in. 29 | 30 | 31 | A unique identifer to keep track of a user going through the deeplinking flow. 32 | 33 | 34 | If provided, the intended users the user would like to be with. 35 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ManagedInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents information about a user with a managed device. 5 | 6 | 7 | Represents information about a user with a managed device. 8 | 9 | 10 | 11 | 12 | 13 | The department name in the organization to which the user blongs to. 14 | 15 | 16 | The email address of the account user which owns the MMA (Meta Managed Account). 17 | 18 | 19 | The employee number of the person who owns MMA (Meta Managed Account). 20 | 21 | 22 | A string which can be used to uniquely identify the user of the MMA (Meta Managed Account). 23 | 24 | 25 | The location of the user. 26 | 27 | 28 | The manager of the user. 29 | 30 | 31 | The user's name. 32 | 33 | 34 | A string which can be used to uniquely identify the organization which owns the MMA (Meta Managed Account). 35 | 36 | 37 | The name of the organization to which the MMA (Meta Managed Account) account user belongs to. 38 | 39 | 40 | The user's position. 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | # Godot Meta Toolkit Demo 2 | 3 | > Note: If using Godot 4.5 or earlier, you'll need to add the Manage External Storage permission 4 | > in export settings for downloadable content to work. 5 | 6 | This is a demo project demonstrating usage of the Meta Platform SDK in a Godot project. Features of the Platform SDK showcased include: 7 | 8 | - Achievements (simple, count, and bitfield) 9 | - In-app purchases / Downloadable content 10 | - Displaying bidirectional followers that also own the app 11 | - Displaying user's name, profile image, and entitlement status 12 | 13 | For more info on using the Platform SDK, see [Getting Started with the Meta Platform SDK](https://godot-sdk-integrations.github.io/godot-meta-toolkit/manual/platform_sdk/getting_started.html) in the official docs. 14 | 15 | ## Setup Info 16 | 17 | If you wish to test this demo for yourself, you will have to submit your own build of the app on the 18 | [Quest Developer Dashboard](https://developers.meta.com/horizon/manage). The features of this app 19 | require the following Data Use Checkup permissions: 20 | 21 | - User ID 22 | - User profile 23 | - In-app purchases and/or downloadable content 24 | - Subscriptions 25 | - Friends 26 | 27 | In order for the achievements and IAP examples to work, you will have to upload these yourself as well. 28 | 29 | ### Achievements 30 | 31 | To test the achievements used in the demo, add the following achievements in the Developer Dashboard at Engagement -> Achievements. 32 | 33 | - An achievement of type `Simple` with the API name `simple-achievement-example`. 34 | - An achievement of type `Count` with the API name `count-achievement-example` and a target value of `3`. 35 | - An achievement of type `Bitfield` with the API name `bitfield-achievement-example`, a target value of `3`, and a bitfield length of `5`. 36 | 37 | ### In-App Purchases 38 | 39 | To test the in-app purchases used in the demo, add the following add-ons in the Developer Dashboard at Monetization -> Add-ons 40 | 41 | - A `Durable` type add-on with SKU `0001`. The demo's `durable_addon.tscn` should be exported as a PCK 42 | and uploaded as a DLC file for this add-on. For more info on how to do this, see the documentation for 43 | [Downloadable Content](https://godot-sdk-integrations.github.io/godot-meta-toolkit/manual/platform_sdk/downloadable_content.html). 44 | - A `Consumable` type add-on with SKU `0002`. 45 | 46 | A subscription with SKU `0003` should also be created at Monetization -> Subscriptions. 47 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_ContentRating.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a content rating. 5 | 6 | 7 | Represents a content rating. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | The list of descriptors which indicate content within the product that may have triggered a particular age rating or may be of interest or concern to consumers, e.g., "Blood and Gore", "Intense Violence", etc. 17 | 18 | 19 | 20 | 21 | 22 | 23 | The list of interactive elements, which advise consumers up front that a [MetaPlatformSDK_Product] includes interactive or online behaviors/options that may be of interest or concern, e.g., "In-App Purchases". 24 | 25 | 26 | 27 | 28 | 29 | URI for the image that needs to be shown for the content rating of the [MetaPlatformSDK_Product]. 30 | 31 | 32 | The age rating text is the text version of the rating used to describe age appropriateness by the International Age Rating Coalition (IARC). 33 | 34 | 35 | The number of descriptors. 36 | 37 | 38 | The number of interactive elements. 39 | 40 | 41 | The URI pointing to a website with International Age Rating Coalition (IARC) rating definitions from local rating authorities (e.g., Australian Classification Board, ESRB, GRAC, etc). 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /.github/workflows/scripts/file_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script ensures proper POSIX text file formatting and a few other things. 4 | # This is supplementary to clang_format.sh, but should be run before it. 5 | 6 | # We need dos2unix and recode. 7 | if [ ! -x "$(command -v dos2unix)" -o ! -x "$(command -v recode)" ]; then 8 | printf "Install 'dos2unix' and 'recode' to use this script.\n" 9 | fi 10 | 11 | set -uo pipefail 12 | IFS=$'\n\t' 13 | 14 | # Loops through all text files tracked by Git. 15 | git grep -zIl '' | 16 | while IFS= read -rd '' f; do 17 | # Exclude 3rd party files 18 | if [[ "$f" == "thirdparty"* ]]; then 19 | continue 20 | elif [[ "$f" == "demo/addons"* ]]; then 21 | continue 22 | elif [[ "$f" == "gradle"* ]]; then 23 | continue 24 | elif [[ "$f" == "build"* ]]; then 25 | continue 26 | elif [[ "$f" == "android"* ]]; then 27 | continue 28 | elif [[ "$f" == *"NOTICE"* ]]; then 29 | continue 30 | elif [[ "$f" == *"LICENSE"* ]]; then 31 | continue 32 | fi 33 | # Ensure that files are UTF-8 formatted. 34 | recode UTF-8 "$f" 2> /dev/null 35 | # Ensure that files have LF line endings and do not contain a BOM. 36 | dos2unix "$f" 2> /dev/null 37 | # Remove trailing space characters and ensures that files end 38 | # with newline characters. -l option handles newlines conveniently. 39 | perl -i -ple 's/\s*$//g' "$f" 40 | # Remove the character sequence "== true" if it has a leading space. 41 | perl -i -pe 's/\x20== true//g' "$f" 42 | # We don't want to change lines around braces in godot/tscn files. 43 | if [[ "$f" == *"godot" ]]; then 44 | continue 45 | elif [[ "$f" == *"tscn" ]]; then 46 | continue 47 | fi 48 | # Disallow empty lines after the opening brace. 49 | sed -z -i 's/\x7B\x0A\x0A/\x7B\x0A/g' "$f" 50 | # Disallow some empty lines before the closing brace. 51 | sed -z -i 's/\x0A\x0A\x7D/\x0A\x7D/g' "$f" 52 | done 53 | 54 | git diff > patch.patch 55 | 56 | # If no patch has been generated all is OK, clean up, and exit. 57 | if [ ! -s patch.patch ] ; then 58 | printf "Files in this commit comply with the formatting rules.\n" 59 | rm -f patch.patch 60 | exit 0 61 | fi 62 | 63 | # A patch has been created, notify the user, clean up, and exit. 64 | printf "\n*** The following differences were found between the code " 65 | printf "and the formatting rules:\n\n" 66 | cat patch.patch 67 | printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i '\n" 68 | rm -f patch.patch 69 | exit 1 70 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Challenge.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a challenge. 5 | 6 | 7 | Represents a challenge. 8 | 9 | 10 | 11 | 12 | 13 | Was this challenge created by a user or the app developer. 14 | 15 | 16 | A displayable string of the challenge's description. 17 | 18 | 19 | The timestamp when this challenge ends. You can retrieve this field from the response of the challenge creation request. 20 | 21 | 22 | The ID of the challenge. This is an unique string that the application will refer to this challenge in your app. 23 | 24 | 25 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 26 | 27 | 28 | The leaderboard associated with this challenge. 29 | 30 | 31 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 32 | 33 | 34 | The timestamp when this challenge begins. You can retrieve this field from the response of the challenge creation request. 35 | 36 | 37 | A displayable string of the challenge's title. 38 | 39 | 40 | An enum that specifies who can see this challenge. 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /thirdparty/godot_cpp_build_profile/create_build_profile.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import re 5 | import json 6 | 7 | SOURCE_DIRS = [ 8 | '../../toolkit', 9 | ] 10 | 11 | GODOT_CPP_HEADERS = "../godot-cpp/gen/include/godot_cpp/classes" 12 | #GODOT_CPP_SOURCES = "../godot-cpp/gen/src/classes" 13 | 14 | INCLUDE_PATTERN = re.compile(r'#include ') 15 | CLASS_PATTERN = re.compile(r'class\s+(\w+)\s*:\s*public') 16 | 17 | processed_files = {} 18 | class_list = [] 19 | 20 | def find_includes(file_path): 21 | """ 22 | Finds all the includes in a given file and returns the list of CLASS names. 23 | """ 24 | includes = [] 25 | try: 26 | with open(file_path, 'r') as file: 27 | content = file.read() 28 | includes = INCLUDE_PATTERN.findall(content) 29 | except FileNotFoundError: 30 | print(f"File not found: {file_path}") 31 | return includes 32 | 33 | def find_primary_class(file_path): 34 | """ 35 | Finds the primary class name in a given .hpp file by looking for 'class ClassName : public'. 36 | """ 37 | try: 38 | with open(file_path, 'r') as file: 39 | for line in file: 40 | match = CLASS_PATTERN.search(line) 41 | if match: 42 | return match.group(1) 43 | except FileNotFoundError: 44 | print(f"File not found: {file_path}") 45 | return None 46 | 47 | def process_file(file_path, top_level=False): 48 | """ 49 | Processes a given file for includes and processes the included files recursively. 50 | """ 51 | if file_path in processed_files: 52 | return 53 | 54 | processed_files[file_path] = True 55 | 56 | if not top_level and file_path.endswith('.hpp'): 57 | primary_class = find_primary_class(file_path) 58 | if primary_class and primary_class not in class_list: 59 | class_list.append(primary_class) 60 | 61 | includes = find_includes(file_path) 62 | for include_name in includes: 63 | hpp_file = f"{GODOT_CPP_HEADERS}/{include_name}.hpp" 64 | #cpp_file = f"{GODOT_CPP_SOURCES}/{include_name}.cpp" 65 | 66 | if os.path.exists(hpp_file): 67 | process_file(hpp_file) 68 | #if os.path.exists(cpp_file): 69 | # process_file(cpp_file) 70 | 71 | def main(): 72 | for dir in SOURCE_DIRS: 73 | for root, _, files in os.walk(dir): 74 | for file in files: 75 | if file.endswith('.cpp') or file.endswith('.h'): 76 | file_path = os.path.join(root, file) 77 | process_file(file_path, True) 78 | 79 | class_list.sort() 80 | 81 | build_profile = { 82 | "enabled_classes": class_list 83 | } 84 | 85 | with open("build_profile.json", "wt") as file: 86 | json.dump(build_profile, file, indent=4) 87 | 88 | if __name__ == "__main__": 89 | main() 90 | 91 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_AdvancedAbuseReportOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents advanced options for an abuse report. 5 | 6 | 7 | Represents advanced options for an abuse report. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Provide a list of users to suggest for reporting. This list should include users that the reporter has recently interacted with to aid them in selecting the right user to report. 17 | 18 | 19 | 20 | 21 | 22 | Clears the custom metadata of the report. 23 | 24 | 25 | 26 | 27 | 28 | Clears the list of users to suggest for reporting. 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | This field is intended to allow developers to pass custom metadata through the report flow. The metadata passed through is included with the report received by the developer. 37 | 38 | 39 | 40 | 41 | 42 | 43 | If report_type is object/content, a string representing the type of content being reported. This should correspond to the object_type string used in the UI. 44 | 45 | 46 | 47 | 48 | 49 | 50 | The intended entity being reported, whether user or object/content. 51 | 52 | 53 | 54 | 55 | 56 | 57 | The video mode controls whether or not the abuse report flow should collect evidence and whether it is optional or not. "Collect" requires video evidence to be provided by the user. "Optional" presents the user with the option to provide video evidence. "Skip" bypasses the video evidence collection step altogether. 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_GroupPresenceOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents options for a group presence. 5 | 6 | 7 | Represents options for a group presence. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Use [method set_lobby_session_id] or [method set_match_session_id] to specify the session. Use the deeplink message override for any additional data in whatever format you wish to aid in bringing users together. If not specified, the deeplink_message for the user will default to the one on the destination. 17 | 18 | 19 | 20 | 21 | 22 | 23 | Set the unique API Name that refers to an in-app destination. 24 | 25 | 26 | 27 | 28 | 29 | 30 | Set whether or not the person is shown as joinable or not to others. A user that is joinable can invite others to join them. Set this to false if other users would not be able to join this user. For example: the current session is full, or only the host can invite others and the current user is not the host. 31 | 32 | 33 | 34 | 35 | 36 | 37 | Set the session ID that represents a closer group/squad/party of users. It is expected that all users with the same lobby session id can see or hear each other. Users with the same lobby session id in their group presence will show up in the roster and will show up as "Recently Played With" for future invites if they aren't already Oculus friends. This must be set in addition to is_joinable being true for a user to use invites. 38 | 39 | 40 | 41 | 42 | 43 | 44 | Set the session ID that represents all the users that are playing a specific instance of a map, game mode, round, etc. This can include users from multiple different lobbies that joined together and the users may or may not remain together after the match is over. Users with the same match session id in their group presence will not show up in the Roster, but will show up as "Recently Played with" for future invites. 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_LeaderboardEntry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents an entry on a leaderboard. 5 | 6 | 7 | Represents an entry on a leaderboard. 8 | 9 | 10 | 11 | 12 | 13 | The formatted score that will be displayed in the leaderboard of this entry. You can select a score type to determine how scores are displayed on Leaderboard. See [url=https://developer.oculus.com/documentation/native/ps-leaderboards/#create]here[/url] for examples of different score type. 14 | 15 | 16 | A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or anything that provides more detail about the entry to the viewer. It will be used by two entry methods: [method MetaPlatformSDK.leaderboard_write_entry_async] and [method MetaPlatformSDK.leaderboard_write_entry_with_supplementary_metric_async]. 17 | 18 | 19 | The length in bytes of [member extra_data]. 20 | 21 | 22 | This is a unique identifier for the leaderboard entry. It is of type `id` and is optional. 23 | 24 | 25 | The rank of this leaderboard entry in the leaderboard. It can be used in [method MetaPlatformSDK.leaderboard_get_entries_after_rank_async] to retrieve leaderboard entries starting from a specified rank. 26 | 27 | 28 | The raw underlying value of the score achieved by the user in the leaderboard. It's of type `long_as_string` and it's used to determine the user's rank in the leaderboard. 29 | 30 | 31 | This may be [code]null[/code], which indicates that the value is not present or that the curent app or user is not permitted to access it. 32 | 33 | 34 | The timestamp of this entry being created in the leaderboard. 35 | 36 | 37 | User of this leaderboard entry. You can request a block of leaderboard entries for the specified user ID(s) by [method MetaPlatformSDK.leaderboard_get_entries_by_ids_async]. 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /doc_classes/MetaPlatformSDK_Product.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Represents a product. 5 | 6 | 7 | Represents a product. 8 | 9 | 10 | 11 | 12 | 13 | The billing plans related to the product. This may be [code]null[/code]. This indicates that the value is not present or that the curent app or user is not permitted to access it. 14 | 15 | 16 | The content rating that specifies the age rating as well as other important information that needs to be displayed to the user per local regulations. This may be [code]null[/code]. This indicates that the value is not present or that the curent app or user is not permitted to access it. 17 | 18 | 19 | The URI for the cover image for the product being sold. 20 | 21 | 22 | The description for the product. The description should be meaningful and explanatory to help outline the product and its features. 23 | 24 | 25 | The formatted string for the [MetaPlatformSDK_Price]. 26 | 27 | 28 | The URI for the product icon. 29 | 30 | 31 | The name of the product. This will be used as a the display name and should be aligned with the user facing title. 32 | 33 | 34 | The [MetaPlatformSDK_Price] of the product contains the currency code, the amount in hundredths, and the formatted string representation. 35 | 36 | 37 | The short description of the product. To be used in conjunction with the [member description]. 38 | 39 | 40 | The unique string that you use to reference the product in your app. The SKU is case-sensitive and should match the SKU reference in your code. 41 | 42 | 43 | The type of product. 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /SConstruct: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from glob import glob 3 | from pathlib import Path 4 | 5 | env = SConscript("thirdparty/godot-cpp/SConstruct") 6 | 7 | opts = Variables('custom.py') 8 | opts.Update(env) 9 | 10 | # Add code generator for the Platform SDK. 11 | from generate_platform_sdk_bindings import scons_generate_bindings, scons_emit_files 12 | env.Append( 13 | BUILDERS={ 14 | "MetaPlatformSDK": Builder(action=scons_generate_bindings, emitter=scons_emit_files), 15 | }) 16 | meta_platform_sdk_bindings = env.MetaPlatformSDK(env.Dir('#toolkit/gen/'), source=[ 17 | env.Dir('#thirdparty/ovr_platform_sdk/Include'), 18 | "generate_platform_sdk_bindings.py", 19 | ]) 20 | 21 | # Add common includes. 22 | env.Append(CPPPATH=[ 23 | "#thirdparty/ovr_platform_sdk/Include/", 24 | "#toolkit/src/main/cpp/include/", 25 | "#toolkit/gen/include/", 26 | ]) 27 | 28 | sources = [] 29 | sources += Glob("#toolkit/src/main/cpp/*.cpp") 30 | sources += Glob("#toolkit/src/main/cpp/editor/*.cpp") 31 | sources += Glob("#toolkit/src/main/cpp/export/*.cpp") 32 | sources += Glob("#toolkit/src/main/cpp/platform_sdk/*.cpp") 33 | sources += Glob("#toolkit/gen/src/*.cpp") 34 | 35 | if env["target"] in ["editor", "template_debug"]: 36 | doc_data = env.GodotCPPDocData("#toolkit/src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml")) 37 | sources.append(doc_data) 38 | 39 | binary_path = '#demo/addons/godot_meta_toolkit/.bin' 40 | android_src_path = '#toolkit/src' 41 | project_name = 'godot_meta_toolkit' 42 | 43 | if env['platform'] == "android": 44 | env.Append(LIBPATH=['thirdparty/ovr_platform_sdk/Android/libs/arm64-v8a']) 45 | env.Append(LIBS=['ovrplatformloader']) 46 | 47 | # Create the library target 48 | if env["platform"] == "macos": 49 | library = env.SharedLibrary( 50 | "{0}/{1}/{2}/lib{3}.{1}.framework/{3}.{1}".format( 51 | binary_path, 52 | env["platform"], 53 | env["target"], 54 | project_name, 55 | ), 56 | source=sources, 57 | ) 58 | else: 59 | library = env.SharedLibrary( 60 | "{}/{}/{}/{}/lib{}{}".format( 61 | binary_path, 62 | env["platform"], 63 | env["target"], 64 | env["arch"], 65 | project_name, 66 | env["SHLIBSUFFIX"], 67 | ), 68 | source=sources, 69 | ) 70 | 71 | Default(library) 72 | 73 | if env["platform"] == "android": 74 | android_target = "release" if env["target"] == "template_release" else "debug" 75 | android_arch = "" 76 | if env["arch"] == "arm64": 77 | android_arch = "arm64-v8a" 78 | elif env["arch"] == "x86_64": 79 | android_arch = "x86_64" 80 | else: 81 | raise Exception("Unable to map %s to Android architecture name" % env["arch"]) 82 | 83 | library_copy_path = "{}/main/libs/{}/{}/{}/lib{}{}".format( 84 | android_src_path, 85 | android_target, 86 | android_arch, 87 | android_arch, 88 | project_name, 89 | env["SHLIBSUFFIX"]) 90 | 91 | library_copy = env.Command(library_copy_path, library, Copy('$TARGET', '$SOURCE')) 92 | 93 | Default(library_copy) 94 | -------------------------------------------------------------------------------- /toolkit/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | id 'org.jetbrains.kotlin.android' 4 | } 5 | 6 | android { 7 | namespace 'com.meta.w4.godot.toolkit' 8 | compileSdk versions.compileSdk 9 | ndkVersion versions.ndkVersion 10 | 11 | base { 12 | archivesName = "godot_meta_toolkit" 13 | } 14 | 15 | defaultConfig { 16 | minSdk versions.minSdk 17 | targetSdk versions.targetSdk 18 | versionName getReleaseVersion() 19 | 20 | ndk { 21 | //noinspection ChromeOsAbiSupport 22 | abiFilters "arm64-v8a" 23 | } 24 | } 25 | 26 | externalNativeBuild { 27 | cmake { 28 | path "CMakeLists.txt" 29 | } 30 | } 31 | 32 | sourceSets { 33 | main.jniLibs.srcDirs += ['../thirdparty/ovr_platform_sdk/Android/libs'] 34 | 35 | debug.jniLibs.srcDirs += ['src/main/libs/debug/arm64-v8a'] 36 | release.jniLibs.srcDirs += ['src/main/libs/release/arm64-v8a'] 37 | } 38 | 39 | packagingOptions { 40 | doNotStrip '**/*.so' 41 | } 42 | 43 | compileOptions { 44 | sourceCompatibility versions.javaVersion 45 | targetCompatibility versions.javaVersion 46 | } 47 | kotlinOptions { 48 | jvmTarget = versions.javaVersion 49 | } 50 | 51 | tasks.matching { it.name.contains("CMake") || it.name.contains("externalNativeBuild") }.all { task -> 52 | def taskPrefix = "" 53 | if (project.path != ":") { 54 | taskPrefix = project.path + ":" 55 | } 56 | 57 | // Disable the externalNativeBuild* and *CMake* tasks as they would cause build failures since 58 | // the cmake build files are only setup for editing support. 59 | gradle.startParameter.excludedTaskNames += taskPrefix + task.name 60 | } 61 | } 62 | 63 | dependencies { 64 | compileOnly libraries.godotAndroidLib 65 | } 66 | 67 | task cleanAssets(type: Delete) { 68 | // Delete the 'addons' directory in the 'assets' folder 69 | delete("src/main/assets/addons") 70 | } 71 | 72 | task cleanCxx(type: Delete) { 73 | delete(".cxx") 74 | } 75 | 76 | task copyDebugAARToAddons(type: Copy) { 77 | from 'build/outputs/aar' 78 | include 'godot_meta_toolkit-debug.aar' 79 | into '../demo/addons/godot_meta_toolkit/.bin/android/debug' 80 | } 81 | 82 | task copyReleaseAARToAddons(type: Copy) { 83 | from 'build/outputs/aar' 84 | include 'godot_meta_toolkit-release.aar' 85 | into '../demo/addons/godot_meta_toolkit/.bin/android/release' 86 | } 87 | 88 | task copyGdExtensionConfigToAssets(type: Copy) { 89 | description 'Copy toolkit.gdextension from the addons directory to the assets directory' 90 | 91 | from '../demo/addons/godot_meta_toolkit/' 92 | include 'toolkit.gdextension' 93 | into 'src/main/assets/addons/godot_meta_toolkit/' 94 | } 95 | 96 | preBuild.dependsOn(copyGdExtensionConfigToAssets) 97 | assemble.dependsOn(copyGdExtensionConfigToAssets) 98 | assemble.finalizedBy(copyDebugAARToAddons) 99 | assemble.finalizedBy(copyReleaseAARToAddons) 100 | clean.dependsOn(cleanAssets) 101 | clean.dependsOn(cleanCxx) 102 | --------------------------------------------------------------------------------