stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.32k stars 917 forks source link

Fbx not displaying correctly with associated errors in VS #2340

Closed neonzz1 closed 4 days ago

neonzz1 commented 1 week ago

Release Type: Official Release (please choose appropriate option)

Version: 4.2.0.2149

Platform(s): Windows Describe the bug Since upgrading to 4.2.0.2149 my player FBX assets don't display correctly ie floating head gear hair becoming a beard also I occasionally get errors in Visual Studio. To Reproduce Steps to reproduce the behavior:

  1. Import the asset and view it in stride.

Expected behavior For the asset to look the same as when viewed in a fbx viewer

Screenshots image Log and callstacks

If any, please attach here any log or callstack (preferably in a .txt file using GitHub drag and drop)

Additional context Wizard.zip

Doprez commented 1 week ago

Seems like this is working properly in latest master?

image

image

Import logs from Stride.

Error: Texture with name Wizard_Texture not found
Error: Texture with name Wizard_Staff_Texture not found
Info: Computing hashes of 17 source files...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard Skeleton. 16 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard. 15 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Death. 14 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Idle. 13 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Idle_Attacking. 12 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Idle_Weapon. 11 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_PickUp. 10 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Punch. 9 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_RecieveHit. 8 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_RecieveHit_Attacking. 7 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Roll. 6 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Run. 5 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Run_Weapon. 4 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Spell1. 3 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Spell2. 2 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Staff_Attack. 1 files remaining...
Verbose: Computed hash of C:/dev/stride-dev/testing/MyGame3/MyGame3/Resources/Wizard.fbx for asset Wizard_CharacterArmature_Walk. 0 files remaining...

Im not sure if this is normal from before though? logs from Asset builder when running the game.

[(0,0)]: Info: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'To much bones influencing a single vertex')
[EXEC(0,0)]: Warning: [AssetCompiler] The input file contains vertices that are associated to more than 6 bones. In current version of the system, a single vertex can only be associated to 4 bones. Extra bones will be ignored. Exception: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'To much bones influencing a single vertex')

The mesh still seems fine while static and the idle animation at least still works at runtime soooo not sure what this warning may affect.

neonzz1 commented 6 days ago

image This is what I see these assets had already been imported before I updated the engine and after this is what they look like and no before I was getting the texture found. Maybe it's my install of Stride? I have just checked with the master branch of stride and I get this when it's imported image And I get this when it is imported. image

Doprez commented 6 days ago

Oh, so there are embedded textures in the FBX file?

Its probably not your install. The FBX importer was completely changed from 4.2.0.2122 to use AssImp instead of the FBX SDK. Master has some fixes for orientation issues like what you were saying with the misplaced hair and beard.

Doprez commented 6 days ago

It looks like even in 4.2.0.2122 there is no texture found when I test:

Warning: Importer detected a texture not available on disk at address 'C:\Users\trebl\rpg_characters_-_nov_2020\RPG Characters - Nov 2020\Textures\Wizard_Texture.png'
Warning: Importer detected a texture not available on disk at address 'C:\Users\trebl\rpg_characters_-_nov_2020\RPG Characters - Nov 2020\Textures\Wizard_Staff_Texture.png'

So Im not sure if its reference something locally for you if its working on your machine.

image

It also seems to be missing in Blender when I import.

neonzz1 commented 6 days ago

I clicked "Pack Resources" in blender before I exported it. I just checked and I needed to do a git pull on my end, I had a slightly older version of the master branch. When I open my game with the latest update to the master branch, they display correctly. And import correctly what can I do to resolve this issue when starting my game, in VS?

Doprez commented 6 days ago

Are your packages referencing the source or still 4.2.0.2122?

In your csproj, make sure the stride versions all reference 4.2.0.1 and do a clean and rebuild. I dont seem to be getting the same issues on my end but it could be one of 2 things I can think of:

Doprez commented 5 days ago

@neonzz1 can you try the newest release (4.2.0.2188) and see if your problems persist? of course make sure to back up your projects but this should have fixed most if not all of the previous problems found with the importer.

neonzz1 commented 4 days ago

@Doprez All problems have been solved thank you :)

neonzz1 commented 4 days ago

Problem was resolved by update to 4.2.0.2188