Toggled Menu Entries
How to make Check Boxes and Radio Buttons
Another type of Menu is the Checkbox style - is something on or off?
__init__ requirements
The first requirement is to tell our Menu Class that it is a checkbox menu type. We can do this in our __init__ by adding the following line:
self.data.advanced.user_interface_action_type = unreal.UserInterfaceActionType.TOGGLE_BUTTONThis will display the Menu Class as a checkbox, but we'll need to do a few extra steps to make it work!
Property to Track The Checked State
The next requirement is a variable we can use to keep track of whether our class is checked or not:
@unreal.uclass()
class PythonMenuTool(unreal.ToolMenuEntryScript):
is_checked = unreal.uproperty(bool)Function Overrides
lastly, we'll want to declare our functions for get_check_state() and execute() to make use of our tracker variable:
This will update the checkbox when executed and make sure the correct state is shown:

Toggled Types
This class setup works for the following interface action types:
Full Class Code
Last updated