USD IO: Move to the new Mesh Attributes API for Colors #105347
|
@ -415,7 +415,7 @@ void USDMeshReader::read_uvs(Mesh *mesh, const double motionSampleTime, const bo
|
|||
}
|
||||
}
|
||||
|
||||
void USDMeshReader::read_color_data_all(Mesh *mesh, const double motionSampleTime)
|
||||
void USDMeshReader::read_color_data_all_primvars(Mesh *mesh, const double motionSampleTime)
|
||||
{
|
||||
if (!(mesh && mesh_prim_ && mesh->totloop > 0)) {
|
||||
return;
|
||||
|
@ -457,7 +457,7 @@ void USDMeshReader::read_color_data_all(Mesh *mesh, const double motionSampleTim
|
|||
continue;
|
||||
}
|
||||
|
||||
read_color_data(mesh, pv, motionSampleTime);
|
||||
read_color_data_primvar(mesh, pv, motionSampleTime);
|
||||
}
|
||||
|
||||
if (!active_color_name.IsEmpty()) {
|
||||
|
@ -465,7 +465,7 @@ void USDMeshReader::read_color_data_all(Mesh *mesh, const double motionSampleTim
|
|||
}
|
||||
}
|
||||
|
||||
void USDMeshReader::read_color_data(Mesh *mesh,
|
||||
void USDMeshReader::read_color_data_primvar(Mesh *mesh,
|
||||
const pxr::UsdGeomPrimvar &color_primvar,
|
||||
const double motionSampleTime)
|
||||
{
|
||||
|
@ -765,7 +765,7 @@ void USDMeshReader::read_custom_data(const ImportSettings *settings,
|
|||
const double motionSampleTime)
|
||||
{
|
||||
if ((settings->read_flag & MOD_MESHSEQ_READ_COLOR) != 0) {
|
||||
read_color_data_all(mesh, motionSampleTime);
|
||||
read_color_data_all_primvars(mesh, motionSampleTime);
|
||||
}
|
||||
|
||||
/* TODO: Generic readers for custom data layers not listed above. */
|
||||
|
|
|
@ -77,8 +77,9 @@ class USDMeshReader : public USDGeomReader {
|
|||
Mesh *mesh,
|
||||
double motionSampleTime);
|
||||
|
||||
void read_color_data_all(Mesh *mesh, double motionSampleTime);
|
||||
void read_color_data(Mesh *mesh, const pxr::UsdGeomPrimvar &color_primvar, double motionSampleTime);
|
||||
void read_color_data_all_primvars(Mesh *mesh, const double motionSampleTime);
|
||||
CharlesWardlaw marked this conversation as resolved
Outdated
|
||||
void read_color_data_primvar(Mesh *mesh, const pxr::UsdGeomPrimvar &color_primvar,
|
||||
const double motionSampleTime);
|
||||
};
|
||||
|
||||
} // namespace blender::io::usd
|
||||
|
|
|
@ -38,7 +38,6 @@ class USDGenericMeshWriter : public USDAbstractWriter {
|
|||
void write_surface_velocity(const Mesh *mesh, pxr::UsdGeomMesh usd_mesh);
|
||||
|
||||
void write_custom_data(const Mesh *mesh, pxr::UsdGeomMesh usd_mesh);
|
||||
|
||||
void write_color_data(const Mesh *mesh,
|
||||
CharlesWardlaw marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
At the moment At the moment `write_custom_data()` only writes color data, meaning that this function is strongly related to `write_color_data()`. Remove the empty line between the two to show this relation more visually.
|
||||
pxr::UsdGeomMesh usd_mesh,
|
||||
const bke::AttributeIDRef &attribute_id,
|
||||
|
|
Loading…
Reference in New Issue
Now there is
..._data
and..._data_all
. It's not immediately clear from the naming how these relate.read_color_data_primvar
andread_color_data_all_primvars
would be better, but if you feel that's getting too long, documentation of what they do would already help a lot.