Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model importer regression in master #2213

Closed
Doprez opened this issue Apr 5, 2024 · 15 comments
Closed

Model importer regression in master #2213

Doprez opened this issue Apr 5, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@Doprez
Copy link
Contributor

Doprez commented Apr 5, 2024

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:

  1. open game studio
  2. try importing this model as FBX
  3. 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:
image

new:
image

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...
@Doprez Doprez added the bug Something isn't working label Apr 5, 2024
@Doprez
Copy link
Contributor Author

Doprez commented Apr 5, 2024

Seems like it may be a path issue based on the image below:
image

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));
            }
        }

@Doprez
Copy link
Contributor Author

Doprez commented Apr 5, 2024

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.
image

List<String^>^ ExtractTextureDependenciesNoInit()

@tebjan tebjan assigned tebjan and Eideren and unassigned tebjan and Eideren Apr 5, 2024
@tebjan
Copy link
Member

tebjan commented Apr 5, 2024

@Noah7071 is this just missing or a special case for this model file?

@Noah7071
Copy link
Contributor

Noah7071 commented Apr 5, 2024

Thanks for sharing this @Doprez. Wheres this particular model Emily_jumpinng! ? The link you shared isn't opening for me.

@Doprez
Copy link
Contributor Author

Doprez commented Apr 5, 2024

@Doprez
Copy link
Contributor Author

Doprez commented Apr 5, 2024

Oh lol sorry I apparently added the hyperlink without adding the actual link

@Noah7071
Copy link
Contributor

Noah7071 commented Apr 5, 2024

@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!

@Noah7071
Copy link
Contributor

Noah7071 commented Apr 6, 2024

@Doprez Committed the update for embedded texture!
Screenshot 2024-04-06 140515

@Doprez
Copy link
Contributor Author

Doprez commented Apr 6, 2024

You're a legend! I can either mark this as closed now or we can wait for the PR to close it.

@Noah7071
Copy link
Contributor

Noah7071 commented Apr 6, 2024

Thanks @Doprez , best mark it closed and open new if somethin else!

@Doprez Doprez closed this as completed Apr 6, 2024
@Doprez
Copy link
Contributor Author

Doprez commented Apr 6, 2024

Did you already make the PR?

@Noah7071
Copy link
Contributor

Noah7071 commented Apr 6, 2024

Yes, there's PR of this #2163

@Doprez
Copy link
Contributor Author

Doprez commented Apr 6, 2024

Ah but that was already merged, I think it will need a new one for your commit to take effect.

@Doprez
Copy link
Contributor Author

Doprez commented Apr 27, 2024

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.

@Doprez
Copy link
Contributor Author

Doprez commented May 19, 2024

Should be fixed from @Noah7071 repo, I pulled it in this PR #2246

@Doprez Doprez closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants