bandini Posted September 12, 2010 Share Posted September 12, 2010 Little bit of a conundrum... How would I group the following per letter, using a font sop to generate the text: "ij;%";:" I wish there was a letter attribute that was assigned by the font operator that I could use to break words apart. If the letter is only made of one part, using a connectivity sop is easy enough to separate the letters, but it fails in this example. Any ideas out there? Quote Link to comment Share on other sites More sharing options...
michael Posted September 13, 2010 Share Posted September 13, 2010 no time to test but can the font sop use ASCII codes? Quote Link to comment Share on other sites More sharing options...
bandini Posted September 13, 2010 Author Share Posted September 13, 2010 (edited) no time to test but can the font sop use ASCII codes? Yes, font sop can use ASCII codes. Not sure how that would help you in this situation, though. This is not the literal text that I need to break apart, just a generic placeholder. When the asset is done the user will be able to input any text they want. Edited September 13, 2010 by bandini Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted September 13, 2010 Share Posted September 13, 2010 Here are two third party ways of doing it Maya - Use the text creator in maya, separate the word, name the individual letters in maya I, J, Semicolon, Percent, Quote, etc. Select all in maya and export as an .obj. The file sop will remember the names as groups, then you can go from there in houdini. Illustrator - create any letter or shape in illustrator, make sure you save out the .ai file as uncompressed and use the connectivity sop after your file import. You'll have to distinguish the groups in houdini. I use this a lot to allow other artist to have artistic control in my work. If something goes wonky look it up in the help files. It can take in a couple other vector formatts. Further, if you want you can normalize the letters too upon import, so they will be placed in a -1 to 1 space, and not what ever space they come in as, especially going the illustrator root. to create a normalize expression in Houdini, take the transform node and make this a preset, translate -$CEX, -$CEY, -$CEZ scale each channel 1/if($SIZEZ > if($SIZEX > $SIZEY, $SIZEX, $SIZEY), $SIZEZ, if($SIZEX > $SIZEY, $SIZEX, $SIZEY) ) pivot $CEX, $CEY, $CEZ Here is my .idx from my Houdini preset, in your Houdini directory presets/Sop/xform.idx xform.zip Quote Link to comment Share on other sites More sharing options...
johner Posted September 13, 2010 Share Posted September 13, 2010 Hmm, I never knew the Font SOP output primitives in such a strange order. Here's one way that I think should work so long as you don't use really extreme "Italic Angles". Create a Reference Copy of your Font SOP that has a high horizontal kerning value that is a multiple of the Font Size, so the letters are spread way out from one another, then use an expression to divide each "cell" of that spread out bounding box into a letter attribute. Then attrib copy that attribute back onto the original primitives. See attached. group_by_letter.hip Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted September 13, 2010 Share Posted September 13, 2010 johner - I keep fataling out when I open your file. I'm curious to see how it works. Quote Link to comment Share on other sites More sharing options...
pclaes Posted September 13, 2010 Share Posted September 13, 2010 (edited) Could you do one letter at a time with the copy sop, the argc() expression and a bit of stamping? in the font sop: argc("t h i s _ i s _ m y _ t e x t", stamp("../copy","cy",0)) Add a primitive attribute that adds the number of the stamp. That way you can use the foreach with primitive attribute to process each letter afterwards, rather than use it with groups (which is slower). number of copies = stringlength. You would need to look into spaces. You could tell it that a space is an underscore and filter for that (using strcmp() ) to do a different operation (as in a transform). Edited September 13, 2010 by pclaes Quote Link to comment Share on other sites More sharing options...
johner Posted September 13, 2010 Share Posted September 13, 2010 johner - I keep fataling out when I open your file. I'm curious to see how it works. That's weird. Attached is a version that I copy and pasted into H10. group_by_letter_h10.hip Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted September 13, 2010 Share Posted September 13, 2010 Thanks johner works awesome, good thing learned. Hey peter I would love to see how that works. It is a cool example of a copy stamp function right next to a for each loop, each doing their strong suit. My attempt with the non existence nstringlength, lol, didn't work, and I kept getting random errors. Quote Link to comment Share on other sites More sharing options...
bandini Posted September 13, 2010 Author Share Posted September 13, 2010 @LaidlawFX: Unfortunately, this has to remain inside Houdini and be completely procedural. @johner: I'll take a look at your file. Sounds like it may do the trick. Not sure what would happen in the case of really narrow characters being next to wide characters, such as iiWWMi, but I'll definitely check it out. @pclaes: I thought about doing something similar, but without getting into a very complex rule system, I'm not sure how you would accomodate for kerning. I could see it working well for a monospaced font, but a lot of fonts don't follow rules like that. By the way, I have submitted a RFE to SideFX for enhancement to the font sop to give us letter and word attributes that get passed along the the primitives created by the nodes. I hope to see it added in some future release Quote Link to comment Share on other sites More sharing options...
petz Posted September 14, 2010 Share Posted September 14, 2010 a while back i had the same problem. using a foreach-sop did the trick. file is attached. petz text_groups.hipnc Quote Link to comment Share on other sites More sharing options...
pclaes Posted September 14, 2010 Share Posted September 14, 2010 alright, it's pseudocode. in a texport type a: exhelp str and exhelp -k string to see the string expressions. Here is an example file doing everything you need, kerning is not an issue as topology is the same so you can attribcopy. text_partitioning_01.hip Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted September 14, 2010 Share Posted September 14, 2010 Petz I couldn't open yours, I kept fataling out, on both h10's and h11 for windows, just like johner's, you mind re-loading your file? I hope my server board comes in soon, time for the system upgrade. Thanks Peter, yours and johners internal methods are quite interesting methods Quote Link to comment Share on other sites More sharing options...
petz Posted September 14, 2010 Share Posted September 14, 2010 Petz I couldn't open yours, I kept fataling out, on both h10's and h11 for windows, just like johner's, you mind re-loading your file? I hope my server board comes in soon, time for the system upgrade. H10 file attached! petz text_groups_H10.hipnc Quote Link to comment Share on other sites More sharing options...
bandini Posted September 26, 2010 Author Share Posted September 26, 2010 (edited) Took me a little while but I finally go a chance to check out all the examples. These are all really interesting ways of solving the problem. Thanks! Edited September 26, 2010 by bandini Quote Link to comment Share on other sites More sharing options...
Ezz Posted November 29, 2010 Share Posted November 29, 2010 Hi Adam. I just saw your fine tutorial at: http://adamswaab.wordpress.com/ Would you care to share a file of the scene that you`re working from. I have some problems seeing the expression that you´re using. Thanks a lot. Erik Quote Link to comment Share on other sites More sharing options...
bandini Posted November 30, 2010 Author Share Posted November 30, 2010 Hi Adam. I just saw your fine tutorial at: http://adamswaab.wordpress.com/ Would you care to share a file of the scene that you`re working from. I have some problems seeing the expression that you´re using. Thanks a lot. Erik The technique is pretty similar to Peter Claes' solution. ProceduralTextAnimation_04.hipnc Quote Link to comment Share on other sites More sharing options...
Ezz Posted November 30, 2010 Share Posted November 30, 2010 Hi Adam. Thanks. Erik 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.