Adding Custom Menus To Unreal Engine 5 With Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

ความคิดเห็น • 12

  • @bradleymullennix8339
    @bradleymullennix8339 หลายเดือนก่อน

    I thank you sire!
    The desire to add Python tools via menus, or other user friendly method, has been on my radar for years.
    Have had several describe Blue Print, plugin development, ini manipulation, etc. All involving steps and turns per project.
    Using this method, and placing into users Content/Python/init_unreal.py allows them to have the tools permanently added to the editor regardless.
    Thank you again.

  • @VampiricBard
    @VampiricBard ปีที่แล้ว +1

    Dude this is awesome. Great vid. Are you the one that owns TAColor python tools? Btw your medium link isn't working.

    • @techartcorner
      @techartcorner  ปีที่แล้ว

      Hey, thanks for the kind works! TAColor is not mine but looks cool!
      Also, just fixed the url, thanks!

  • @TetsukeKun
    @TetsukeKun 11 หลายเดือนก่อน

    Hello! How to delete only this custom tab? I need to recreate it if context changes. But I can delete only all in MainMenu

    • @techartcorner
      @techartcorner  11 หลายเดือนก่อน

      Hey, I hope this will solve your issue:
      ToolMenus class has few useful methods:
      - unregister_owner_by_name(self, owner_name: Name)
      - remove_section(self, menu_name: Name, section: Name)
      - remove_menu(self, menu_name: Name)
      - remove_entry(self, menu_name: Name, section: Name, name: Name)
      With those you can unregister any menu entry or even whole menu and all it's children.
      When you register a new menu, it's name is "parent name" + "new menu name"
      So for instance if I extend `ContentBrowser.AssetContextMenu.StaticMesh` with `asset_context_menu.add_sub_menu("Custom.Menu","CustomMenu","SomeName","")`,
      then I should refer to it as 'ContentBrowser.AssetContextMenu.StaticMesh.SomeName'
      Knowing that name, we can unregister all sub entries and the menu:
      ```
      menus = unreal.ToolMenus.get()
      menus.unregister_owner_by_name("ContentBrowser.AssetContextMenu.StaticMesh.SomeName")
      menus.remove_menu("ContentBrowser.AssetContextMenu.StaticMesh.SomeName")
      ```
      I recommend refreshing widgets after that operation but my tests show that it's not necessary:
      ```
      menus.refresh_all_widgets()
      ```
      A protip:
      If you can't find tool menu name, you don't have to list it using a script.
      Switch commands to CMD mode and type `ToolMenus.Edit`
      It will show names (and a gear icon that opens menu editor) in the interface

  • @Poisonous_Father
    @Poisonous_Father 5 หลายเดือนก่อน

    how we can implement some tools in ue5 python like Tensorflow or Kerac for Deep learning Process in ue5 and how we can connect unreal engine to VS Code To Process Deep Learning Models Did you Know This and Thanks for This Tutorials is Amazing

  • @hotsauce7124
    @hotsauce7124 ปีที่แล้ว

    Hello, is it possible to create a custom tab with custom widget buttons…the widget custom buttons would be linked to existing tools already in UE.

    • @techartcorner
      @techartcorner  ปีที่แล้ว +1

      Custom icons have to be registered with C++
      Short guide:
      www.freemancw.com/2016/05/custom-icons-in-unreal-engine-4/
      More detailed guide:
      www.quodsoler.com/blog/customize-your-unreal-class-icons
      Once it's done you can use them from C++, Blueprints or Python.
      Here's my BP snippet that assigns icon to menu entry:
      dev.epicgames.com/community/snippets/vK7a/unreal-engine-adding-blueprint-utility-widget-to-ui-as-a-new-menu-entry-in-context-menu-with-an-icon-of-choice
      Similar thing can be done in Python, explained in the course: www.udemy.com/course/unreal-engine-5-python-automation/?referralCode=1F4964E40236307A3A37

  • @digitaldox
    @digitaldox 6 หลายเดือนก่อน

    You're amazing dude. Thanks a ton.

  • @CNSH_核桃
    @CNSH_核桃 ปีที่แล้ว

    Thats great, but the menu disappears when you restart the editor.

    • @techartcorner
      @techartcorner  ปีที่แล้ว +1

      Initialize it with startup script :)

    • @timjroughton9931
      @timjroughton9931 2 หลายเดือนก่อน

      bit late to the party, yeah that's what I expected to happen.. since he was just typing into what I call 'null' space. It is a bit of a redundant tutorial, after writing into a .py file a function it's never touched again, I was like what the heck is this? skip again.. oh so that py file I just made was for not particular future purpose other than a scratch pad for pasting into the python console, for all intent and purpose may as well have used notepad.