having trouble writing a list of floats to a detail attribute via the python sop. instead of a float array of size n it seems to create a float of size n.
what python type should I use for hou to cast it to a float array instead?
python sop array attributes
2203 1 1-
- nvki
- Member
- 17 posts
- Joined: Feb. 2018
- Offline
-
- nvki
- Member
- 17 posts
- Joined: Feb. 2018
- Offline
idk how i missed that there was a separate method of hou.Geometry, addArrayAttribute for that. so to construct a float array with python:
node = hou.pwd() geo = node.geometry() pts = geo.points() data = [float(p.number())/float(len(pts)) for p in pts] detail = geo.addArrayAttrib(hou.attribType.Global, "test", hou.attribData.Float, 1) geo.setGlobalAttribValue("test", data)
Edited by nvki - Dec. 11, 2020 21:00:12
-
- Quick Links