Jump to content

HDK 14 version how to get GEO_Point from GU_Detail

Recommended Posts

In HDK 14 version, there is major changes that GU_Detail doesn't include GEO_Point anymore. 


Here is code in previous version 


function ( const GU_Detail* gdp, ~~~ )


    GEO_Point* ppt;

    GA_FOR_ALL_GPOINTS_( const_cast<GU_Detail *> (gdp), ppt ) {

          UT_Vector4 position = ppt->getPos();






In HDK14, GU_Detail doesn't support GEO_Point anymore. 


How I can get the GEO_Point data from GU_Detail class in HDK 14 ? 


( This code is part of tool which converts Houdini particle data to custom particle cache. )


Thanks for reading.




Link to comment
Share on other sites

GEO_Point was pretty much deprecated in H12 when the base geometry library was rewritten. It only existed in some ultra slow backwards compatibility layer. What you want is something more like:

void f(const GU_Detail* gdp, ...)
    for (GA_Offset ptoff : gdp->getPointRange())
        UT_Vector3 position = gdp->getPos3(ptoff);

If you don't have a sufficiently modern C++ compiler (which everyone should have), then you can replace the range-based for loop with "UTforEach(GA_Offset ptoff, gdp->getPointRange())" via #include <UT/UT_ForEach.h>

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.

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