Model importer regression in master
Release Type: master
Version: Github
Describe the bug After doing some testing with the model importer changes I was testing different models online to see if they all imported correctly and found one that imports correctly in the old version but shows up blank in the new version.
To Reproduce Steps to reproduce the behavior:
- open game studio
- try importing this model as FBX
- and the materials show but the textures and model are blank or missing
Expected behavior it should work as it currently does where the model, materials and textures import properly.
Screenshots
old:
new:
Log and callstacks
Error: Texture with name Emily_Lower_Teeth_Diffuse not found
Error: Texture with name Emily_Skin_Arm_Diffuse not found
Error: Texture with name Emily_Eyelash_Diffuse-Emily_Eyelash_Opacity not found
Error: Texture with name Emily_Eyelash_Diffuse-Emily_Eyelash_Opacity not found
Error: Texture with name Emily_Skin_Body_Diffuse not found
Error: Texture with name Emily_Skin_Head_Diffuse not found
Error: Texture with name Emily_Skin_Leg_Diffuse not found
Error: Texture with name Emily_Lower_Teeth_Diffuse not found
Error: Texture with name Emily_Upper_Teeth_Diffuse not found
Error: Texture with name Emily_Nails_Diffuse not found
Error: Texture with name Emily_Cornea_L_Diffuse not found
Error: Texture with name Emily_Eye_L_Diffuse not found
Error: Texture with name Emily_Eye_R_Diffuse not found
Error: Texture with name EmilyHairs not found
Error: Texture with name EmilyHairs not found
Error: Texture with name PantsLeather-DX-Back not found
Error: Texture with name yellow leather not found
Error: Texture with name Leather Element not found
Error: Texture with name PantsLeather-DX-Front not found
Error: Texture with name PantsLeather-SX-Front not found
Error: Texture with name RightArm-JacketLeather not found
Error: Texture with name JacketLeather not found
Error: Texture with name LeftArm-JacketLeather not found
Info: Computing hashes of 3 source files...
Verbose: Computed hash of C:/dev/GitControlledProjects/TR.Stride/TR.Stride/Resources/Test/Emily_Jumping.fbx for asset Test/Emily_Jumping Skeleton. 2 files remaining...
Verbose: Computed hash of C:/dev/GitControlledProjects/TR.Stride/TR.Stride/Resources/Test/Emily_Jumping.fbx for asset Test/Emily_Jumping_mixamo.com. 1 files remaining...
Verbose: Computed hash of C:/dev/GitControlledProjects/TR.Stride/TR.Stride/Resources/Test/Emily_Jumping.fbx for asset Test/Emily_Jumping. 0 files remaining...
Seems like it may be a path issue based on the image below:
and this check here cant find the textures causing the above error.
private static void ImportTextures(IEnumerable<string> textureDependencies, List<AssetItem> assetReferences, Logger logger)
{
if (textureDependencies == null)
return;
foreach (var textureFullPath in textureDependencies.Distinct(x => x))
{
if (!File.Exists(textureFullPath))
{
string texName = Path.GetFileNameWithoutExtension(textureFullPath)??"<unknown>";
logger.Error($"Texture with name {texName} not found");
continue;
}
var texturePath = new UFile(textureFullPath);
var source = texturePath;
var texture = new TextureAsset { Source = source, Type = new ColorTextureType { PremultiplyAlpha = false } };
// Create asset reference
assetReferences.Add(new AssetItem(texturePath.GetFileNameWithoutExtension(), texture));
}
}
Ah ok, seems like the new importer is missing a step of extracting textures from the FBX file. I dont think that would be part of the model not appearing correctly but at that may at least explain the textures not getting imported in the current version.
https://github.com/stride3d/stride/blob/4a263c4faa1e5ed3a94f1f8900bce342c230f28a/sources/tools/Stride.Importer.FBX/MeshConverter.cpp#L1921
@Noah7071 is this just missing or a special case for this model file?
Thanks for sharing this @Doprez. Wheres this particular model Emily_jumpinng! ? The link you shared isn't opening for me.
Oh weird, try this https://www.turbosquid.com/3d-models/emily-blender-2157992
Oh lol sorry I apparently added the hyperlink without adding the actual link
@Noah7071 is this just missing or a special case for this model file?
Oh yes for the case texture embedded, unlike FBX sdk there isnt auto setting in Assimp to rip embedded files. Have to generate texture image file traversing pixel by pixel. Checking in the fix shortly!
@Doprez Committed the update for embedded texture!
You're a legend! I can either mark this as closed now or we can wait for the PR to close it.
Thanks @Doprez , best mark it closed and open new if somethin else!
Did you already make the PR?
Yes, there's PR of this https://github.com/stride3d/stride/pull/2163
Ah but that was already merged, I think it will need a new one for your commit to take effect.
Im going to reopen for now so we can track it once it gets merged. It does seem fixed from Noahs example but just needs to be in master.
Should be fixed from @Noah7071 repo, I pulled it in this PR https://github.com/stride3d/stride/pull/2246