I want a radial menu that contains all the handle alignment states. I tried to create it with ChatGPT but it isn't working. Can somebody correct it?
Cheers
CYTE
import hou def radial_menu(): # Get the current handle alignment state handle_align = hou.handleAlignment() # Create the radial menu menu = hou.ui.createRadialMenu() menu.setTitle("Handle Alignment") # Add the global option to the menu global_item = menu.addItem("Global") global_item.setCheckable(True) if handle_align == hou.handleAlignment.Global: global_item.setChecked(True) # Add the object option to the menu object_item = menu.addItem("Object") object_item.setCheckable(True) if handle_align == hou.handleAlignment.Object: object_item.setChecked(True) # Add the parent option to the menu parent_item = menu.addItem("Parent") parent_item.setCheckable(True) if handle_align == hou.handleAlignment.Parent: parent_item.setChecked(True) # Show the menu and retrieve the selected option selected_item = menu.exec_() # Set the handle alignment based on the selected option if selected_item == global_item: hou.setHandleAlignment(hou.handleAlignment.Global) elif selected_item == object_item: hou.setHandleAlignment(hou.handleAlignment.Object) elif selected_item == parent_item: hou.setHandleAlignment(hou.handleAlignment.Parent)