Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
111 stars 0 forks source link

Crash on FBX Import (Booth SIGNALIS Elster) #168

Open Enverex opened 7 months ago

Enverex commented 7 months ago

Describe the bug?

Trying to import elster.fbx from this package results in Resonite hard crashing. It locks up for a few second then completely dies (no Unity crash handler).

To Reproduce

Download the package from here - https://booth.pm/en/items/4913158 (free) Then try and import elster.fbx from the extracted contents.

The settings I chose when importing were:

Expected behavior

For Resonite not to crash ;)

Screenshots

No response

Resonite Version Number

2023.10.13.743

What Platforms does this occur on?

Windows

What headset if any do you use?

No response

Log Files

Player.log

Player log doesn't have anything useful and no Unity Crashlog appears to be generated so no useful logs. But the FBX is provided so hopefully that's enough on it's own to track down the issue.

Additional Context

No response

Reporters

No response

troyBORG commented 7 months ago

Do you know did the avatar creator use Maya by chance? I know the creator of the Zorrix I use. When you import their FBX it did the same thing.

Because they used a "newer" version of the FBX format

I know on the old platform wiki it said: Autodesk ( .fbx ) - Must be FBX 2011, 2012 or 2013, newer ones won't work.

I had to convert the model from FBX to GLTF then import it would import into blender without the bones going phsyco, so I can edit it and then export it as FBX and that worked.

Enverex commented 7 months ago

I have no idea what was used to create it unfortunately. The game hard-crashing is obviously an issue regardless.

kazu0617 commented 7 months ago

@troyBORG

I certainly think that's what I'll do when I do my research, and I'll do that when I do my research. But more than that, I think the condition of "crashing reliably when an unsupported FBX comes in" is a big problem, especially when setting up avatars for beginners. In fact, if it crashes, it increases the likelihood that they will quit the game. So when an unsupported FBX comes in, I'd like you to stop the importer with a proper "unsupported FBX" and I hope they stop the importer.


確かに調査するとそうなると思うし、自分が調べるときはそうするよ。 ただ、それ以上に「サポート外のFBXが入ったときに、確実にCrushする」状態は特に初心者にアバターをセットアップしてもらうときには大きな問題になると思う。実際クラッシュしてしまうとそこでゲームをやめてしまう可能性が高まるからね。 なので、サポート外のFBXが来たときにきちんと「対応していないFBXだよ!」とインポータを止めて欲しいな。

GearBell commented 6 months ago

I keep crashing as well with fbx imports. I am using Blender 2.79 (sue me), exports from older programs seems to be the cause. Anything Blender +3.0 seems to work. GTLF works just fine, though it does odd things for the blendshapes (not important to this). So far importing the fbx into a 3.0 blender then reexporting it works, however it rearranges the blendshapes, making a mesh transfer unusable. I am able to reproduce it consistently, however it is with a private avatar, so I will only provide the raw file to a dev if they request it. So far it is consistent if I use any blender older than 3.0.

Frooxius commented 6 months ago

This looks like an Assimp bug, I put this file into Assimp's unit test and it fails: image

We'll have to make a report to them with the model file. If you want, you can report it yourself, otherwise it might take a bit before we make the report ourselves.

GearBell commented 6 months ago

Is there a bandaid patch to roll back to the older assimp library until this is fixed (Im only quoting what I have heard from others with that piece)? I cannot import my own avatars or most other work until this is fixed.

troyBORG commented 6 months ago

This looks like an Assimp bug, I put this file into Assimp's unit test and it fails: image

Where do I get that tester. The FBX file that was for my Model (Which I think is just a newer FBX format) that crashes the game as well. I wanna see what it reports about it.

Frooxius commented 6 months ago

@troyBORG It's part of the Assimp project: https://github.com/assimp/assimp

@GearBell Is this a regression? Do FBX files that worked before not work anymore? Are you able to provide me any samples for these?

GearBell commented 6 months ago

