Skip to content

Conversation

Doprez
Copy link
Contributor

@Doprez Doprez commented Sep 4, 2025

PR Details

There was an issue with materials being added into the asset manager with FBX files due to the path starting with a "/". this replaces the slash with an underscore.

Related Issue

None reported in GitHub. Logs from Tebjan in Discord:

ArgumentException: Asset location [/obj/geo1/quickmawterial4/matnet/principledshader] must be relative and not absolute (not start with '/') (Parameter 'item')
   at Stride.Core.Assets.PackageAssetCollection.CheckCanAdd(AssetItem item) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageAssetCollection.cs:line 361
   at Stride.Core.Assets.PackageAssetCollection.Add(AssetItem item) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageAssetCollection.cs:line 127
   at Stride.Assets.Presentation.Templates.AssetTemplateGenerator.Run(AssetTemplateGeneratorParameters parameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.Assets.Presentation\Templates\AssetTemplateGenerator.cs:line 52

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@tebjan
Copy link
Member

tebjan commented Sep 5, 2025

Ah, thanks a lot. However, I think it should replace all slashes when the name is retrieved from the asset source file. Stride might assume that the slashes are folders in the asset library...

@Doprez
Copy link
Contributor Author

Doprez commented Sep 5, 2025

No problem, this should be even simpler then and removes a check which is always a plus!

@tebjan
Copy link
Member

tebjan commented Sep 5, 2025

This looks great now, thanks!

@tebjan tebjan requested a review from Copilot September 8, 2025 14:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where FBX model imports failed when material names contained forward slashes, which were incorrectly interpreted as absolute paths by Stride's asset system. The fix replaces forward slashes with underscores in material names to ensure they are treated as relative paths.

Key changes:

  • Modified material name processing in FBX import to replace forward slashes with underscores
  • Added explanatory comment for the path sanitization logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants