Really appreciated! It’s a really nice approach. One thing I added after forking and modifying the project is a ruleset for assigning a custom group name, including path folders.
Given a path “Assets/Level Assets/Props/Wooden Barrel/Barrel01.prefab”
So “%PATH%[-2]” would create an Asset Group called “Wooden Barrel” containing all barrels inside it.
Beware that if by any reason, there is another folder also called Wooden Barrel elsewhere in the project, and the same kind of ruleset is applied, when that ruleset imports an asset, it will be sent to the same asset group.
Also, I added an option in the ruleset to create group if it doesn’t exist, and also to delete if there’s no asset in it.
Of course, if no variable is used, it behaves like what you have today.
Changed %PATH%[0] syntax to {PATH[0]} to keep consistent with regex replacement. Now it possible to use both {PATH[index]} and ${group} in groupName/addressReplacement.
@Favo-Yang Manually re-importing assets from many directories proved to be a bit tedious, so I made piece of code that triggers the Addressable import by selecting a folder and clicking “AddressablesImporter : Check sub folders”.
Will create a PR soon.
@Favo-Yang Love your importer - it’s a wonderful thing.
We currently include the contents of AddressableAssetsData in version control, and it occasionally gets out of sync.
Not really sure of the specific sequence, but I’d really like to generate the addressables fresh in a build script. Then, I’d exclude the whole lot from git, apart from AddressableImportSettings.
Do you have any experience doing this and/or any pointers?
Your idea may be achieve-able, but you need understand the concept of group,schemas and templates well. So you can selective what commit to VCS and leave the dynamic part (group) to the importer. The importer has a group template feature may help.
However consider all the works but little benefit, I would probably write a commit hook to force me commit the AddressableAssetsData folder. Depends on why “it occasionally gets out of sync”, you may have a good reason to implement it.
Yeah, I’m really not sure what’s causing the issue, that’s true. Seems to happen when 2 people create assets that map to addressables.
Regarding version control, the only thing I seem to need to keep is the AddressableImportSettings instance. It seems I can regenerate everything from that, by importing the appropriate folders?
If you only need default group, then probably yes, you can import default addressable folders, and leave the rest to the importer.
If you need more or changed any settings, then you need commit other stuffs to VCS as well, but ignore Assets/AddressableAssetsData/AssetGroups/*. I never tried this approach, so it may have more issues.
Not sure I fully understand @Favo-Yang . I am using the Group template but I am not creating any addressables that aren’t matched by the AddressableImportSettings.
It seems, to create the script I really just need to know the command to create default addressables (the button that appears on the addressables groups tab when you first open it), and the command to start the import for a given folder.
what if you want to change some schemas or group settings, to share with others, you may want to keep related files to VCS.
what if you want to create dynamic groups using custom group template? you need put the template file to VCS, and template reference schemas… end up with lots related stuffs into VCS.
That’s why I said, you may want to only ignore Assets/AddressableAssetsData/AssetGroups/* from VCS. That’s the only thing can be dynamic recreated and maintained by the importer.
Really sorry, I think I am missing a key point here. Thank you so much for taking the time to clarify this with me.
To try to make it clearer, let me show you one of our examples. I am using the group template - one of our rules creates groups for each avatar prefab type, like this:
But I know that if I delete everything out of the AddressableAssetDataFolder, recreate the addressables and then reimport, these groups are dynamically created for me, all based on the info run AddressableImportSettings. So I’m not seeing which bit would need me to keep the AssetGroups folder?
You’re not using custom group template, but the default one. In such case it’s fine.
However, there’s lots stuff you can configure on a group, bascailly everything under the content packing & loading, which it is actually a schema. The importer can not maintain those for you.