Announcement

Collapse
No announcement yet.

Python 4.20 (Not 20Tab) - how to get selected asset from content browser

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Python 4.20 (Not 20Tab) - how to get selected asset from content browser

    Hey guys, I recently posted a question regarding how to get my selected asset via Python. It was posted in the UE4 4.20 preview forum with no response. Considering that seems to be more aimed towards the build and its bugs, it may explain the lack of response. So I'll try under Development

    I'm looking for a way to (for the test sake's purposes) print the name of the asset I currently have selected in the asset browser via Python. I fully believe this line of code is definitely in the right direction:

    unreal.GlobalEditorUtilityBase.get_selected_assets()

    But I get an error mentioning that it needs an argument for "get_selected_assets(ARG)"
    It's looking for an object. But this makes no sense to me... as the object that is selected is the object... Or am I not getting it? Even if I type "unreal.Object" or "object" it tells me that its a type, not an object. I could use some help here.

    I recreated the python line with blueprints, and it worked. I'll attach an image below. That's great that it works for Blueprints... but I really want to make it work for Python... any helpful ideas?

    Thanks again, ahead of time.
    Last edited by Chui_Panda; 06-28-2018, 09:00 PM.

    #2
    SOLVED!!! Thanks to Jaime Dale

    You can find his reply here:
    https://forums.unrealengine.com/unre...preview/page17

    Comment

    Working...
    X