Assign chunk id on asset via code

Hi, is it possible to assign chunk id on the asset via code, either blueprints or c++?

My use-case is that levels’ textures are in different library. Some textures are shared, and some are not. I can assign chunk id’s on level objects, as they are in separate folders. I cannot do that with textures, as they are in “random” folders of texture library. (Tens of thousands of textures).

1 Like

You can override this in your AssetManager class:

	/** 
	 * For a given package and platform, return what Chunks it should be assigned to, games can override this as needed. Returns false if no information found 
	 * @param PackageName Package to check chunks for
	 * @param TargetPlatform Can be used to do platform-specific chunking, this is null when previewing in the editor
	 * @param ExistingChunkList List of chunks that the asset was previously assigned to, may be empty
	 * @param OutChunkList List of chunks to actually assign this to
	 * @param OutOverrideChunkList List of chunks that were added due to override rules, not just normal primary asset rules. Tools use this for dependency checking
	 */
	ENGINE_API virtual bool GetPackageChunkIds(FName PackageName, const class ITargetPlatform* TargetPlatform, TArrayView<const int32> ExistingChunkList, TArray<int32>& OutChunkList, TArray<int32>* OutOverrideChunkList = nullptr) const;