Jump to content
NoaX

Copy text and change text based on the ID

Recommended Posts

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

 

uniqueid2.thumb.png.3d097cbf05ed0182196dc219384e5dc1.png

uniquetext.hipnc

Edited by NoaX

Share this post


Link to post
Share on other sites
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";
}"

 

 

result.thumb.PNG.b2720173f52b3a65d4ae58ad81a67036.PNG

 

Share this post


Link to post
Share on other sites

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

 

happynewyear_2021_vince.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×