Custom Unreal Tool Menu Entry Object

PHOTO EMBED

Thu Nov 10 2022 22:59:47 GMT+0000 (Coordinated Universal Time)

Saved by @MaVCArt #python

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')
content_copyCOPY