ghang Posted August 21, 2009 Share Posted August 21, 2009 how do i use the variable in "tx" ps: >>> x = 200 in /obj/geo1/tx ; i don't know how to put the x variable in tx. i try: hou.ch(x) hou.ch($x) hou.ch("x") hou.ch("$x") $x x tx = x can some one tell what command should i use to using Python HOM to input variable please ? what I want to do is just let the node to use variable that define in Python Textport. very thank you!! Quote Link to comment Share on other sites More sharing options...
stevenong Posted August 21, 2009 Share Posted August 21, 2009 Hi, I recommend you start with the Houdini Object Model help page. You can access it through Help Browser. Cheers! steven Quote Link to comment Share on other sites More sharing options...
symek Posted August 21, 2009 Share Posted August 21, 2009 what I want to do is just let the node to use variable that define in Python Textport. That's the point. It's not an easy question as you may think. Houdini's Python textport operates at different name space (separate thread?), similar to Shelf Tools, and node's parameters don't have direct access to its variables. This is specially noticeable with refreshing issues. While you may (as graham suggested at sesi forum), import __main__, or use hou.session module to link paramter to your variable, it won't update interactively while you'll be changing variable's value (you could try to force paramter to be time dependent with hou.frame() for example, but I'm not sure how this would work). Fortuantelly this is not an usual way of doing things in Houdini. Think of nodes as classes and paramters as attributes which you can link together to store variables and control one with another. Same result, nicer and cleaner cheers, skk. Quote Link to comment Share on other sites More sharing options...
whalerider Posted August 23, 2009 Share Posted August 23, 2009 geo = hou.node('/obj/geo1') tx = geo.parm('tx') tx.set(some_value) Quote Link to comment Share on other sites More sharing options...
ghang Posted August 23, 2009 Author Share Posted August 23, 2009 thanks for everyone reply I think I got what I need from your kindly reply cheers Quote Link to comment Share on other sites More sharing options...
symek Posted August 23, 2009 Share Posted August 23, 2009 thanks for everyone reply I think I got what I need from your kindly reply cheers Funny misunderstanding..., so you wanted to set parameter with Python, not use textport variable in parameter expression... the first one is explained in HOM help at the very beginning ) . 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.