Skip to content

Commit 60c9943

Browse files
committed
Fix broken material references when an FBX uses external materials
- Update version 1.0.5
1 parent 9606358 commit 60c9943

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.0.5 (2023.01.31)
2+
- **Fix**: Broken material references on an FBX asset when using legacy/remapped materials
3+
14
### 1.0.4 (2021.09.04)
25
- **Improved**: Faster regeneration time. Thanks to @mayofunk
36

Editor/AssetGUIDRegenerator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace Jads.Tools
5050
{
5151
public class AssetGUIDRegeneratorMenu
5252
{
53-
public const string Version = "1.0.4";
53+
public const string Version = "1.0.5";
5454

5555
[MenuItem("Assets/Regenerate GUID/Files Only", true)]
5656
public static bool RegenerateGUID_Validation()
@@ -159,6 +159,11 @@ public static void RegenerateGUIDs(string[] selectedGUIDs)
159159
if (inverseReferenceMap.ContainsKey(dependencyGUID))
160160
{
161161
inverseReferenceMap[dependencyGUID].Add(path);
162+
163+
// Also include .meta path. This fixes broken references when an FBX uses external materials
164+
var metaPath = AssetDatabase.GetTextMetaFilePathFromAssetPath(path);
165+
inverseReferenceMap[dependencyGUID].Add(metaPath);
166+
162167
referencesCount++;
163168
}
164169
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.jeffjadulco.guidregenerator",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"displayName": "GUID Regenerator",
55
"description": "A Unity editor tool to regenerate GUID for your assets",
66
"unity": "2019.4",

0 commit comments

Comments
 (0)