Jump to content

Access Point by Point Number


Recommended Posts

Hi everyone!

I'm looking to access arbitrary point positions by point number. I was hoping to not have to iterate as I only want to access points 0,13,56 for example. Does anyone have any suggestions. I was thinking of just creating my own GA_Offset but I couldn't figure out how to create and edit one without using the helper functions like GA_FOR_ALL_PTOFF.

Thanks for the help!

Link to comment
Share on other sites

Something like:

const std::array<GA_Index,3> interesting_points = {0,13,56};
for (const auto & point_index: interesting_points) {
  assert(point_index < gdp->getNumPoints());
  GA_Offset point_offset = gdp->pointOffset(point_index);
  UT_Vector3 pos = gdp->getPos3(point_offset);
  // ... do something with pos
}

It doesn't have to be inside a loop ofc.

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