Code Monkey home page Code Monkey logo

Comments (7)

croxis avatar croxis commented on July 26, 2024 1

This bug reared its head for me with 1.1.0 of godot-openvr and godot 3.3.2, windows 10 steam version. I had to copy the actions folder to my exported exe folder to get it working.

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

Cheers Ben, as we discuss we'll have a look at how the core team reacts on how this is supposed to work before we change anything on our side, especially with the viable workaround in just setting the path directly on our config object.

Bit of a nuisance this. I don't test the exports often enough.

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

I really need to get back onto this, we learned some more about this but I haven't had the time to implement it.

The much bigger problem is that when exporting our game our json files get included in our gamepack file, out of reach of OpenVR.

My suggestion is that we do away with the setting all together. We should look for the config files in 3 fixed locations in order:

  1. check for an actions folder alongside the executable and use those (this is for release)
  2. else check for an actions folder in the root of our project (for custom files)
  3. if that doesn't exists use the actions folder in our plugin (our backwards compatible defaults)

Then we implement an EditorExportPlugin class that will grab either the json files in location 2 or 3 and export them to an actions folder alongside the executable (so end result is 1)

from godot_openvr.

ChristophHaag avatar ChristophHaag commented on July 26, 2024

For xrdesktop we compile the action and bindings manifests into the application as a resource and when running, the manifests are written to a file at the standard cache path, ${XDG_CACHE_HOME} on linux.

Though this poses the question whether to overwrite the manifest when the user edited it (we say yes because the SteamVR binding ui stores altered bindings independently of the bindings manifest).

from godot_openvr.

lyuma avatar lyuma commented on July 26, 2024

We successfully got things working on export builds. I'm going to document the workaround we used, though hopefully it will cease to be necessary once fixed upstream:

if ProjectSettings.globalize_path("res://") == "":
    openvr_config.action_json_path = OS.get_executable_path().get_base_dir() + "/" + action_json_filename
else:
    openvr_config.action_json_path = "res://addons/vr_manager/openvr/" + action_json_filename

Note: The above solution checks directly for the cause of the issue: if globalize_path fails to produce a global path, we use the base directory of the executable path.

I recommend using globalize_path here instead of checking for "standalone" or "release" platforms, as platform checks fail if you export a debug build; or if you test an export build with a editor/tools build of the engine.

It's also your responsibility to ensure that .json bindings and actions files are actually exported. Our build system takes the actions directory from (in our case) addons/vr_manager/openvr/actions and copies it to EXPORT_DIR/actions, for example. This seemed to me to be far less error-prone than listing json files in every export configuration, but ymmv

Hope this helps others who run into this until fixed upstream.

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

Ok I've got this working so that during development it looks for the action files in a folder called actions in the root of your project first, and if it doesn't exist it will use the default action files it will look for the folder in the godot_openvr addons folder.

When exporting your project it will export those files alongside your exe.

When running in runtime it will use the files alongside the exe (this is always the first place it looks even in development)

See #105

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

If I recall correctly you need to enable the plugin in the plugins tab of your project settings for the export to copy over the files for you. Could remember wrong though.

from godot_openvr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.