import unreal # -- this is a custom overloaded unreal class in python # -- it inherits ToolMenuEntryScript, which means we can re-implement some key methods. @unreal.uclass() class CustomScriptMenuEntry(unreal.ToolMenuEntryScript): @unreal.ufunction(override=True) def get_label(self, context): return 'test' # -- this is where the real magic happens! @unreal.ufunction(override=True) def execute(self, context): """ In this method, as a developer, you can run any logic you want from your context menu, and it can have as many lines as you want! """ print('Hello World')
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter