From 5d519b3f6741e64f27a749c67b426bdd3a9c0aa8 Mon Sep 17 00:00:00 2001 From: Alexey Smolenchuk Date: Thu, 4 Jan 2024 22:18:42 +0000 Subject: [PATCH] add polysoup conversion --- src/closest.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/closest.cpp b/src/closest.cpp index c15c69a..000a913 100644 --- a/src/closest.cpp +++ b/src/closest.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include @@ -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) @@ -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()) {