Forum Discussion
GoranRiddle
3 years agoExplorer
Add animation to Avatar in Unity
I want to use avatars from Meta SDK as NPCs in an experience that I'm developing, using some Mixamo animations to make them look more alive. However I can't find a way to add an Animator controller to the OVRAvatarEntities.
Has anyone done this?
6 Replies
Replies have been turned off for this discussion
- olaysiaExpert Protege
I think there might be a simpler way of doing this.
- Use OvrAvatarEntity.RecordStreamData() to record yourself doing some animations.
- Use OvrAvatarEntity.ApplyStreamData() to apply those same animations onto your NPC character.
- GoranRiddleExplorer
Didn't think of that. Do you have a tutorial, documentation or something that shows the basic usage of RecordStreamData?
- Use OvrAvatarEntity.RecordStreamData() to record yourself doing some animations.
- VladimirGrygorievHonored Guest
HI, guys!
Did you find some workable solution with OvrAvatarEntity.RecordStreamData() and OvrAvatarEntity.ApplyStreamData()? I tried several variants and all of them are failed. I have a lot of warnings about "Failed to apply stream data" and "assertion failed".
- bdstudioExplorer[Unity]Check out SampleRemoteLoopbackManager.csRecord data in LateUpdate or coroutine every 0.X second, depends on how dense data you want:
PacketData packet = new PacketData(); packet.lod = lod; packet.dataByteCount = SourceAvatar.RecordStreamData_AutoBuffer(lod, ref packet.data); if (lod == recordLOD || recordLOD == StreamLOD.Full) recordedAvatarData.Data.Add(packet); // recordedAvatarData.Data is scriptable struct for holding list of PacketData //Read data (preferably in LateUpdate but depending on your needs): // iterate over your recordedAvatarData.Data if (packet.lod == recordLOD || recordLOD == StreamLOD.Full) loopbackAvatar.ApplyStreamData(data);The only problem with this approach is: you can not loop animation, it always breaks. Currently only workaround i found is to play it using ping-pong (from beginning to the end, then from end to beginning)
- bdstudioExplorer
Small update!
I miracleously solved the mystery (although its still work-around) but this time with no drawbacks.
zeroing-out 2 values in avatar data apparently responsible for ovrAvatar2StreamingPlaybackState.remoteTime
these two values indexes are 12 and 13 (in all low/medium/high data types)- Tank19991027Honored Guest
Very appreciate your work!
I am curious that how do you find out 12&13 are indexes responsible for ovrAvatar2StreamingPlaybackState.remoteTime?
Since I didn't find a way to decompose PacketData.data structure
Thanks!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 11 months ago
- 3 years ago
- 6 months ago
- 9 days ago
- 4 days ago