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
importhoudefradial_menu():# Get the current handle alignment statehandle_align=hou.handleAlignment()# Create the radial menumenu=hou.ui.createRadialMenu()menu.setTitle("Handle Alignment")# Add the global option to the menuglobal_item=menu.addItem("Global")global_item.setCheckable(True)ifhandle_align==hou.handleAlignment.Global:global_item.setChecked(True)# Add the object option to the menuobject_item=menu.addItem("Object")object_item.setCheckable(True)ifhandle_align==hou.handleAlignment.Object:object_item.setChecked(True)# Add the parent option to the menuparent_item=menu.addItem("Parent")parent_item.setCheckable(True)ifhandle_align==hou.handleAlignment.Parent:parent_item.setChecked(True)# Show the menu and retrieve the selected optionselected_item=menu.exec_()# Set the handle alignment based on the selected optionifselected_item==global_item:hou.setHandleAlignment(hou.handleAlignment.Global)elifselected_item==object_item:hou.setHandleAlignment(hou.handleAlignment.Object)elifselected_item==parent_item:hou.setHandleAlignment(hou.handleAlignment.Parent)
There are no Python functions in Houdini to align handles. And this is very sad. As for ChatGPT, it invents a non-existent functionality. When there is no function in Houdini, it simply invents its own. Moreover, it does not even know how to correctly create nodes and links between them. I want to note that its knowledge of scripting in Maya is much better.
@jsmack yea, it's not a big thing I just would like to have them in a radial menu as I really like to work that way. The right-click menu is quite cumbersome. having a radial menu reduces the number of hotkeys for all handle alignments to one. and I like that. everybody works a bit differently, and I think it's a simple thing that should be possible. why not?