ruyo / VRM4U

Runtime VRM loader for UnrealEngine5
Other
1.41k stars 182 forks source link

VRM Spring Bone animations worked in the Editor, but not in the cooked build; Had to manually assign Vrm Meta Object reference to fix #435

Closed andreiagmu closed 1 week ago

andreiagmu commented 2 weeks ago

Unreal Engine v5.4.4 VRM4U v20241007

Describe the bug I had an issue where the VRM Spring Bone animations worked in the Editor, but not in the cooked build. Turns out I needed to explicitly assign the Vrm Meta Object reference, in my character's ABP_Post animation blueprint.

capture_20241105_191602_014_edit

capture_20241105_191643_015_edit

Inside ABP_Post, there are a few nodes that have the Enable Auto Search Meta Data property. But it seems this property only works in the Editor.

capture_20241105_191721_016_edit

capture_20241105_191748_017_edit

Ideally, the Vrm Meta Object reference should be already assigned when importing the character. Or, the Enable Auto Search Meta Data logic should be improved, to also work in the cooked build.

ruyo commented 2 weeks ago

Hi. I think the reason is that vrmassetList is not a cook target. Please check it in the reference viewer and make sure it is referenced by the assets to be Cooked. AutoSearch itself is working correctly after the cook.

andreiagmu commented 2 weeks ago

Note: My avatar is dynamically spawned in the map via a custom BP, which is set as my Default Pawn Class in my Game Mode BP. I think it would be ideal if the VrmMeta comes already assigned to the ABP_Post when importing the avatar, to better support this (common) use case. More details below.

After checking the Reference Viewer, it seems that when I don't add the explicit VrmMeta reference to ABP_Post, the only thing referencing VrmMeta is the VrmAssetList. The VrmAssetList is, in turn, referenced by the VrmMeta only. The VrmMeta/VrmAssetList doesn't reference my avatar's other assets (e.g.: Skeletal Mesh), Default Pawn Class BP, Game Mode BP, etc.

But after I add the explicit VrmMeta reference to ABP_Post, then the VrmMeta is also referenced by the ABP_Post, which is in turn referenced by: the avatar's Skeletal Mesh -> my custom Default Pawn Class BP -> Game Mode BP

The full reference chain (after adding the explicit reference) is: VrmMeta -> ABP_Post -> the avatar's Skeletal Mesh -> my custom Default Pawn Class BP -> Game Mode BP

Note: In my project, I use the List of maps to include in a packaged build setting from Project Settings -> Project -> Packaging, to avoid cooking unused/unneeded assets. Maybe this is also affecting the VrmMeta/VrmAssetList references somehow.

I see (from multiple GitHub issues) that other users have problems where "VRM works correctly in the Editor but not on the cooked build" and the fix is to simply "explicitly assign the VrmMeta reference to the proper place(s)". If the VrmMeta reference(s) were already explicitly assigned during the avatar import process, I think this would avoid a lot of headaches in the long run.

andreiagmu commented 1 week ago

Fixed in release 20241110. Thanks!