How to open the node comment editor dialog with Python?

   932   3   2
User Avatar
Member
109 posts
Joined: Aug. 2017
Offline
How to open the same window we get when right-clicking a node and choosing "Edit comment..."?
User Avatar
Member
247 posts
Joined: May 2017
Offline
You can open the comment ui with:
dialog = hou.ui.createDialog('OPUI_Comment.ui')
dialog.setValue('nodeName', 'node_name')
dialog.setValue('openWindow', True)
But it is not usable. Some missing value that has to be set, but cant figure it out since the ui file is encoded.
$HH/config/Applications/OPUI_Comment.ui
Instead you can try readInput [www.sidefx.com] Dialog, probably not the best way to write long comments, but should work.
User Avatar
Member
109 posts
Joined: Aug. 2017
Offline
Interesting. I was trying to find out if there's an official method to do this, but if there isn't any, then it shouldn't be difficult to recreate the dialog 1:1 with Qt. Thank you vikus, I appreciate your help.
User Avatar
Member
247 posts
Joined: May 2017
Offline
Glad to help. You can recreate the functionally by adding a dialog callback and then read value changes. The only thing that doesn't work is reading the comment string. But yes go better with Qt
  • Quick Links