diff --git a/src/houdini/lib/H_USD/HUSD/HUSD_OutputProcessor.C b/src/houdini/lib/H_USD/HUSD/HUSD_OutputProcessor.C index 7edc8487..217e6a11 100644 --- a/src/houdini/lib/H_USD/HUSD/HUSD_OutputProcessor.C +++ b/src/houdini/lib/H_USD/HUSD/HUSD_OutputProcessor.C @@ -371,7 +371,13 @@ husd_RegistryHolder::husd_RegistryHolder() myRegistry.registerOutputProcessor(basename, processor); } } - UT_Exit::addExitCallback(clearRegistryCallback, this); + + // Register a callback to clean up the registry at exit time. + // Note that registry cleanup can involve executing Python code + // so we want the callback to run at Python exit time. + std::function clear_registry_func = + std::bind(&husd_RegistryHolder::clearRegistryCallback, this); + PYregisterAtExitCallback(clear_registry_func); } void diff --git a/src/houdini/lib/H_USD/gusd/agentUtils.cpp b/src/houdini/lib/H_USD/gusd/agentUtils.cpp index d547f0cd..6aab791f 100644 --- a/src/houdini/lib/H_USD/gusd/agentUtils.cpp +++ b/src/houdini/lib/H_USD/gusd/agentUtils.cpp @@ -422,7 +422,12 @@ Gusd_CreateCaptureAttributes( } for (int c = 0; c < tupleSize; ++c) { - indexPair->setIndex(captureAttr, o, c, indices[c]); + // Unused influences have both an index and weight + // of 0. Convert this back to an invalid index for + // the capture attribute. + indexPair->setIndex( + captureAttr, o, c, + (weights[c] == 0.0) ? -1 : indices[c]); indexPair->setData(captureAttr, o, c, weights[c]); } }