Search - User list
Full Version: Python addAttrib - vector attrib creation
Root » Technical Discussion » Python addAttrib - vector attrib creation
danilo2
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
graham
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
danilo2
hmm this name seems confusing to me….
Anyway thank you very much for making it clear
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB