[c++] Get Asset List For Actor

Another option we can expose from C++

Another option that might be worth pursuing is exposing C++ functionality to Python. Sometimes, if a Python option just isn't exposed or it's too inconvenient in Python, I'll try to find the C++ code for relevant actions in the Editor.

Unreal has a Right Click Menu option called Browse To Asset which will focus the Content Browser to the underlying asset of an Actor:

A lazy thing I'll do is find the relevant code in the C++ code and expose it to Python in a BP Function Library, here is an example c++ function we could add to gain access to this Menu's functionality:

The .h code:

The .cpp code:

Note: This function has a different return than the Python example on the previous page

Calling it in Python

With our c++ function compiled and the Plugin enabled, we can use the following logic to call it:

And here is an example inspecting the current 3D Level selection:

Last updated