ValveSoftware / steamvr_unreal_plugin

SteamVR Input Unreal Plugin - Documentation at: https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki Sample project (UE4.15-4.23): https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki/sample/SteamVRInputPlugin.zip Sample Project (UE.424+): https://github.com/ValveSoftware/steamvr_unreal_plugin/wiki/sample/SteamVRInputPlugin_UEIntegrated.7z

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SteamVR Nodes keep disappearing from Anim graph of Anim BP

BreakMaker opened this issue · comments

Hi Rune,

Hope you are doing fine.
Recently I ran into an issue where the SteamVR nodes, particularly the 'SteamVR Set Wrist Transform' and the 'SteamVR Skeletal Anim Pose' nodes disappear from the Anim BP every time I close / reopen the project. As a result, of course, the AnimBP breaks and the hand does not animate. I can recreate the nodes in the AnimBP, and if I test it immediately without closing the project, all works fine. But if I reopen the project the nodes are lost again.

Here is one affected part of the Anim Graph before I close the project (here, everything is fine)

Screen2021-03-02 21 15 46

...and after I close and reopen the project (nodes gone):
Screen2021-03-02 21 16 37

In the log I found this:
LogLinker: Warning: While loading '/Pawn/Animation/RightHand_AnimBP_ValveIndex.uasset' failed to load '/Script/SteamVREditor': Can't find file

I checked an earlier version of my project where this problem does not occur, and there I could not find such an entry in the log.

Here is what I tried:

  1. I tried deleting the Saved and Intermediary folders (because one other user who reported the same issue about a year ago was instructed by you guys to do so). Did not help in my case.
  2. Made sure the SteamVRInputPlugin does work in my project. I do have action and axis input without any issues, so this one seems ok.
  3. Pulled the same project through perforce to another PC, and the problem persisted there as well.

Thanks a lot for your help in advance.
Best regards.

Hi @BreakMaker - which version of the engine is this?

Forgot to mention. 4.25.

Thanks @BreakMaker - tested in the latest UE 4.25.4 with this project:
https://raw.githubusercontent.com/wiki/ValveSoftware/steamvr_unreal_plugin/sample/SteamVRInputPlugin_UEIntegrated.7z

I'm unable to repro however. Was the project upgraded from a lower version and perhaps used the marketplace version of the plugin at some point? I do recall issues with upgraded projects from the marketplace plugin, but usually deleting Saved and Intermediate helps, unless the project was saved with issues. One quick way to check is if you have the "SteamVRInputDeviceFunctionLibrary" in the following engine path (and nowhere else):

image

Thank you. I checked it, and the function library is where it is supposed to.
image

I think I started using the plugin at 4.25 but I will double check my change log first thing in the morning.

Also, I do have an earlier version of my project, which is not affected by this problem, and that version also runs on 4.25.4 (I just checked it yesterday).

So what changed between my older version and the current one? Quite a lot actually, a complete refactor of my project, whereby I moved all functionality that lived on the pawn and the VR hand actor to components so the system works without an a priori knowledge of the pawn that it is added to.
However, as far as the animation blueprint with the disappearing node is concerned: Almost nothing has been changed there. The only thing that I can think of is the assets that have hard references to anim BP changed. Can this be a lead? Yesterday I found a forum post where one guy posted that he had encountered the same issue, which he then solved by replacing the hard references with an interface system.

if there were renames involved in your refactor, that might be another thing so cleaning up redirectors if you havent already might help.

you can try recreating the anim bps (copy paste nodes to a new anim bp) and see if that helps.

Hi, Thanks!
yes, the redirectors were already fixed (in the past I had learned my lesson the hard way to fix up redirectors everytime, I rename or move something: -) )

Following on the other lead, I managed to keep the node from disappearing when I added the node to a brand new anim BP!!!

I will now try and recreate the entire animation blueprint and establish the needed communication from other assets to the anim BP and see if the nodes remain intact. Thanks!

Hi Rune,
interesting new insights:

So I recreated the AnimBP by just copypasting everything from the old anim BP. After that I restarted the project and the SteamVR nodes were there. So everything was fine until this point.

Then I went on to replace the references to this asset in the one and only asset that referenced this anim BP, which is an actor component BP. In this actor component, there is a function where I cast the anim instance of the hand skeletal mesh to the anim BP. I reimplemented this cast to reflect the new anim BP. After restarting the project the SteamVR Nodes were gone again!

So it seems as though it is not allowed to cast to the anim BP from another actor or a component? It is not a big deal I can setup an anim BP interface and do it that way, but I would like to know why this is happening?

Addition:

Alongside the casting above, I also found a second cause: When the class reference is hardcoded like this:

image

Essentially: I set the anim instance class of the skeletal mesh hand using a class selector based on whether or not the user declares to use the valve index (since I could not find a way to check dynamically if the Knuckles are used or not). The reference viewer does not see this as hard reference, but it causes the SteamVR nodes to disappear.

So this is a second cause, and this is truly a problem for me. I cannot think of a set up going around this. I really do not want my clients to have to mess around with setting the right animBP, so I want to make everything automatic.

Any feedback is much appreciated, thanks for your support.

This is what I got in the message log after restarting

image

Hi Rune,
interesting new insights:

So I recreated the AnimBP by just copypasting everything from the old anim BP. After that I restarted the project and the SteamVR nodes were there. So everything was fine until this point.

Then I went on to replace the references to this asset in the one and only asset that referenced this anim BP, which is an actor component BP. In this actor component, there is a function where I cast the anim instance of the hand skeletal mesh to the anim BP. I reimplemented this cast to reflect the new anim BP. After restarting the project the SteamVR Nodes were gone again!

