array attributes to python
10314 9 1- orr
- Member
- 98 posts
- Joined: Jan. 2008
- Offline
- Anonymous
- Member
- 678 posts
- Joined: July 2005
- Offline
Have you solved this?
I'm facing the same problem. floatAttribValue() is for attribs of size 1, floatListAttribValue() should in theory return tuple, but it looks that it's only for vectors and such, not when you have array.
Let's say you have on each point, anyone knows how to access array attribute per point in Python?
I'm facing the same problem. floatAttribValue() is for attribs of size 1, floatListAttribValue() should in theory return tuple, but it looks that it's only for vectors and such, not when you have array.
Let's say you have on each point, anyone knows how to access array attribute per point in Python?
- jrichards
- Member
- 5 posts
- Joined: Aug. 2014
- Offline
I'm having the same problem, trying this with Houdini 14.0.472:
I have an attribute that I created of type “Integer Array” and in Python when I try to access this attr it's not working…
>>> print geo.points().attribValue(“myIntArray”)
0
Stumped, I saw there was another method that looks like what I needed however…
>>> print geo.points().intListAttribValue(“myIntArray”)
(0,)
But the data is there–If I use vex in a wrangle I can get access to the values:
>>> printf(“attr: %g\n”, i@myIntArray);
attr: {2, 26, 50}
I'd rather not write a wrangle to copy this array to an N sized int just to access it in Python but maybe that's what I have to do?
Anyone know how to access array attributes from Python?
thanks!
I have an attribute that I created of type “Integer Array” and in Python when I try to access this attr it's not working…
>>> print geo.points().attribValue(“myIntArray”)
0
Stumped, I saw there was another method that looks like what I needed however…
>>> print geo.points().intListAttribValue(“myIntArray”)
(0,)
But the data is there–If I use vex in a wrangle I can get access to the values:
>>> printf(“attr: %g\n”, i@myIntArray);
attr: {2, 26, 50}
I'd rather not write a wrangle to copy this array to an N sized int just to access it in Python but maybe that's what I have to do?
Anyone know how to access array attributes from Python?
thanks!
- goldleaf
- Staff
- 4175 posts
- Joined: Sept. 2007
- Offline
- jrichards
- Member
- 5 posts
- Joined: Aug. 2014
- Offline
- aeaeaeae
- Member
- 126 posts
- Joined: Aug. 2010
- Offline
- aeaeaeae
- Member
- 126 posts
- Joined: Aug. 2010
- Offline
- jlait
- Staff
- 6220 posts
- Joined: July 2005
- Offline
- caleb
- Member
- 30 posts
- Joined: July 2005
- Offline
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Offline
Hi Caleb,
You can find it under hou.Geometry or one of the geometry class pages such as hou.Point.
http://www.sidefx.com/docs/houdini/hom/hou/Geometry#intListAttribValue [www.sidefx.com]
http://www.sidefx.com/docs/houdini/hom/hou/Point#intListAttribValue [www.sidefx.com]
You can find it under hou.Geometry or one of the geometry class pages such as hou.Point.
http://www.sidefx.com/docs/houdini/hom/hou/Geometry#intListAttribValue [www.sidefx.com]
http://www.sidefx.com/docs/houdini/hom/hou/Point#intListAttribValue [www.sidefx.com]
-
- Quick Links