Jump to content

fastConsolidatePoints() deprecated since H17.5


Recommended Posts

It seems that all point consolidation methods pre H17.5 are deprecated and we should switch to using GU_Snap instead. Problem is, there is no GU_Snap in H17.5 or at least I couldn't find it.
It's not a separate file in $HFS/toolkit/include/GU directory and it's not embedded inside any header file in whole $HFS/toolkit/include directory.

Is it not included yet in builds?

Any help?

Edited by bamfbamf
Link to comment
Share on other sites

  • 3 years later...

Now, Houdini19.5, "toolkit\include\GU\GU_Snap.h"

Fuse SOPimage.png.616bae19b8dbc04de75a2eb74f02bfe4.png

"GU_Snap.h"image.png.3f41390a47681d63d53ad873f3a20df4.png

I used "snapGrid" successfully like this

void CeshiVerb::cook(const SOP_NodeVerb::CookParms& cookparms) const
{
    auto&& sopparms = cookparms.parms<CeshiParms>();
    GU_Detail* detail = cookparms.gdh().gdpNC();
    GU_Detail qgdp;
    qgdp.copy(*detail);
    GA_RWHandleV3 Phandleq(qgdp.findAttribute(GA_ATTRIB_POINT, "P"));
    GU_Snap::GridSnapParms parms;
    parms.myGridSnapType = 0;
    parms.myXLines = 1;
    parms.myYLines = 1;
    parms.myZLines = 1;
    parms.myXOff = 0;
    parms.myYOff = 0;
    parms.myZOff = 0;
    parms.myTol = 10;
    parms.myPosH = Phandleq;
    GU_Snap::snapGrid(qgdp, parms);
    detail->copy(qgdp);
}

But "snapPoints" has something wrong

    GU_Detail qgdp;
    qgdp.copy(*detail);
    detail->clearAndDestroy();
    GU_Snap::PointSnapParms parms;
    parms.myDistance = 0.1;
    parms.myAlgorithm = GU_Snap::PointSnapParms::SnapAlgorithm::ALGORITHM_LOWEST_POINT;
    parms.myQPosH = qgdp.getP();
    parms.myTPosH = qgdp.findAttribute(GA_ATTRIB_POINT, "P");
    GU_Snap::snapPoints(qgdp, NULL, parms);
    detail->copy(qgdp);

 

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