Exporter: better handling of duplicate object names #1595
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix/Workaround for #1523.
Iron does not allow duplicate names for objects but the now replaced code was still adding exporting objects to collections if their names were already "taken".
Also, objects in collections are now always exported with their full asset name, taking the collection name into account which decreases the rate of name conflicts massively.
In the very rare case that an object from a collection still has the same name as another object in the scene (that object then must be named
[collection_name]_[object_name].blend
for this problem to occur, which is very unusual), a warning is printed to the console and the collection object with the duplicate name is not exported.Just an idea for the future (off-topic): Warnings sometimes get buried amongst all other kinds of messages in the console and tend to get overseen. I think a message at the start of the game that says that n warnings occurred during export could help here. Or a hint in the UI if it is not too annoying). Maybe I will look into that and open another PR.