Jump to content
Sign in to follow this  
resonanz

Font-Sop Python

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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 by mawi

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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>

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×