@Frooxius Yes the fbx files worked previously - I am currently wearing the latest version which is about a month old. It just crashes me now to import the fbx. I will send you the raw FBX in DMs - it is a nonpublic avatar though so please delete it when done testing.

TisFoolish commented 6 months ago

I cannot import my own avatars or most other work until this is fixed.

Why not export them as gltf/glb and then import them as that. It's a significantly better and easier to support format

troyBORG commented 6 months ago

@troyBORG It's part of the Assimp project: https://github.com/assimp/assimp

I tried and I don't get those error reporting messages mine only shows this: image

Enverex commented 6 months ago

Yeah, it fails on it for me:

assimp info elster.fbx
Launching asset import ...           OK
Validating postprocessing flags ...  OK
double free or corruption (!prev)
Aborted (core dumped)
GearBell commented 6 months ago

I cannot import my own avatars or most other work until this is fixed.

Why not export them as gltf/glb and then import them as that. It's a significantly better and easier to support format

Both DAE and GTLF for some reason are no longer importing with blendshapes. They were working yesterday, though gtlf slightly corrupted the blendshapes (the body moves forward per blendshape, stacking makes the whole character move for some reason), but today blender files, dae, and gtlf are all importing with no blendshapes.

GearBell commented 6 months ago

So, this is new - I imported an fbx model that has no blendshapes, its a simple prop house off of sketchfab - it crashed me. There is no bones or blendshapes. Its just a downloaded model. Did not crash me when putting into blender and exporting as obj. I thought it is worth reporting that even prop fbx now have a chance to crash you.

GearBell commented 6 months ago

Should I keep reporting imports that crash? Or is there enough to go off of that its on the list of bugs being looked at? I dont want to over-spam this.

Frooxius commented 6 months ago

@GearBell I mainly just need to collect files that cause the crash so I can test and potentially make a report.

If you have any files that cause crash that you'd be okay sharing publicly, those would be most useful - we can send them to developers of Assimp.

troyBORG commented 6 months ago

I wonder if we can do the same thing for the Zorrix Model?
Its a paid avatar though. So not sure not sure how we can get it to the Developers?

Frooxius commented 6 months ago

If anyone here is knowledgable with C++ and has access to models that are not shareable (or even if you want to do it for models you can) and willing to throw a bunch of time at this, you could try to make fix to Assimp and open PR on our fork: https://github.com/Yellow-Dog-Man/assimp

If anybody's willing to make the fix, I'll merge it quick and it can be contributed upstream too.

This is definitely something we could use community help on. I could look at it myself, but I'll have to devote time to it away from other projects (like working on the new Settings UI and IK).

troyBORG commented 6 months ago

I figured out the problem with mine:

 .\assimp.exe info D:\Avatars\Zorrix\Models\ZorrixFBX.fbx
Launching asset import ...           OK
Validating postprocessing flags ...  OK
0 %
50 %
ERROR: Failed to load file: Validation failed: aiMesh::mBones[40], name = "WobbleJoint_Mane_Descending3_2" has the same name as aiMesh::mBones[55]
assimp info: Unable to load input file D:\Avatars\Zorrix\Models\ZorrixFBX.fbx

The "mane wobble 4_2" was named "mane wobble 3_2" so there were 2 joints of the same name in different roots.

Fixing this issue causes the model to import correctly. I made a post on the Assimp GitHub regarding my issue https://github.com/assimp/assimp/issues/5331

Krzeszny commented 3 months ago

DESKTOP-VHA2V7H - 2024.2.5.848 - 2024-02-06 14_20_27.log Here's what I get when I try to import 4 different FBX's (Fennix v4, Remaster, HD Planti, HD Digi), even if exported from Blender 4.0 (though Fennix v7's FBX works by default) GLT has no problems.

GearBell commented 1 month ago

(I skimmed a lot so forgive me if it was already mentioned) I found the culprit to old fbx's causing crashing - its the blendshapes. If an old fbx doesnt have any itll import just fine, but if it does have blendshapes its best to import into an up to date 3d program then re-export as an fbx (or anything else you'd use) - either way I found the crashing factor. Not sure if this helps anything.