I have created a plugin for UE4. The main puprose of it is to rename assets inside project due to some external logic. I am using next code, but instead of renaming I get two similar assets with same names.
I am renaming from TestImage1 to TestImage2. Result is on the screenshot.
I’ve never tried to do this myself, but I believe the reason that it isn’t changing in the editor is due to the editor having two different names for most things, maybe 3. Normally there is the actual name of the variable or asset, then there is a friendly name and/or a display name. I’m not sure if DisplayName or FriendlyName is something than can be set for these assets, but it could be something similar to change the name of the asset in the editor itself.
Thank you for a quick response!
But why do duplicates appear? The sequence was next:
Only one TestImage1 asset in folder
Call to rename method
Second asset appear in folder (and first does not disapper)
I have copied renaming code from ContentBrowserUtils::RenameAsset from UnrealEngine/Engine/Source/Editor/ContentBrowser/Private/ContentBrowserUtils.cpp.
I actually managed to reproduce the issue itself without your plugin and simply renaming assets in the editor. It seems like it is an issue with the renaming itself and not your plugin, since you are copying the same code. I’ve reported it in our database. It’s possible that it is by design, as the code isn’t intended to be used in the way that you’re using it, but it is possible that it will be fixed. For your reference, the bug number is UE-16437. I’ll be sure to update you with any information that surfaces about this issue.
Thank you very much for a quick response! Is there any kind of workaround? My task is: rename/move/create/delete assets (saving all references when possible inside project) due to some external logic.
Other than using some different code, which I’m unsure of exactly what you need to do due to my lack in the development of plugins, I can’t think of anything that you could use as a workaround.
This still hasn’t been fixed on unreals side. Copying still bugged, it creates a duplicate, doesn’t rename the ID only the file. Then unreal has issues because there are 2 files with the same ID. (the display name)