Fix review comments #51

Merged
Bogdan Nagirniak merged 15 commits from BLEN-430 into hydra-render 2023-06-08 18:10:55 +02:00
Showing only changes of commit f474677e5f - Show all commits

View File

@ -109,6 +109,10 @@ pxr::HdPrimvarDescriptorVector CurvesData::primvar_descriptors(
if (!vertices_.empty()) {
primvars.emplace_back(pxr::HdTokens->points, interpolation, pxr::HdPrimvarRoleTokens->point);
}
if (!widths_.empty()) {
primvars.emplace_back(pxr::HdTokens->widths, interpolation,
pxr::HdPrimvarRoleTokens->none);
}
}
else if (interpolation == pxr::HdInterpolationFaceVarying) {
if (!uvs_.empty()) {
@ -117,11 +121,6 @@ pxr::HdPrimvarDescriptorVector CurvesData::primvar_descriptors(
pxr::HdPrimvarRoleTokens->textureCoordinate);
}
}
else if (interpolation == pxr::HdInterpolationConstant) {
if (!widths_.empty()) {
primvars.emplace_back(pxr::HdTokens->widths, interpolation, pxr::HdPrimvarRoleTokens->none);
}
}
return primvars;
}
@ -159,14 +158,12 @@ void CurvesData::write_curves(Curves *curves)
curve_vertex_counts_.push_back(num_points);
/* Set radius similar to Cycles if isn't set */
widths_.push_back(radii ? radii[i] : 0.01f);
for (int j = 0; j < num_points; j++) {
int ind = first_point_index + j;
widths_.push_back(radii ? radii[ind] * 2 : 0.01f);
vertices_.push_back(pxr::GfVec3f(positions[ind][0], positions[ind][1], positions[ind][2]));
}
}
write_uv_maps(curves);
}