Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Stalkerx777

Houdini UI Python Library

Hi guys! 

Just want to share with you some of my experiments.

huilib - is a simple python wrapper around houdini .ui language. It was written "just for fun", so no warranty if it works for you. But i think it's pretty usable for simple ui, in situation, when PyQt is not an option  :P

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

Feel free to use it.

https://bitbucket.org/alexxbb/huilib/overview

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

Edited by Stalkerx777
4 people like this

Share this post


Link to post
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

Share this post


Link to post
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 =)

1 person likes this

Share this post


Link to post
Share on other sites

Very nice! Cheers! ;) (Also, the function you use, hou.ui.createDialog() doesn't seem to be documented anywhere in the 13.0 docs, so your code is extra useful...)

Share this post


Link to post
Share on other sites

Very cool! Is there a way to use this library without launching Houdini? (I'm guessing not, but just in case...)

 

Thanks!

Share this post


Link to post
Share on other sites

Very cool! Is there a way to use this library without launching Houdini? (I'm guessing not, but just in case...)

 

Thanks!

No, unfortunately not :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!!!

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
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()

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now