rurik Posted October 3, 2012 Share Posted October 3, 2012 Hello I have a sentence of words, and I'm looking for a method that would allow me to control the words (not the letters) using a particle simulation. My guess is that if I can somehow group the words and create an attribute that identifies each word (vs each letter, which would just be $PR), I would be in business. However I am not sure how to go about that... I have a result that I'm having a hard time controlling using a method where each word is painted a certain color, then the ForEach uses the Cd attribute to split the letters. But for some reason it seems to be giving me issues when I try to copy the words to my particle system... Any suggestions would be most welcome Thanks! Alex 1 Quote Link to comment Share on other sites More sharing options...
sadhu Posted October 3, 2012 Share Posted October 3, 2012 (edited) This link http://forums.odforc...article-system/ will be helpful. Look for arg and argc hscript expressions. Use stamp expression for argNum in arg expression. Edited October 3, 2012 by sadhu Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted October 3, 2012 Share Posted October 3, 2012 If you decide to use Python there are a plethora of awesome tools for working with strings. For example split() which will separate strings based on the argument like a space. foo = 'This is my example sentence'words = foo.split(' ')for word in words: print word[/CODE]That puts each word into a list and then prints them, the output looks like this.[CODE]Thisismyexamplesentence[/CODE]From there you just pull whatever one you want like with the index, like words[3] but the index could be an attribute from the particle. I don't have Houdini in front of me to try it out but I can send an example later if you want to try it with Python instead of Hscript expression. Quote Link to comment Share on other sites More sharing options...
rurik Posted October 3, 2012 Author Share Posted October 3, 2012 Hello Sadhu and Luke Both those suggestions seem great. I'm not quite sure how I would create groups using arg though...I am actually using arg for a separate part of the project where I need to just need to feed an expression with a series of words that then get copy stamped. However the Python option seems more powerful, and I am definitely interested in exploring the Python route..An example would be fantastic.. What my end goal is to be able to type in a sentence inside of an expression (or a field if I can make this an asset) and have that create a sentence that has each word in one group, or if not in a group, assigned to a custom attribute. Hopefully that makes sense... Thanks! Alex 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.