Behaviour on changing the Namesapces ?

I had imported the project in default Namespace. After that I mentioned the other namespace “Namespace1”. Deleted the library folder. I see a number of following entries in log

RemoteAssetCache - Download - Metadata - success:false, namespace:nameSpaceId, key:key123

this namespace belongs to the "Namespace1". My understanding was for every asset it wont find the entry under new namsepace so will upload it. But further down I saw these logs

RemoteAssetCache - Download - Artifact - success:true, namespace:nameSpaceId2, key:key434 for asset:‘xxx.prefab’, time elapsed: 0.926239 seconds

This namespace should belong to default, but then even if I have mentioned namespace to be “Namespace1” , it still downloaded the asset from other namsespace i.e. default.

  • Is it how it is supposed to work ?
  • Will cache server avoid creating new entries in a namespace if it already found same asset under different namesapce ?
  • What will be the behaviour if I have same asset under two different paths ? would it cache only one asset or both of them ? I think it will keep both but please confirm this.

Hi

A namespace is a grouping of key/value pairs on the accelerator. There is no overflow into other namespaces, and queries to the accelerator will only be run in the specified namespace.

In order to customise this for a project, there is a setting in the project settings called “Namespace prefix”. This value will get prepended onto any internal namespace value used by the asset pipeline.

Unity will use 3 different namespaces

  • namespace prefix + “artifacts”
  • namespace prefix + “metadata”
  • “shadercache” (only available in 20.1 and up)

The reason why the namespace prefix isn’t prepended to shadercache is because the shader compiling is done outside of the asset pipeline scope.

In Unity 2020.2 we changed the namespace value which was sent down the wire to be clear text, rather than an md5 hash. This was done to make is easier to debug and compare values back and forth.

No, it will only look for entries in the specified namespace for that query. So even if an identical artifact exist in a different namespace, it won’t know about it.

Depending on the dependencies for each asset it could do either. The key in the key/value pair is calculated from the set of known dependencies before importing the asset. One dependency is the content hash of the source asset. If both are the same, then it would only cache one of them. But if any other dependencies for the asset is different, like import settings, compression, etc. then the generated key would also be different and it would store them both.

Hope this answers you questions.