defc0n1 Posted February 23, 2017 Share Posted February 23, 2017 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! Quote Link to comment Share on other sites More sharing options...
fsimerey Posted February 23, 2017 Share Posted February 23, 2017 `chs("../duplicate1/ncy")` Be careful of back-ticks, needed to evaluate the expression. An easy way is to a right-click on channel you want to copy and paste into the text field of Font SOP. Quote Link to comment Share on other sites More sharing options...
defc0n1 Posted February 23, 2017 Author Share Posted February 23, 2017 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. Quote Link to comment Share on other sites More sharing options...
fsimerey Posted February 23, 2017 Share Posted February 23, 2017 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 ? Quote Link to comment Share on other sites More sharing options...
defc0n1 Posted February 23, 2017 Author Share Posted February 23, 2017 (edited) 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 February 23, 2017 by defc0n1 typo Quote Link to comment Share on other sites More sharing options...
fsimerey Posted February 23, 2017 Share Posted February 23, 2017 Ok, i see. A python sop could be simple to count lines. Quote Link to comment Share on other sites More sharing options...
defc0n1 Posted February 23, 2017 Author Share Posted February 23, 2017 Good idea. Now why didn't I think of that? I'll check it out. Thanks fsimerey. Quote Link to comment Share on other sites More sharing options...
fsimerey Posted February 23, 2017 Share Posted February 23, 2017 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.