Jump to content

Letter From Particles


Recommended Posts

Hello Houdiners

a simple question ( I hope ).

I have a simple scene where I want to emit random letters from a particle system.

Diggin on houdini help I found the expression "//$F3" ( frame number ) to use on the font sop , I am wondering if there is such a way to use "stamp" function on Font SOP to drive the ascii code based on particle $PT.

thx in advance

chris

Link to comment
Share on other sites

  • 6 months later...
\\`stamp("copy1","parameter",1)`

Chris just explained me on aim that the trick is the '\\'.

Which is not some strange escaping done by the forum but the hscript shortcut (?) to convert int to char. 65 would be converted to a.

Georg

Link to comment
Share on other sites

Chris just explained me on aim that the trick is the '\\'.

Which is not some strange escaping done by the forum but the hscript shortcut (?) to convert int to char. 65 would be converted to a.

Georg

Very clever, but not particularly maintainable/transparent, esp. if the client then wants a character that's not in ascii sequence, and you've already handed the shot to someone else, and now they have to figure out how to get it to work. Consider using a global variable containing all the characters you want to appear, e.g. "ABCDEFGabcdefg", and then use a substr() to get a particular letter. Or if you figure that eventually single letters might become whole words, set the string to "A B C D E F G a b c d e f g" and use the arg() function.

Link to comment
Share on other sites

Very clever, but not particularly maintainable/transparent, esp. if the client then wants a character that's not in ascii sequence, and you've already handed the shot to someone else, and now they have to figure out how to get it to work. Consider using a global variable containing all the characters you want to appear, e.g. "ABCDEFGabcdefg", and then use a substr() to get a particular letter. Or if you figure that eventually single letters might become whole words, set the string to "A B C D E F G a b c d e f g" and use the arg() function.

Good point.

I will have to start some experiments with this aproach.

The above mentioned method makes sense in a random environment.

Ie if random single letters are floating through space and you want them to switch from lowercase to uppercase upon impact.

Georg

Link to comment
Share on other sites

Good point.

I will have to start some experiments with this aproach.

The above mentioned method makes sense in a random environment.

Ie if random single letters are floating through space and you want them to switch from lowercase to uppercase upon impact.

Georg

At that point, I would surround the letter lookup with an 'if()' function, e.g.:

if(param("copy1", "bounces", 0)%2==0, toupper(<letter>), tolower(<letter>))

where <letter> is the substr(param()) or \\ setup that you have. That way, on each bounce they go from lower to upper case and then back down again. You'd need to make sure that the bounces attribute is part of the POPs setup, and then properly fed into the copy SOP.

Link to comment
Share on other sites

if(param("copy1", "bounces", 0)%2==0, toupper(&lt;letter&gt;), tolower(&lt;letter&gt;))

:D

:unsure:

Ok - got me again ... forgot about toupper/tolower ....

I agree:

"not particularly maintainable/transparent"

That propably the reason it didn't made it in the documentation and is just a comment in a sop.

Georg

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