Download

Avoid Asset Loading for Asset Context Menu

This issue came up in the context of adding context menu options for an Editor plugin I’ve been working on. My end goal is to gather the selected assets and then provide a new context menu option to the developer. This works fine when selecting one or a handful of assets. However, when you select lots of assets (100+), all of these assets are first loaded. As you can imagine, this can be a very slow process, and one that is entirely unnecessary for my purposes. All of the information I care about is in the asset metadata itself (i.e., FAssetData).

What is even more peculiar is that I can create the same context menu option on selected folders and will not run into this issue. Specifically, I can right click a folder (or folders) and get the relevant asset data for all assets in those folders from the Asset Registry without loading any assets. Naturally, this is much more responsive and desirable.

Hoping I can get some insider insight here. Is there a reason assets need to be loaded when they are right-clicked? Is there a way to get around this?