hou.hscriptVectorExpression function
Evaluate an Hscript expression as a vector.
See also: hou.hscriptExpression, hou.hscriptFloatExpression, hou.hscriptStringExpression, hou.hscriptMatrixExpression 3 more , hou.Vector2, hou.Vector3, hou.Vector4
Usage
hscriptVectorExpression(expression) → tuple of floats
This function will force the return type to be an Hscript vector. Because Hscript vectors can be be of different lengths, the value is returned as a tuple of floats. If you know the vector is a particular length, you can construct a Vector2/Vector3/Vector4 out of the return value.
vector = hou.Vector3(hou.hscriptVectorExpression('vtorigin("/obj/geo1", "/obj/geo2")')) print vector.length()
This function throws a hou.OperationFailed exception if the expression passed as a parameter is invalid or errors occur during evaluation.