WIP - Attribute Combine Vector SOP - [Houdini Utility]

   2822   3   2
User Avatar
Member
123 posts
Joined: 12月 2019
Offline
Hello,

Since H19.0 we have the Attribute Combine SOP [www.sidefx.com]. It combines float attributes by layering different float operations (add, subtract, multiply...). It works with float vectors, but it doesn't support vector operations such as cross product, vector projection/rejection, or rotation around a vector/axis.

This gave me the idea to make an HDA called Attribute Combine Vector focused on combining vector operations.

In this very first prototype, the HDA applys a single operation from this list :
  • Cross : cross product between destination and source vectors
  • Project : projection of destination attribute to the direction of source attribute (it makes vectors aligned in same direction)
  • Reject : rejection of destination attribute from source attribute (it makes them orthogonal)
  • Rotate : rotates destination attribute around source attribute with a given angle


Examples of where this HDA can be usefull :
  • (Rotate) Twisting curves, by rotating @out vector around @tangent vector, and updating positions with rotated @out vector
  • (Reject) Displacing curves in orthogonal direction (electric strand), by rejecting displacement direction from tangent vector.
  • (Project) Inherite a vector direction and keep magnitude

For next versions, I will be working on these features :
  • Layering multiple operations
  • Adjust/process source attrib before applying operation
  • Support all attribute classes (it only works on point attribs for now)
  • Apply this node on a given group only
  • Creation of xform and/or orient attributes as part of post-processing

Attachments:
v0.1_UI.png (19.2 KB)
v0.1_rotate_bypassed.png (2.1 MB)
v0.1_rotate_applied.png (2.1 MB)

Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
123 posts
Joined: 12月 2019
Offline
v0.2

  • All attribute classes are supported (point/primitive/vertex/detail)
  • Multiple combines can be done
  • Choice between a vector attribute or a constant vector parm to be combined
  • Added new operations : Copy, Add, Subtract
  • Added post-processing : normalize, and overal scale

Still TBD :
  • Adjust/process combined attrib before applying operation
  • Apply this node on a given group only

Creation of xform and/or orient attributes may come in another HDA, rather than being part of post-processing of this HDA.
Edited by ObeidaZakzak - 2023年11月26日 17:17:28

Attachments:
v0.2_UI.png (32.8 KB)

Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
123 posts
Joined: 12月 2019
Offline
v0.5 : available to dwonload and test
  • Fixed a couple of bugs and performance issues, and reworked the structure of the VEX script so it's easier to maintain
  • Added a menu to select an adjustment operation on the combine vector (normalize or scale)
  • Added group parm so the combine operations apply only on selected group

Attached a hip file demonstrating how to bend and twist curves using this tool.

Attachments:
demo_bend_and_twist_lines.hiplc (408.2 KB)
sop_obeida.attribcombinevector.0.5.hdalc (20.3 KB)
demo_bend_and_twist_lines.png (2.1 MB)

Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
123 posts
Joined: 12月 2019
Offline
v0.6

And here's a hip to demonstrate vector operations by visualizing three vectors (operands and result).

Attachments:
demo_operations.hiplc (471.7 KB)
sop_obeida.attribcombinevector.0.6.hdalc (21.1 KB)

Houdini Pipeline Supervisor @ TAT Studio
  • Quick Links