Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden gdns parameters can be lost and cause impossible to fix bugs such as two left hands #234

Open
goatchurchprime opened this issue Oct 14, 2022 · 1 comment

Comments

@goatchurchprime
Copy link

Let's take the right_hand_mesh.tscn scene which contains the right_hand.glb model with the OpenXRPose.gdns script attached to it.
image

There are 3 script variables (invisible_if_inactive, action, and path) which can only be seen when the project is running in debug mode in the headset.
image

These are registered in the startup phase here: https://github.com/GodotVR/godot_openxr/blob/master/src/gdclasses/OpenXRPose.cpp#L10 and don't exist otherwise in the editor.

So how do they get set?

Well, you can only find them in the scene code when you open it in a text editor.

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

[node name="HandModel" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.5, 1, -0.5 )
script = ExtResource( 3 )
**path = "/user/hand/right"**

[node name="Skeleton" parent="HandModel/Armature" index="0"]
bones/9/bound_children = [ NodePath("IndexTip") ]
script = ExtResource( 1 )
**hand = 1**

There is simply no way to see or change these settings in the Godot editor.

What's really bad is that the moment you open the right_hand_mesh.tscn in the Godot editor as a new tab, the editor saves over it and deletes all these hidden variables. This leaves you now with two left hands (the default)!

What can be done?

Is this problem of easily lost pre-set hidden parameters still in Godot4, or is the system fundamentally different?

The solution that I can think of is to put in a some hacky functions that reset these values, similar to _update_motion_range() in hand_mesh.gd which sets one of these hidden parameters in the Skeleton (and stops the project running in pancake mode).

We're going to need similar functions everywhere that there is an OpenXRPose used.

@goatchurchprime
Copy link
Author

I'll need to redo that pull request from the start again. I can use _enter_tree() to reset the parameters in the lower nodes before their _ready() gets called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant