Skip to content

Commit

Permalink
Fix broken material references when an FBX uses external materials
Browse files Browse the repository at this point in the history
- Update version 1.0.5
  • Loading branch information
jeffjadulco committed Jan 31, 2023
1 parent 9606358 commit 60c9943
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.0.5 (2023.01.31)
- **Fix**: Broken material references on an FBX asset when using legacy/remapped materials

### 1.0.4 (2021.09.04)
- **Improved**: Faster regeneration time. Thanks to @mayofunk

Expand Down
7 changes: 6 additions & 1 deletion Editor/AssetGUIDRegenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace Jads.Tools
{
public class AssetGUIDRegeneratorMenu
{
public const string Version = "1.0.4";
public const string Version = "1.0.5";

[MenuItem("Assets/Regenerate GUID/Files Only", true)]
public static bool RegenerateGUID_Validation()
Expand Down Expand Up @@ -159,6 +159,11 @@ public static void RegenerateGUIDs(string[] selectedGUIDs)
if (inverseReferenceMap.ContainsKey(dependencyGUID))
{
inverseReferenceMap[dependencyGUID].Add(path);

// Also include .meta path. This fixes broken references when an FBX uses external materials
var metaPath = AssetDatabase.GetTextMetaFilePathFromAssetPath(path);
inverseReferenceMap[dependencyGUID].Add(metaPath);

referencesCount++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.jeffjadulco.guidregenerator",
"version": "1.0.4",
"version": "1.0.5",
"displayName": "GUID Regenerator",
"description": "A Unity editor tool to regenerate GUID for your assets",
"unity": "2019.4",
Expand Down

0 comments on commit 60c9943

Please sign in to comment.