Scratch Posted October 14, 2015 Share Posted October 14, 2015 (edited) Hey folks, I have a HDA where I want to display e.g. $NPT as text of a label-parameter in an HDA's User Interface. When the user changes the number of points created with this asset, I want the number to update in the UI (label) aswell. Can this be done? Actually, it sounds pretty easy...but so far, I couldn't do it. I'm sure I'm missing something here... Thanks in advance! EDIT: I found a workaround-solution by creating a normal string-parameter where I've put in a expression to fetch the attrib-value I need. Afterwards, I locked the parameter so that it can't be manipulated that easy. Still...a nice label which can't be edited at all (=just a display only) would be way better. EDIT2: The solution of EDIT1 does not work,...testing showed that the expression does not get picked up by new instances of the asset.... Edited October 14, 2015 by Scratch Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted October 14, 2015 Share Posted October 14, 2015 (edited) I see that you are 4 years old Houdini user, so I will not give you solution. Just a proof that it can be done: Now @Scratch you head a little harder to find solution for your problem Edited October 14, 2015 by fântastîque Mântragorîè Quote Link to comment Share on other sites More sharing options...
f1480187 Posted October 15, 2015 Share Posted October 15, 2015 (edited) It can be done using Python and spare parameter. Besides challenges of handling all possible cases when this label need to be updated (node created, input changed, spare parms deleted, etc.) there is two bugs connected with modifying node' template groups on my Windows PC: 1) parameter ladder and value sliders not work properly; 2) heisenbugs which causes crashes. Try to change value randomly, like a wild ape, I got a segfault after 30-60 secs. It destroys my usual workflow. I'm here from the future just to say that `ch("someparm")` syntax on default value is working. Edited October 15, 2015 by f1480187 Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted October 15, 2015 Share Posted October 15, 2015 (edited) It can be done using Python and spare parameter. Besides challenges of handling all possible cases when this label need to be updated (node created, input changed, spare parms deleted, etc.) there is two bugs connected with modifying node' template groups on my Windows PC: 1) parameter ladder and value sliders not work properly; 2) heisenbugs which causes crashes. Try to change value randomly, like a wild ape, I got a segfault after 30-60 secs. It destroys my usual workflow. Oh my god. What a monster you created You don't need to do any Python scripting to achieve this. And certainly no need to mess with any events. It's really simple guys. I will give you one more day Link not working. Is it part of idea? Hmm... It works on Opera. Try to grab the link below (you need to download it or press View Original, otherwise it will be static image): http://1drv.ms/1LWdaJe Edited October 17, 2015 by fântastîque Mântragorîè Quote Link to comment Share on other sites More sharing options...
f1480187 Posted October 15, 2015 Share Posted October 15, 2015 I've removed that moster from the server to not cause any harm. Quote Link to comment Share on other sites More sharing options...
Scratch Posted October 15, 2015 Author Share Posted October 15, 2015 Awesome! Thanks man! Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted October 15, 2015 Share Posted October 15, 2015 So you solved your problem? Quote Link to comment Share on other sites More sharing options...
pezetko Posted October 16, 2015 Share Posted October 16, 2015 By evaluated hscript like this? `ch("./scatter1/npts") That means evaluate hscript expression (using that ` backtick) in the Label # parameter of the HDA interface. So for displaying number of points it's possible to use expression like: npoints("./node") Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted October 16, 2015 Share Posted October 16, 2015 Oh, Petr, he didn't answered But since you broke the magic spell of "NOT TELLING", this is how I made it on the animated gif: `npoints(opinputpath(".", 0))` to get point count on begin, and: `npoints("./OUT")` to get point count from OutputSOP inside asset. Both placed in In the column field of a Label. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted October 16, 2015 Share Posted October 16, 2015 Normal labels including labels of Label templates are just plain strings in ParmTemplate instances, they are not evaluated. The column labels thing is probably a parm values despite of special parameter interface layout. A bit confusing. Spare parms, however, can be dynamically changed via Python pretty easily. There is bunch of special methods in hou.ParmTemplateGroup allowing users not to just change labels of Labels, but dynamically generate a big interface structures based on user actions or input files. 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.