Python addAttrib - vector attrib creation

   4646   2   1
User Avatar
Member
277 posts
Joined: 7月 2006
Offline
Hi!

Is there any method to create VECTOR attrbiutes with addAttrib function of hou.geometry() class?

according to documentation, the default value of attribute beeing created is determined by the ‘default_value’ parm. It could be an integer, float, strong, integer sequence and float sequence.

All these forms create attrbutes, which ends with digits, like at0, at1, at2 etc.

Of course I can manually create 3 attributes : atx, aty and atz, but then I'm not able to set them to be transformed as normal ….
How can I do it?

addAttrib(self, type, name, default_value, transform_as_normal=False) → hou.Attrib


transform_as_normal
This parameter is only available when the default value is a sequence of 3 floats. For such attributes, Houdini will not modify the attribute values when it transforms (translates, rotates, etc.) the geometry. If you want to the attribute to be transformed as a vector (such as a normal vector) when Houdini transforms the geometry, set this parameter to True.

Thank you
User Avatar
Member
1907 posts
Joined: 11月 2006
Offline
The transform_as_normal=True option does that.

geo.addAttrib(hou.attribType.Point, “at”, (0.0, 0.0, 0.0), True)

This gives me a point attribute with name at
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
277 posts
Joined: 7月 2006
Offline
hmm this name seems confusing to me….
Anyway thank you very much for making it clear
  • Quick Links