Jump to content

Fastest way of copying all points in a detail into an array


Recommended Posts

Hello.

I have a detail and I want to copy all points, the trivial slution is obviously to iterate through all points and add them top the GEO_Point array.

One easy optimization is to make the loop multithread and copy the points in pages.

But I was wondering if there is any function in the HDK to batch copy blocks of points from a detail into an array.

Something similar to a memcopy wher you copy a block of data.

Thanks.

P

Link to comment
Share on other sites

Guest mantragora

From documentation:

"To be able to start removing problematic legacy structures and behaviour from the HDK, many functions are now deprecated, including anything with GEO_Point, GEO_Vertex, GEO_AttributeHandle, or GEO_PrimList in the signature."

What you want to do?

Link to comment
Share on other sites

From documentation:

"To be able to start removing problematic legacy structures and behaviour from the HDK, many functions are now deprecated, including anything with GEO_Point, GEO_Vertex, GEO_AttributeHandle, or GEO_PrimList in the signature."

What you want to do?

Nope sorry, I didn't explain myself correctly, I want to dump the P attribute for all points into a GA_Attribute array, for motion blur in a procedural.

Link to comment
Share on other sites

Use GA_Detail::getPos3AsArray() to get all the positions in an array. You can then use that to set a deformation blur attribute from the array.

Thanks Graham, very useful, I'll give it a try.

I'm just wondering if you have millions of points, the copy into the array will use threads or it will just loop through all points?

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...