nuke.Panel EnumerationPulldown
I was trying to create a simple panel with a dropdown menu, and had some trouble with nuke panel.addEnumerationPulldown. Here's the code I was typing:
I expected the panel to give me a dropdown list of on, from auto-localize path and off. Instead it treated everything after a space a different entry, which gives me this ridiculous result.
After some research I found a solution from Foundry Community, which uses re module to solve the issue. Here's the finished code:
The post from community also mentioned the use of nukescripts.PythonPanel instead of nuke.Panel module, which could avoid this problem. But for this simple tool this will do, and nukescripts.PythonPanel is up on my list of investigation! Note: Update on using nukescripts.PythonPanel now here.