527b21f0ae
When resyncing linked liboverride data, new IDs may be created that do not exist in actual library file (since the lib file has not been resynced). If such 'virtual linked liboverrides' data-blocks are used locally (e.g. by adding such object to a local collection), on next file read they will be detected as missing. Now resync code will list such missing linked IDs that were liboverrides, and try to re-use them when matching (by root name and library) with newly generated virtual liboverrides. The process may not be 100% perfect, especially a perfect one-to-one remapping cannot be ensured if source data keep being changed over and over (because of the order in which virtual linked liboverrides generated by resync may change over time). However, in practice this should fix the vast majority of issues, especially if sane naming practices are used on IDs. --------------- For the record, an attempt was made to write liboverride data together with the placeholders for linked IDs in .blendfile. In theory, this should ensure a perfect and fully valid re-usage of such IDs. However, for this to work, not only the liboverride data of linked IDs need to be written on disk, but also all ID references in this data has to be considered as directly linked, to ensure that such liboverride data can be re-read properly. Otherwise, these placeholders would get a liboverride data with NULL ID pointers, which is useless. Such change feels way to intrusive for the very limited benefit, so for now would consider current solution as the best option. Pull Request: blender/blender#107144