Aearon Posted October 8, 2008 Share Posted October 8, 2008 Hey guys, is there anyway to create a vector type attribute? all i seem to get is a '3 float' type using geo.addAttrib(hou.attribType.Point, "N", hou.Vector3(0.0,0.0,1.0)) or geo.addAttrib(hou.attribType.Point, "N", (0.0,0.0,1.0)) but some of the standard attributes like 'N' and 'up' need to be vector attributes Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 8, 2008 Author Share Posted October 8, 2008 and another thing, setting string attribute values using setAttribValue doesn't seem to work either, it complains about a wrong type any ideas? Quote Link to comment Share on other sites More sharing options...
edward Posted October 8, 2008 Share Posted October 8, 2008 Seems to work for me ... (9.5.252) geo = hou.pwd().geometry() # for vector attributes, we need to send down True for transform_as_normal geo.addAttrib(hou.attribType.Point, "N", (1.0,1.0,1.0), True) # string attribute geo.addAttrib(hou.attribType.Prim, "name", "") for poly in geo.prims(): if poly.number() % 2 == 0: poly.setAttribValue("name", "even"); else: poly.setAttribValue("name", "odd"); Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 9, 2008 Author Share Posted October 9, 2008 thanks edward, i didn't know about the transform as normal attribute as for the string attribute, i tried it like this before: attr = geo.addAttrib(hou.attribType.Prim, "name", "") poly.setAttribValue(attr, "even"); this is the way it's done in some of the HOM Cookbook examples, but apparently this doesn't work for strings? it does work for the vector attribs i'm adding. anyway your method works fine and i'm on my way. thanks! Quote Link to comment Share on other sites More sharing options...
edward Posted October 9, 2008 Share Posted October 9, 2008 I've logged bug 32707 for that since that should work. It's not just for string attributes, but also for all the other single component versions of the setAttribValue() methods. Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 15, 2008 Author Share Posted October 15, 2008 cool thanks for confirming and submitting Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.