Python Menu Class
Creating our own Menu Class to use in Unreal
The Base Class
@unreal.uclass()
class PythonMenuTool(unreal.ToolMenuEntryScript):
name = "programatic_name"
label = "display Name"
tool_tip = "tool tip!"
def __init__(self, menu, section=""):
"""
given a menu object and a section name,
initialize this python tool and add it to the menu
"""
super().__init__()
if section:
menu.add_section(section, section)
# Initialize the entry data
self.init_entry(
owner_name="custom_owner",
menu=menu.menu_name,
section=section,
name=self.name,
label=self.label,
tool_tip = self.tool_tip
)
# Add this tool to the desired menu
menu.add_menu_entry_object(self)
Declaring the Execute
Declaring the Execute Condition
Dynamic Labels

Last updated