Skip to content

Commit

Permalink
Merge pull request #2 from AlexeySmolenchuk/packedPrimitives
Browse files Browse the repository at this point in the history
add polysoup conversion
  • Loading branch information
AlexeySmolenchuk authored Jan 4, 2024
2 parents 911cc42 + 5d519b3 commit 5418eb1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/closest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <GU/GU_Detail.h>
#include <GU/GU_RayIntersect.h>
#include <GU/GU_PrimPacked.h>
#include <GEO/GEO_Detail.h>
#include <GEO/GEO_ConvertParms.h>

#include <map>
#include <iostream>
Expand Down Expand Up @@ -178,7 +180,7 @@ void closest::CreateInstanceData(RixContext& ctx,
if (gdp->load(filename.CStr()).success())
{

// Attempt to unpack all Packeds, Alembics and USD
// Attempt to unpack all Packeds, Alembics and USDs
while (GU_PrimPacked::hasPackedPrimitives(*gdp))
{
for (GA_Iterator it(gdp->getPrimitiveRange()); !it.atEnd(); ++it)
Expand All @@ -199,6 +201,11 @@ void closest::CreateInstanceData(RixContext& ctx,
}
}

// convert PolySoups to regular PrimPolys
GEO_ConvertParms convertParams;
convertParams.setFromType(GEO_PrimTypeCompat::GEOPRIMPOLYSOUP);
gdp->convert(convertParams);

GA_PrimitiveGroup* grp = nullptr;
if (!primgroup.Empty())
{
Expand Down

0 comments on commit 5418eb1

Please sign in to comment.