How to get point position string?
2625 11 2- HenDaSheng
- Member
- 63 posts
- Joined: 2月 2022
- Online
There is a straight line and I can get the position information of each point through vex.
I want to put the position (string) of each point at the corresponding position through copytopints, but I don’t know how to get this position information in the font node. Do you have any good ideas?
I can get position information in font node with only one point,
There is nothing you can do after the number of points increases, and the font node only has an output port and cannot be nested in a loop.
Thank you for your help!
Edited by HenDaSheng - 2023年10月25日 11:19:31
- tamte
- Member
- 8839 posts
- Joined: 7月 2007
- Offline
- HenDaSheng
- Member
- 63 posts
- Joined: 2月 2022
- Online
- HenDaSheng
- Member
- 63 posts
- Joined: 2月 2022
- Online
HenDaSheng坦特This completely solved my problem.
something like this
This is the first time I know how to use font node -> Spare Input. Thank you very much for your help!
I hurriedly replied after seeing the effect. I only discovered the problem when I tried it myself (it's not a problem with tamte's answer, it's my own problem).
It turns out that "Spare Input" is a custom parameter interface, and its parameter type directly affects the final effect. This is very new knowledge to me. I will study it carefully and I think it will be used in other places.
- Jonathan de Blok
- Member
- 274 posts
- Joined: 7月 2013
- Offline
- animatrix_
- Member
- 4731 posts
- Joined: 2月 2012
- Offline
You can also do this without a for loop network using some VEX:
Then read the string attribute from the Font SOP:
string pos [ ] = { }; int count = npoints ( 0 ); for ( int i = 0; i < count; ++i ) { vector p = point ( 0, "P", i ); append ( pos, sprintf ( "%s", p.y ) ); } s@pos = join ( pos, "\n" );
Then read the string attribute from the Font SOP:
`details(-1, "pos")`
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- tamte
- Member
- 8839 posts
- Joined: 7月 2007
- Offline
HenDaShenghere is some info on spare inputs https://www.sidefx.com/docs/houdini/model/compile.html#spare [www.sidefx.com]
It turns out that "Spare Input" is a custom parameter interface, and its parameter type directly affects the final effect. This is very new knowledge to me. I will study it carefully and I think it will be used in other places.
they are susally used within compiled blocks as that has many restrictions, but they are useful overall to refer to other nodes without having to type the path to the node in every expression
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- HenDaSheng
- Member
- 63 posts
- Joined: 2月 2022
- Online
animatrix_
You can also do this without a for loop network using some VEX:string pos [ ] = { }; int count = npoints ( 0 ); for ( int i = 0; i < count; ++i ) { vector p = point ( 0, "P", i ); append ( pos, sprintf ( "%s", p.y ) ); } s@pos = join ( pos, "\n" );
Then read the string attribute from the Font SOP:`details(-1, "pos")`
This is also very new knowledge to me. Thank you for your help, it gives me more choices. I will study this method carefully!
- HenDaSheng
- Member
- 63 posts
- Joined: 2月 2022
- Online
tamteHenDaShenghere is some info on spare inputs https://www.sidefx.com/docs/houdini/model/compile.html#spare [www.sidefx.com]
It turns out that "Spare Input" is a custom parameter interface, and its parameter type directly affects the final effect. This is very new knowledge to me. I will study it carefully and I think it will be used in other places.
they are susally used within compiled blocks as that has many restrictions, but they are useful overall to refer to other nodes without having to type the path to the node in every expression
I tried to perform certain processing on the string through vex (limiting the number of digits after the decimal point), but introducing new variables in the font node did not work.
I think it's something outside of my knowledge. I guess the problem is with the new variables because they don't appear in the spreadsheet when the font node is selected.
Edited by HenDaSheng - 2023年10月26日 07:55:35
- HenDaSheng
- Member
- 63 posts
- Joined: 2月 2022
- Online
- Jikian
- Member
- 144 posts
- Joined: 8月 2012
- Offline
HenDaSheng
I tried to perform certain processing on the string through vex (limiting the number of digits after the decimal point), but introducing new variables in the font node did not work.
I think it's something outside of my knowledge. I guess the problem is with the new variables because they don't appear in the spreadsheet when the font node is selected.
Use the points() expression instead as it outputs a string attribute. The Text field of the Font SOP is a string field.
- jiejia
- Member
- 8 posts
- Joined: 8月 2017
- Offline
-
- Quick Links