Guest mantragora Posted September 1, 2015 Share Posted September 1, 2015 Hiiiiiiiiiiiiiii. So, it's 6AM. I still don't sleep. I'm looking at all *.ui files in Houdini installation and I'm still stuck at having Dialog and f*cking toggle. Q. Does anyone have normal, not scattered on multiple files, examples of ui created with UI script? No, I can't use HuiLib. Thanks! Love you! Quote Link to comment Share on other sites More sharing options...
dedeks3000 Posted September 1, 2015 Share Posted September 1, 2015 example of a dialog with fu**** toggles : #define LABEL_WIDTH 1.5a.val := 1;b.val := 1;c.val := 1;show_dialog = DIALOG "Toggle Buttons Example"{ LAYOUT(vertical) MARGIN(0.1) SPACING(0.1) LOOK(plain) VALUE(dlg.val) HSTRETCH WIDTH(1) HEIGHT(0.75) { LAYOUT(cell) # cell layouts are useful for table layouts TOGGLE_BUTTON "A":LABEL_WIDTH CELL(1,0) VALUE(a.val); TOGGLE_BUTTON "B":LABEL_WIDTH CELL(1,1) VALUE(b.val); TOGGLE_BUTTON "C":LABEL_WIDTH CELL(1,2) VALUE(c.val); } { LAYOUT(horizontal) JUSTIFY(center,center) ACTION_BUTTON "Close" VALUE(on_close); }} Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted September 1, 2015 Share Posted September 1, 2015 Q No.1: Why I'm getting "Nesting Error" when I write number directly: VALUE(1) instead of: default.val := 1; VALUE(default.val) ? Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted September 1, 2015 Share Posted September 1, 2015 (edited) Q No.2: Can I set DIALOG (or any control) name from variable somehow? For example this: dialog.name := "This is not dialog"; + this: dialog.window = DIALOG dialog.name // or dialog.window = DIALOG (dialog.name) will fail, with "Nesting Error". EDIT: Answering myself. No, you can't. But you can #define it: #define DIALOG_NAME "This is not dialog" dialog.window = DIALOG DIALOG_NAME Edited September 1, 2015 by fântastîque Mântragorîè Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted September 1, 2015 Share Posted September 1, 2015 (edited) Q No.3: How the hell I glue it with my Python code? Should I make properties in my python that will get/set data in my code and they get called by something in the UI Script? Lets say I have this: import hou import os def PrepareAssetList(): # get all installed digital assets loadedAssets = hou.hda.loadedFiles() assetDict = {} for asset in loadedAssets: assetDict[os.path.basename(asset)] = os.path.dirname(asset) # let user select which should be expanded selected = hou.ui.selectFromList(assetDict.keys()) if selected == (): return None return selected I want to have list of select asset names visible in DIALOG window. How to do this? Edited September 1, 2015 by fântastîque Mântragorîè Quote Link to comment Share on other sites More sharing options...
dedeks3000 Posted September 1, 2015 Share Posted September 1, 2015 The native houdini ui is good (in my opinion) just for simple dialog. To be honest , the ui syntax is little obscure for me. If you plan to use more 'advanced' ui , i think pyside(pyqt) is better. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted September 2, 2015 Share Posted September 2, 2015 The native houdini ui is good (in my opinion) just for simple dialog. To be honest , the ui syntax is little obscure for me. If you plan to use more 'advanced' ui , i think pyside(pyqt) is better. Yeah, I will probably go with PySide, but it would be cool to get some not so clear things sorted out for UI script. And make some really easy to follow examples. So if anyone wants to jump in and share something, don't be shay, DO IT! Thanks! Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted September 9, 2015 Share Posted September 9, 2015 (edited) I've spent a lot of time playing with this. Maybe you'll find it useful: huilib Edited June 17, 2017 by Stalkerx777 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.