NeoSpark314 / godot_oculus_quest_toolkit

An easy to use VR toolkit for Oculus Quest development using the Godot game engine
MIT License
367 stars 38 forks source link

Make into plugin #38

Open Wavesonics opened 4 years ago

Wavesonics commented 4 years ago

I was just setting up a new project with OQT and thought it might be nice for new users to make things a little more automatic with a plugin. It could automatically add the vr singleton for them and remove one more step.

NeoSpark314 commented 4 years ago

Can you detail a bit what this Plugin would mean (or point me to some documentation)? I am not familiar with this. Making the toolkit easier to use would be great.

Wavesonics commented 4 years ago

Ok, I made a branch showing how it could work. This only look like 10 minutes so no pressure to merge the PR :P

I added 2 new files: plugin.cfg and plugin.gd

It'll show up in the plugins tab of project settings now, and when enabled, it will automatically add the vr autoload singleton. When disabled it'll remove it.

Since plugins generally live in the addons sub dir, I moved the OQ_Toolkit dir into there, but that's optional of course. It could stay in the project root if you want.

Personally I always move OQ_Toolkit to the addons dir as it cleans up the root for my project code, but that's just personal preference.

One last point for moving it into addons/ is when someone adds this via the asset library, they know they can just click the addons/ dir when installing, and leave the rest out if they don't want demo code, since that seems to be the standard convention.

Wavesonics commented 4 years ago

One more idea, if we have this plugin, we could add certain things as Nodes to the editor.

Some parts of the toolkit make sense as scenes to be instanced, but other parts I think should be named nodes that could instead be added by users via the normal "Add child node" interface.

These seem like good candidates to me:

Wavesonics commented 4 years ago

image

Example of adding the core scripts as nodes in the editor.

(Maybe someone can make a better icon than me ;P)

Wavesonics commented 4 years ago

The last thing that would be sorta nice, is to automate the adding of vr.initialize() but it'd have to be done in a way that was still configurable for more advanced users... Maybe a check box on OQ_ARVROrigin that is checked by default, and when checked will call vr.initialize() in _enter_tree() or something? idk...

If that particular solution was chosen, we'd need a guard to prevent multiple calls to initialize I think. But that might be a nice safety feature anyway.

Wavesonics commented 4 years ago

I added that (auto initialize of vr singleton) to the branch so you can see if you like it. We can cherry pick bits and pieces from this branch if you like any of it.