Listing custom assets in asset selector?

0

I have a custom asset that is needed within my gem which I have used AzFramework::SimpleAssetReference<AssetType> to be able to easily use assets.

The problem is that in the editor when i try and select an asset, the asset browser does not list the any assets.

I have tried registering the asset using "AzFramework::SimpleAssetReference<AssetType>::Register(serializationcontext)" in both the system component and the object component without success.

Is there something that I need to do inorder for it to list my custom assets?

asked 7 years ago184 views
5 Answers
0
Accepted Answer

Hi @REDACTEDUSER

I'm guessing you're on version 1.9 here. I just have a few quick questions that'll help me clarify the situation.

  1. Is this a new type you've defined? It sounds like yes but I just want to confirm.
  2. Is your AssetBrowser completely blank or do other assets/folders appear?
  3. In your dev/Cache folder, does a search turn up your asset? Assets that successfully make it through AssetProcessor should have a game ready asset in the Cache folder. For most custom asset types this is often just a copy of the asset. If this is a custom datatype you've setup and you're not seeing it in dev/Cache then one thing you may need to do here is register the extension for your new type in AssetProcessorPlatformConfig.ini.

For example, in LmbrCentral.cpp you've likely noticed MannequinAnimationDatabaseAsset being registered. If you look in MannequinAsset.h you'll see GetFileFilter returning it as *.adb. Here's the corresponding section for adb in AssetProcessorPlatformConfig.ini.

[RC adb]
glob=*.adb
params=copy
productAssetType={50908273-CA36-4668-9828-15DD5092F973}

If you're unaware, Lumberyard's AssetProcessor churns through assets to produce game ready versions in the dev/Cache folder. That block tells it that for all adb files with that AZ type ID, it simply needs to copy them over to the cache. You'll probably want something similar.

Hopefully that information is helpful. Feel free to let me know if you have follow up questions here!

answered 7 years ago
0

That worked. Thank you.

answered 7 years ago
0

Moc Asset:

	class MocAsset {
public:
AZ_TYPE_INFO(MocAsset, "{7DB33C8B-8498-404C-A301-B0269AE60388}");
static const char* GetFileFilter() {
return "*.moc3";
}
};

I did the nessesary modifications with the AssetProcessorPlatformConfig.ini but did not use the productAssetType section.

  1. New type.
  2. Completely blank.
  3. With the modification that i did above, it does get copied over.

I would also like to suggest a modification for the asset processor. How about having a "patching" system for the AssetProcessorPlatformConfig.ini with usage for gems. It's an idea spawn from Magisk. For each gem that is active, scan the gem's folder for an AssetProcessorPlatformConfig.ini and real-time "patch" the main AssetProcessorPlatformConfig.ini to add in the new entries. Would be a big boon for gem makers that use custom assets.

answered 7 years ago
0

Hey @REDACTEDUSER

answered 7 years ago
0

Hey @alatnet,

That's great and fair feedback on AssetProcessorPlatformConfig that we'll pass along.

productAssetType is something you should need. I've seen new asset types fail due to lacking it in. Based on your code you'd want:

productAssetType={7DB33C8B-8498-404C-A301-B0269AE60388}

The one other thing I'm noticing here is the usage of AZ_TYPE_INFO_SPECIALIZE with types registered via SimpleAssetReference. Is that something utilized for your type?

I'm guessing you chose the SimpleAssetReference route based on the usage of your asset type but in the event that wasn't the motivation I'd suggest checking out how InputEventBindingAsset is registered in InputManagementFrameworkGem for a good example of registering a new type specified in a gem.

I hope that helps!

answered 7 years ago

This post is closed: Adding new answers, comments, and votes is disabled.