Bringing up the color editor via python

   6010   6   2
User Avatar
Member
59 posts
Joined: 4月 2006
オフライン
Is there a HOM python function that will bring up a color editor dialog, allow the user to select a color, and return it as an (r,g,b) tuple?
User Avatar
Member
1926 posts
Joined: 11月 2006
オンライン
Unfortunately there is not. You'll have to use something like the PyQt color picker.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
59 posts
Joined: 4月 2006
オフライン
What is the recommended method for utilizing PyQt within a Houdini python script? The following (placed in a shelf button tool) just segfaults Houdini 12:

import PyQt4.Qt as qt
c = qt.QColorDialog.getColor()
print c
User Avatar
Member
1926 posts
Joined: 11月 2006
オンライン
You need to integrate things into the Houdini UI event loop, similarly to this:

http://www.sidefx.com/docs/houdini12.1/hom/cookbook/pyqt/part1/ [sidefx.com]
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
1807 posts
Joined: 10月 2010
オフライン
hey Graham, wasn't there a python way of loading a .ui file? so if you make your custom editor (or say you want to launch the gallery manager) you can actually call out the .ui file? I seem to think that hou.ui had a method for this..
-G
User Avatar
Member
1926 posts
Joined: 11月 2006
オンライン
You can create a dialog using a Houdini .ui file (hou.ui.createDialog). However, that is only useful for making fairly simple Houdini style UIs. There are no simple widgets that represent the Houdini color picker, so it's not really applicable here.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
382 posts
Joined: 7月 2005
オフライン
Noticed the H14 Color Editor is way better than the default PyQt.QColorDialog color editor. is this one available to lauch is it PyQt? is it exposed?
  • Quick Links