Skip to content

Commit

Permalink
Matching to Houdini build 18.5.34.
Browse files Browse the repository at this point in the history
  • Loading branch information
SideFX authored and Prisms User committed Nov 19, 2019
1 parent eb14850 commit 4890645
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/houdini/lib/H_USD/HUSD/HUSD_Save.C
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,12 @@ updateAssetPathsAndSaveVolumes(const SdfLayerRefPtr &layer,
else if (primspec)
{
// For primspecs, we want to check for clip metadata, and
// update any asset paths we find in there.
// update any asset paths we find in there. We also need to
// look for explicit reference and payload removals, which are
// not reported by GetExternalReferences().
VtValue value = primspec->GetInfo(UsdTokens->clips);
auto reflist = primspec->GetReferenceList();
auto payloadlist = primspec->GetPayloadList();

if (value.IsHolding<VtDictionary>())
{
Expand Down Expand Up @@ -425,6 +429,32 @@ updateAssetPathsAndSaveVolumes(const SdfLayerRefPtr &layer,
if (changed)
primspec->SetInfo(UsdTokens->clips, VtValue(clipsets));
}
if (!reflist.GetDeletedItems().empty())
{
auto dellist = reflist.GetDeletedItems();
for (auto it = dellist.begin(); it != dellist.end(); ++it)
{
SdfReference delref = *it;
UT_StringHolder oldpath = delref.GetAssetPath();
UT_StringHolder newpath = updateAssetPath(
oldpath, layer_save_path, output_processors);
delref.SetAssetPath(newpath.toStdString());
*it = delref;
}
}
if (!payloadlist.GetDeletedItems().empty())
{
auto dellist = payloadlist.GetDeletedItems();
for (auto it = dellist.begin(); it != dellist.end(); ++it)
{
SdfPayload delpayload = *it;
UT_StringHolder oldpath = delpayload.GetAssetPath();
UT_StringHolder newpath = updateAssetPath(
oldpath, layer_save_path, output_processors);
delpayload.SetAssetPath(newpath.toStdString());
*it = delpayload;
}
}
}
}
);
Expand Down

0 comments on commit 4890645

Please sign in to comment.