resonanz Posted August 6, 2011 Share Posted August 6, 2011 I am sure it is a simple problem but I cannot find the solution, so here is the question: I put some code into the text field of a Font-Sop and I want to return the values. My problem is that it allways returns the whole code and not just the value. In Hscript I can use the backsticks and put the expression inbetween but how do I do this in Python? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
mawi Posted August 6, 2011 Share Posted August 6, 2011 (edited) I am sure it is a simple problem but I cannot find the solution, so here is the question: I put some code into the text field of a Font-Sop and I want to return the values. My problem is that it allways returns the whole code and not just the value. In Hscript I can use the backsticks and put the expression inbetween but how do I do this in Python? Thanks in advance! Im not infront of houdini now but if I remember correct you need to keyframe a string parameter when using python in it. Edited August 6, 2011 by mawi Quote Link to comment Share on other sites More sharing options...
resonanz Posted August 8, 2011 Author Share Posted August 8, 2011 Thank you very much Mawi! That is exactly what I was looking for! Quote Link to comment Share on other sites More sharing options...
motionprojects Posted September 21, 2011 Share Posted September 21, 2011 Can anyone post a file with a python script running in a font sop? Using the method discussed? I haven't been able to get this one working. I assume you mean the string parameter contains the code I wish to run. Thanks! Quote Link to comment Share on other sites More sharing options...
edward Posted September 22, 2011 Share Posted September 22, 2011 1. Go to frame 1 2. Right-click on the Font SOP's "Text" parameter. Choose Channels and Keyframes > Set Keyframe 3. Right-click on the Font SOP's "Text" parameter. Choose Expression > Change Language to Python 4. Right-click on the Font SOP's "Text" parameter. Choose Expression > Toggle Expression 5. Right-click on the Font SOP's "Text" parameter. Choose Expression > Edit Expression. Put in your python code. eg. hou.pwd() <and click Apply> 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.