chrisedu Posted November 7, 2006 Share Posted November 7, 2006 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 Quote Link to comment Share on other sites More sharing options...
chrisedu Posted November 7, 2006 Author Share Posted November 7, 2006 Sorry, folks too simple I will post it anyway \\`stamp("copy1","parameter",1)` where "parameter" is "int(rand($PT)*128)" ( randomizing between the first 128 ascii characters ) bests chris Quote Link to comment Share on other sites More sharing options...
rdg Posted May 17, 2007 Share Posted May 17, 2007 \\`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 Quote Link to comment Share on other sites More sharing options...
antoinedurr Posted May 18, 2007 Share Posted May 18, 2007 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. Quote Link to comment Share on other sites More sharing options...
rdg Posted May 18, 2007 Share Posted May 18, 2007 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 Quote Link to comment Share on other sites More sharing options...
antoinedurr Posted May 19, 2007 Share Posted May 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
rdg Posted May 21, 2007 Share Posted May 21, 2007 if(param("copy1", "bounces", 0)%2==0, toupper(<letter>), tolower(<letter>)) 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 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.