Fix: USD: Write sparse attribute data correctly

The common code which writes out attribute data was seemingly not
performing the right sequence of calls for the UsdUtilsSparseValueWriter
to actually write sparse data.

See PR for a test file and .usda files produced with 4.1 and now with
this change applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/126113
This commit is contained in:
Jesse Yurkovich
2024-08-09 19:48:52 +02:00
committed by Jesse Yurkovich
parent 5835ea1eaf
commit 3c394d39f2

View File

@@ -127,12 +127,9 @@ void copy_blender_buffer_to_primvar(const VArray<BlenderT> &buffer,
}
}
if (!primvar.HasValue() && timecode != pxr::UsdTimeCode::Default()) {
if (!primvar.HasValue()) {
primvar.Set(usd_data, pxr::UsdTimeCode::Default());
}
else {
primvar.Set(usd_data, timecode);
}
value_writer.SetAttribute(primvar.GetAttr(), usd_data, timecode);
}