So it seems as though it is not allowed to cast to the anim BP from another actor or a component? It is not a big deal I can setup an anim BP interface and do it that way, but I would like to know why this is happening?

Did you mean cast a anim instance var to the new "anim instance" (the class not the BP)? that should be right, not sure why it would break your BP by simply referring to it. I did try though just to be sure in a clean sample project to double check and am unable to repro.

its sounding really like something's gone wrong with your project during an upgrade or perhaps moving BPs from one project to another where I've seen behaviour like this. I'd try to recreate all the BPs with the copy paste approach to make it faster. But this seems beyond the scope of our support as this is more project/UE specific rather than an actual issue with our plugin.

it may be better to get help from other UE devs in the official Epic forums and/or UDN (Unreal Developer Network) for a customized support coming from Epic engineers.

I managed to find a solution to both of my problems. For good measure (for anyone else finding themselves in the same situation) here is what I found out:

Did you mean cast a anim instance var to the new "anim instance" (the class not the BP)? that should be right, not sure why it would break your BP by simply referring to it. I did try though just to be sure in a clean sample project to double check and am unable to repro.

This is how the cast was implemented, I did not store the anim instance in a variable, I used the out object of "Get anim instance" cast it to the Anim BP. For the top part (where the anim BP is just a generic one without SteamVR nodes), all works fine. The below one results in the situation with the disappearing SteamVR Nodes (all other nodes in the anim graph are ok).

Screen2021-03-04 10 45 31

So this was one of the causes of the problem, which I managed to solve by using an interface message rather than casting:

image

The other cause of the problem having a class selector with a reference to the anim BP with the Steam VR Node
Screen2021-03-04 11 11 41

This issue was solved by using a soft reference (finally I discovered for myself what they can be good for :D ) and then asynchroniously load the class.

image

its sounding really like something's gone wrong with your project during an upgrade or perhaps moving BPs from one project to another where I've seen behaviour like this. I'd try to recreate all the BPs with the copy paste approach to make it faster. But this seems beyond the scope of our support as this is more project/UE specific rather than an actual issue with our plugin.

You say somethin has gone wrong with my project. In my view, nothing else is wrong. I do not see any indication why something should be wrong with my project. All BPs can comply, all other AnimBPs (which do not have SteamVR nodes) in them work well, no other nodes are disappearing in the anim BPs even if I hard reference / cast to / them. I am also not the first one with this problem:

Cosmic Debris had the same issue in February 2020, (https://forums.unrealengine.com/development-discussion/vr-ar-development/1614178-valve-s-steamvr-input-plugin/page4#post1725322 )
BlackHatBrain posted the same issue in May 2020 (
https://forums.unrealengine.com/development-discussion/vr-ar-development/1614178-valve-s-steamvr-input-plugin?p=1741975#post1741975 ). Here there seems to be no follow up at all.

it may be better to get help from other UE devs in the official Epic forums and/or UDN (Unreal Developer Network) for a customized support coming from Epic engineers.

Contacting Epic and going through UDN sounds like a good idea, however, I am not a custom licensee and have no access to UDN. I also do not know why Epic should pick this up if you guys are not interested.

Do not get me wrong, I solved my issue, I am all good now. I also love the Knuckles. I simply assumed you would be interested in improving the stability of the plugin. it is totally up to you what you do with this information.

Best regards!

Thanks for the feedback. I mentioned an issue with the project itself as it's not cleanly reproducible in my understanding of the steps you've taken and tests of those steps in a clean project. Casting on a different BP and have that affect another BP shouldn't happen.

The anim nodes are native to the engine in 4.25, so them disappearing on Editor restart is terribly unusual. It would seem the plugin itself has been disabled or something else in the project is turning it off or preventing its boot up which would cause references to disappear in your BP.

There have been cases where another plugin short-circuits the standard UE plugin start-up process (completely unrelated to VR) and therefore other plugins in the project arent able to start including ours, and therefore the nodes provided by the plugin isn't available and the editor cannot load them so they would seem to "disappear". So may not necessarily mean an issue itself with the plugin.

However, if you can provide us with a minimal project and repro steps, then that'll certainly point to an issue in the plugin and I may be able to help trace and fix it.

@1runeberg @BreakMaker
Just dropping a note here that I've fixed a very similar issue with nodes and references for a specific plugin disappearing on engine restart in 4.26 by changing the "LoadingPhase" field for the related plugin's Editor Module from Default to PreDefault, in that plugin's .uplugin file.

In my case the plugin had to do with IK nodes in an AnimBP. I checked the issues list here because I have the same issue with the Steam nodes reported here :) though I can't check the latest source being used to confirm. While the source here for 4.23/4.24 loads SteamVR Input in PostEngineInit, this might be an issue for the SteamVR plugin itself.

"LoadingPhase": "PostEngineInit",

I'm not sure what exactly changed from 4.25 to 4.26 to cause this problem but seems that loading dependencies changed between versions.

Referencing what looks like a duplicate issue here. Again in my case the issue occurs in projects made with 4.26 and with the Built-In SteamVR + SteamVR Input plugins enabled.
#138

Hi @viridiancity - the loading phase is intentional for this plugin. Any other plugins that need to consume this plugin or use it needs to load later. We can't load the plugin earlier due to engine xr architecture considerations.

I managed to find a solution to both of my problems. For good measure (for anyone else finding themselves in the same situation) here is what I found out:

Sadly, this issue popped up in our project over the past weeks and we are not able to track down the source of the problem. We're on 4.27.2 and none of the files related our index controller hand tracking have changed. I tried the workaround from @BreakMaker of asynchronously loading the classes, but without success. The nodes still go missing when restarting the editor.
Changing the loading phase of plugins is something I haven't tried yet but I am unsure about what plugins i should be changing the load order of.
Does anyone have new insights into this issue?