NoaX Posted December 28, 2020 Share Posted December 28, 2020 (edited) Hi everyone today I have a simple problem that I don't have the experience working with text in Houdini to Solve, 1. I've created a grid, randomly selected a couple points using a group. I then fed this group to a copy to points. 2. The group of points being copied too are being enumerated so that they have an unique ID. 3. The font is entering the loop, receiving the ID and now displaying it's ID number. 4. Desired result: Per unique ID, I need to be able to say 'if id = 0, then text = 'apple,' just as a random example. I will of course also use the ID number to delete or blast things down the pipeline. Thank you in advance. File: uniquetext.hipnc uniquetext.hipnc Edited December 28, 2020 by NoaX Quote Link to comment Share on other sites More sharing options...
Librarian Posted December 28, 2020 Share Posted December 28, 2020 If you check Add text attributes @NoaX Quote Link to comment Share on other sites More sharing options...
NoaX Posted December 28, 2020 Author Share Posted December 28, 2020 1 hour ago, Librarian said: If you check Add text attributes @NoaX Getting the ID, is not problem. However I can't get the ID to equal a string: for example: "if(@id == 1) { v@Cd = set(0,1,0); s@stringAttrib = "hello world"; }" Quote Link to comment Share on other sites More sharing options...
vinyvince Posted January 2, 2021 Share Posted January 2, 2021 You could use an array as a detail attribute and look for the matching Id ? s[]@test={'Alpha','Bravo','Tango'}; And to read it back: string read[] = s[]@test; s@a = read[0]; s@b = read[1]; s@c = read[2]; for(int i=0; i<len(read);i++) { printf("read = " + "%c\n", read); } Happy new year Houdini people! ________________________________________________________________ Vincent Thomas (VFX and Art since 1998) Senior Env and Lighting artist & Houdini generalist & Creative Concepts http://fr.linkedin.com/in/vincentthomas 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.