Symbolic Posted April 30, 2009 Share Posted April 30, 2009 Hi, I would like to create a string attribute storing the name of the previously connected node. If I go with the `opinputpath(".",0)` solution... this returns the whole path... I can go into stripping out the last part... but I would like to do that with the python way... I usually have my python commands on a button, never had a python to be evaluated on a node. How does that work? Thanks. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 30, 2009 Share Posted April 30, 2009 Came across this the other day you need to set a keyframe to have a python expression evaluate in a parameter. Look out for double quotes though when you an a keyframe to an existing expression as the get added automatically, you need to remove them. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted April 30, 2009 Author Share Posted April 30, 2009 Thanks. Actually I was suggested a better way for this. Just to share it... You need to switch the node's expression language to "python" firtst. Then "Edit expression". Type the python code in and hit apply or accept and the box is green. No need for a keyframe. Because setting a keyframe really messes up that box... really... Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 30, 2009 Share Posted April 30, 2009 When it goes green that is the keyframe getting added though isn't it? Quote Link to comment Share on other sites More sharing options...
Symbolic Posted May 1, 2009 Author Share Posted May 1, 2009 (edited) I guess so. But if you just type it in. It just does not get green. Then when you set a keyframe... it gets green but the syntax gets messed up as well. Maybe it is just for me. I found it cleaner to be done with the expression editor. Sorry, I totally forgot to mention about the actual python code to list the inputs. It is: hou.pwd().inputs()[0].name() Thanks. Edited May 1, 2009 by Symbolic 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.