setting point array attributes with python
5733 2 0-
- kojala_home
- Member
- 3 posts
- Joined: June 2017
- Offline
-
- htroutmaniv
- Member
- 2 posts
- Joined: Oct. 2018
- Offline
yes.
you can access the points and use the setAttributeValue method to give them a new attribute. The code above iterates through all points in the geometry and sets their value to 1.
if you need to access individual faces/prims you have to get at the points a little differently by getting the vertex first something like
node = hou.pwd() geo = node.geometry() newValue = 1 for point in geo.points(): point.setAttributeValue('attributeName',newValue)
you can access the points and use the setAttributeValue method to give them a new attribute. The code above iterates through all points in the geometry and sets their value to 1.
if you need to access individual faces/prims you have to get at the points a little differently by getting the vertex first something like
prims = geo.prims() for prim in prims: verts = prim.vertices() for vert in verts: point = vert.point() point.setAttributeValue('attributeName',newValue)
-
- kojala_home
- Member
- 3 posts
- Joined: June 2017
- Offline
I know the iteration ways and I dont want to use them as they are slow when dealing with heavy meshes. thats why the geometry module. I can set all other attribute types in geometry module except point/prim arrays. is this just left out from python implementation?
Edited by kojala_home - Dec. 29, 2019 06:22:30
-
- Quick Links
