Jump to content

Is there a way to create attributes similar to Cloth Capture?


Recommended Posts

When you use Cloth Capture SOP, it seems to create attributes such as these:

clothCapture regn[0]

clothCapture w[0,0]

...

It has spaces too. Is this only doable in the HDK? Because Houdini doesn't seem to allow spaces when using AttribCreate. So I assume that's HDK magic?

Thanks :)

Link to comment
Share on other sites

That's only the geometry spreadsheet adding the spaces for readability. The attribute names are exactly what you see in the MMB node info or in the SOP's Extended Info window. Capture weights in Houdini use a special attribute type called "index pair" which stores pairs of indices along with a float array.

  • Like 1
Link to comment
Share on other sites

It is available in the HDK but not really documented. To create a standard capture weight attribute, I think you use GEO_Detail::addPointCaptureAttribute() and GEO_AttributeIndexPairs.

If you need something more custom, then you use GEO_Detail::addPtCaptureAttribute() and the classes in GA_AIFIndexPair.h.

PS. Not my choice of names! :)

  • Like 1
Link to comment
Share on other sites

Thanks alot Edward. Just out of curiosity, is this how you create a float array attribute? So you use capture attribute functions even though you are not trying to create the same capture attributes but an array of attributes? If so, then the names are indeed confusing :)

Also not sure if you are allowed to reply to this, but is there not a strict review process for every code check in at SESI? :) I remember when working with programmers who work in Unreal Engine, they were really anal about how to name things before checking them in, which I thought was a bit overkill. But I am sure no way Unreal Engine code can compare to the ingenuity or the sheer size of the Houdini code base :)

Link to comment
Share on other sites

I suppose you can use indexpair attributes as a sort of float array attribute. In pre-H12 versions, indexpair attributes only contained pairs of (index, value) where value is a single scalar float. However, it was extend in H12 so that value can be a (fixed) array of floats.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...