Page MenuHomeFeedback Tracker

GUIDs are not recreated when renaming/reimporting assets in Workbench
Closed, ResolvedPublic

Description

Resource GUIDs when an asset is originally created are some kind of hash of the unique path to the file. However, if you rename a file within workbench, this is never recreated. This is probably done to avoid having to walk through the project assets to modify each config/resource which references the original resource, however, there are some issues this causes.

For instance, if a user creates a version of an asset, then renames that asset and decides to start with a new version of that asset, both will have the same GUID.

When the GUID is changed workbench will obviously have to fix all of the assets that pointed to the prior GUID. This problem could be made easier by making a hash of the asset file itself accessible in the .meta file (concept pictured below) and looking for mismatches.

MetaFileClass {
 Name "{D7B2D0DAA40C67BB}test.conf"
 LastHash "E225722CFDB575FB"  // Use this for ensuring the resource we are getting is what we actually want
 Configurations {
  CONFResourceClass PC {
  }
  CONFResourceClass XBOX_ONE : PC {
  }
  CONFResourceClass XBOX_SERIES : PC {
  }
  CONFResourceClass PS4 : PC {
  }
  CONFResourceClass HEADLESS : PC {
  }
 }
}

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10
Category
General
Steps To Reproduce
  1. Create a new config file, e.g. "testfile.conf". Note the UID in the generated .meta file.
  2. Rename the file inside workbench to "testfile2.conf". The UID in the new .meta file is the same as the original file. Reimporting will not fix it.
  3. Delete "testfile2.conf.meta" and reimport it. Now it will have a correct UID as if it were created with that name originally, but this should be done within workbench.

Event Timeline

Ralian created this task.Jun 2 2022, 6:43 PM
Geez changed the task status from New to Assigned.Jun 9 2022, 12:29 PM
reyhard closed this task as Resolved.Jun 14 2022, 8:04 AM
reyhard claimed this task.
reyhard added a subscriber: reyhard.

Behavior described above is completely on purpose. GUID is meant to survive rename or move to different location and it should stay same no mater what. If you want to do new file, usage of duplicate or inherit from is recommended.