GodotVR / godot_openxr

(Maintenance mode) OpenXR drivers for the Godot Game Engine v3.x
MIT License
278 stars 45 forks source link

Saving the hand_mesh.gd file overwrites the hand=1 setting in right_hand_mesh.tscn #205

Open goatchurchprime opened 2 years ago

goatchurchprime commented 2 years ago

The Script variable "Hand" is missing from the Inspector in this docs page https://docs.godotengine.org/en/stable/tutorials/vr/openxr/handtracking.html#node-based-hand-tracking

This made it really hard to discover that its value is wrong in the release version of the plugin (from Feb 19).

If you unzip the distribution: https://github.com/GodotVR/godot_openxr/releases/tag/1.2.0 the code in /godot_openxr_1.2.0/addons/godot-openxr/scenes/right_hand_mesh.tscn is mssing the important setting that is present in the demo code:

https://github.com/GodotVR/godot_openxr/blob/master/demo/addons/godot-openxr/scenes/right_hand_mesh.tscn#L23

[node name="Skeleton" parent="HandModel/Armature" index="0"]
bones/9/bound_children = [ NodePath("IndexTip") ]
script = ExtResource( 1 )
hand = 1             <------------------- this hidden value is missing!!!

This means that you get two left hands no matter what.

BastiaanOlij commented 2 years ago

Those values should be coming from the GDNative script so it sounds like the script is not applied properly (thought that should be the script = ExtResource ( 1 ) bit). Is this issue that is reproducible on the latest master because it is working fine for me?

goatchurchprime commented 2 years ago

You're right. I double-checked and I thought I was losing my mind

However I can now recreate the problem, which I think is pretty bad and might need to go into the main Godot tickets, though I don't know where:

Step1: Download and install OpenXR Plugin

Step 2: Open the file yourproject/addons/godot-openxr/scenes/right_hand_mesh.tscn in a text editor (so you can watch it change)

Step 3: Open scenes/right_hand_mesh.tscn in the Godot editor

Step 4: Click on the script on the root node: res://addons/godot-openxr/scenes/hand_mesh.gd

Step 5: Click Control-S to save the file. (Why? Maybe by habit, or you put in some debug print statements.)

Step 6: See that line 18 'path = "/user/hand/right"' and line 23 'hand = 1' both disappear from the tscn file

Step 7: Now you have two left hands and there is no way to see why.

Is it because the hand value is hidden and not properly disclosed to the user interface that it gets over-written/deleted?

BastiaanOlij commented 1 year ago

Owh that sounds like a bug in the editor. Saving the script will cause Godot to update the properties on the scenes loaded, but it shouldn't be changing values of properties that have been overriden in the scene.