Skip to content

Commit 5418eb1

Browse files
Merge pull request #2 from AlexeySmolenchuk/packedPrimitives
add polysoup conversion
2 parents 911cc42 + 5d519b3 commit 5418eb1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/closest.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <GU/GU_Detail.h>
77
#include <GU/GU_RayIntersect.h>
88
#include <GU/GU_PrimPacked.h>
9+
#include <GEO/GEO_Detail.h>
10+
#include <GEO/GEO_ConvertParms.h>
911

1012
#include <map>
1113
#include <iostream>
@@ -178,7 +180,7 @@ void closest::CreateInstanceData(RixContext& ctx,
178180
if (gdp->load(filename.CStr()).success())
179181
{
180182

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

204+
// convert PolySoups to regular PrimPolys
205+
GEO_ConvertParms convertParams;
206+
convertParams.setFromType(GEO_PrimTypeCompat::GEOPRIMPOLYSOUP);
207+
gdp->convert(convertParams);
208+
202209
GA_PrimitiveGroup* grp = nullptr;
203210
if (!primgroup.Empty())
204211
{

0 commit comments

Comments
 (0)