virtual-puppet-project / vpuppr

VTuber application made with Godot 4
Mozilla Public License 2.0
750 stars 62 forks source link

improve behavior on tracker start #63

Closed Zutatensuppe closed 3 years ago

Zutatensuppe commented 3 years ago

Prior to this, there was a 3 seconds timer during which the model would weirdly be rotated or otherwise transformed (only on first start of tracker) Then after the 3 seconds, you had to be in the right position kind of, to make the tracking work right (i didnt know about the ability to press ENTER to get offsets read anew, I didnt really understand what that part in the readme meant, but now i do^^) The model got strangely rotated on first 'Start Tracker' since starting the program, because the default value of stored_offsets was not null, but actually a StoredOffsets object, so the check in _physics_process to prevent tracking didnt work (i think). It would always try to read data from openseegd, and as soon as there was data, calculate some offsets from that default StoredOffsets object, and only after 3 seconds adjust itself.

This pr makes it so that as soon as there is data, the offsets get calculated and tracking starts.

There is one change to the previous behavior introduced by this: when stopping and starting the tracker, the offsets are re-read, where before they would be stored during tracker restarts. If that behavior is desired, then in tracking_stopped i can remove the stored_offsets = null line, and it will behave as before (just without the 3 seconds delay and weird transformy thingy).

you-win commented 3 years ago

the model would weirdly be rotated or otherwise transformed

This is because the raw data from OpenSeeFace actually looks like this and, in my experience, can differ from camera to camera. That's why I don't try to fix it when reading the data packets but instead use offsets.

I think there's a Timer node present in the ModelDisplayScreen.tscn scene tree that should be removed. Once that's done, I think this PR can be merged.

Zutatensuppe commented 3 years ago

I think there's a Timer node present in the ModelDisplayScreen.tscn scene tree that should be removed. Once that's done, I think this PR can be merged.

I think there is no timer node, it was always created on the fly, The scene itself only contains a container for the Model and a container for the Props as far as i can see. =)

image

you-win commented 3 years ago

Oh I'm dumb, you are right 🙃

Thanks for the PR!