Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created February 27, 2023 08:45
Show Gist options
  • Save rondreas/dd5abdda3eedfe72390e05aebf9f8405 to your computer and use it in GitHub Desktop.
Save rondreas/dd5abdda3eedfe72390e05aebf9f8405 to your computer and use it in GitHub Desktop.
Another unreal menu, extending the context menu for folders in the content browser
import unreal
@unreal.uclass()
class MyEntry(unreal.ToolMenuEntryScript):
@unreal.ufunction(override=True)
def execute(self, context):
print("Hello!")
def main():
menus = unreal.ToolMenus.get()
menu_name = "ContentBrowser.FolderContextMenu"
section_name = "PathViewFolderOptions"
# create the tool menu entry script object,
script_object = MyEntry()
script_object.init_entry(
owner_name = menu_name,
menu = menu_name,
section = section_name,
name = "MyEntry",
label = "My Entry",
tool_tip = "This is a tool tip for My Entry"
)
script_object.register_menu_entry()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment