Jump to content

String parsing in Font SOP


defc0n1

Recommended Posts

Hi guys

I'm relatively new to Houdini, and I've been trying to make this little digital asset. Basically what I need is to set the 'Number Of Copies' integer field of a duplicate SOP to the number of RETURN characters in the text field of a Font SOP. Is this even possible? I can do this easily in C++ but I can't get the syntax right in Houdini and I don't know how to assign it to the current field for which I'm writing the expression. I tried using the foreach() loop on the text field, but I can't figure out how to do the string comparison. Please help.

Thanks!

Link to comment
Share on other sites

2 minutes ago, defc0n1 said:

I think you didn't quite understand my question. Let me clear the confusion - I want to SET the number of copies AS the number of return characters in the text field of the Font SOP. Not the other way around.

Indeed, i misunderstood your question.

Strange approach, on my side, i would make an integer parameter on my sop/hda/null, then put it in font sop and duplicate node.

How do you access to text field to enter your number ?

Link to comment
Share on other sites

Yeah sorry about that. It really is a weird request. I can access the text field using ch("../font/text") but I was hoping I could do like a for loop to iterate through the characters and find the number of RETURNs in it. Basically the situation is that I need a progress bar sort of a thing (using a grid) for every line in the Font SOP. For example, if I have 4 lines, the duplicate SOP duplicates the grid 4 times.

Edited by defc0n1
typo
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...