Jump to content

Houdini UI Python Library


Stalkerx777

Recommended Posts

Hi, guys! 

Just wanted to share with you some of my experiments.

huilib - is a simple Python wrapper around Houdini's native .ui language. It has been written "just for fun", so no warranty if it works for you, but I think it's pretty usable for a simple UI, in situations, when using PyQt is not an option  :P

Maybe someday we'll see something similar from SESI  :)

Feel free to use it.

https://github.com/alexxbb/huilib

post-3906-0-34336100-1392326946_thumb.jp

Edited by Stalkerx777
Updated link
  • Like 8
Link to comment
Share on other sites

Can we do something similar with pop up windows ? ei mixing drop down menu with text box and a 3 buttons selection?

Maybe this lib can do that ? 

 

Sorry I'm still new to this programming world and I'm trying to create some basic tool, like loading cam(alembic) and create new scene with naming convention, etc ...

 

thanks

Link to comment
Share on other sites

Can we do something similar with pop up windows ? ei mixing drop down menu with text box and a 3 buttons selection?

Maybe this lib can do that ? 

 

Sorry I'm still new to this programming world and I'm trying to create some basic tool, like loading cam(alembic) and create new scene with naming convention, etc ...

 

thanks

Yes, it actually what this library supposed to do. Simple pop up dialogs for simple things =)

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 months later...

thanks for the huilib nice tool.

 

i found a little error in the HVector, i think i fixed it though by changing

 

from

assert 2 < size <= 4, "HVectorField size can be 2, 3 or 4"

to

assert 1 < size <= 4, "HVectorField size can be 2, 3 or 4"

 

from the huilib.py

 

i also found out that when i launch the interface and just run my code right away

the setValue() outputs blank, instead of 0 which is what the interface seem to show.

it fixes itself though if you drag the slider out and back to 0. then it outputs 0

 

i also have a problem with setValue() with HVector in 2d. it works if the size =3 but if its 2 and i tried self.someNameofVector.setValue([0,1]). or ((0,1)), it errors something like index out of range. with something about _multivalue thingy.

Edited by willow wafflebeard
Link to comment
Share on other sites

  • 1 year later...

very useful tools! thaks!

i have a  question about the(self.stringField = huilib.HStringField('field1', 'meName')):

##########################################################

import huilib
from huilib import *
class meDialogxx(HDialog):
    def __init__(self, name, title):
        super(meDialogxx, self).__init__(name, title)
        self.setWindowLayout('vertical')
        self.setWindowAttributes(stretch = True, margin = 0.13, spacing = 0.1, min_width = 3)
            
            
        colx1 = HColumnLayout()
        ###
        self.stringField = huilib.HStringField('field1', 'meName')
        self.stringField.setEnabled(True)

        #self.geoFileField.getValue()
        #print self.stringField

        self.addGadget(self.stringField)
        
        rowx1 = HRowLayout()
        self.a000 = HButton('aa','COM_0')
        self.a001 = HButton('bb','COM_1')
        rowx1.addGadget(self.a000)  
        rowx1.addGadget(self.a001)  
               
        colx1.addLayout(rowx1)
        self.a000.connect(self.cb_printStringFields)
        self.a001.connect(self.cb_printStringFields1)
        self.addLayout(colx1)
        
        # This method should always be called last!!
        self.initUI()
        
    def cb_printStringFields(self):
        a=self.stringField.setValue('aaaaaa')
        self.stringField.getValue()
        print self.stringField
        
    def cb_printStringFields1(self):
        self.stringField.setValue('a+b')
        
      

if __name__ != '__main__':
        ui = meDialogxx(name = 'import_dlg', title = 'what the F$%%^%&*^*')
        ui.show()
#####################################################################

how can i get the (self.stringField) value?please!!!

Link to comment
Share on other sites

18 hours ago, waterzhou said:

very useful tools! thaks!

###################################

how can i get the (self.stringField) value?please!!!

So what's a problem? It works, just checked.

self.stringField.setValue("MyValue") # Set value

print self.stringField.getValue() # Pring Value

 

Link to comment
Share on other sites

  • 1 year later...

Thanks for this wonderful tool. I got 2 questions:

1. How to implement a proper HIconButton with built in icon?

2. Is there any way to query an opened window and close it first before committing a new one?

 

Thanks

 

Link to comment
Share on other sites

On 6/13/2017 at 11:02 PM, cloud68 said:

Thanks for this wonderful tool. I got 2 questions:

1. How to implement a proper HIconButton with built in icon?

2. Is there any way to query an opened window and close it first before committing a new one?

 

Thanks

 

2

1. I've tried many times, but couldn't make it work. Need to ask SESI support how to use ACTION_ICONBUTTON gadget.

2. Yes:

# Find the dialog by name
ui = huilib.findDialog('test')
if ui:
	# If found you can show(), hide(), and close() it
	ui.close() will close and delete the dialog
ui = TestDialog(name='test', title='Test UI')
ui.show()

 

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...