Jump to content

ij;%";: - Not a joke


bandini

Recommended Posts

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?

Link to comment
Share on other sites

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 by bandini
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by pclaes
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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 :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

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

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...