Simple question on "For each loop" (newb)

   1579   5   0
User Avatar
Member
2 posts
Joined: July 2023
Offline
Hi guys.
Im at the very beginning of my Houdini journey so Im sorry for such a newb question (might be easy to answer tho).
While learning "for each" method of copying I decided to make my own version of a test scene but it shows all numbers as zeros instead of 0 to 81 numbers.
What can be the problem how do you think?

Thanx.

PS : Actually my setup is almost identical to the one that Houdini has in its official tutor. (with exception that my parameter that should change on each iteration is string (font node) and original is number of division (geometry node)

Attachments:
363049678_6777189935638938_4762076662905642588_n.jpg (320.9 KB)

User Avatar
Member
8329 posts
Joined: July 2007
Offline
you need to use points() [www.sidefx.com] function to get value of string attribute, not point()

so either
- switch the type of your Num attribute to Integer and it should work as is

or

- keep it as string, but use
`points("../foreach_begin1", 0, "Num")`
Edited by tamte - July 24, 2023 12:12:25
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2 posts
Joined: July 2023
Offline
tamte
you need to use points() [www.sidefx.com] function to get value of string attribute, not point()

so either
- switch the type of your Num attribute to Integer and it should work as is

or

- keep it as string, but use
`points("../foreach_begin1", 0, "Num")`

The "points" variant worked! Its the easiest way to fix that (from all I've been suggested). Thank you. Just need to understand why "point" version haven't worked.
User Avatar
Member
8329 posts
Joined: July 2007
Offline
Harry_S
Just need to understand why "point" version haven't worked
It's because the s in points stands for string rather than points meaning plural, as confusing as it may seem
So point vs points is literally numerical attribute vs string attribute
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
172 posts
Joined: Aug. 2018
Offline
It seems odd to me that no one proposed "point_s" as a better choice.
User Avatar
Member
202 posts
Joined: June 2023
Offline
Mike_A
It seems odd to me that no one proposed "point_s" as a better choice.

This is a quite old thread from July...

By the way HScript expressions are really really old, probably older than some people on this forum. People who named it might have retired. By then people might have a very different idea on what a good naming convention was.
  • Quick Links