Fix: Incorrect radius values used for Alembic points and USD nurbs
These were reading in "widths" and not adjusting the values when setting Blender's "radius" properties. Found while cleaning up the radius API usage as part of another change. Pull Request: https://projects.blender.org/blender/blender/pulls/134709
This commit is contained in:
committed by
Jesse Yurkovich
parent
0acd86abca
commit
1ef3808030
@@ -140,11 +140,11 @@ void AbcPointsReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
const P3fArraySamplePtr &positions = sample.getPositions();
|
||||
|
||||
const IFloatGeomParam widths_param = m_schema.getWidthsParam();
|
||||
FloatArraySamplePtr radii;
|
||||
FloatArraySamplePtr widths;
|
||||
|
||||
if (widths_param.valid()) {
|
||||
IFloatGeomParam::Sample wsample = widths_param.getExpandedValue(sample_sel);
|
||||
radii = wsample.getVals();
|
||||
widths = wsample.getVals();
|
||||
}
|
||||
|
||||
if (point_cloud->totpoint != positions->size()) {
|
||||
@@ -163,9 +163,9 @@ void AbcPointsReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
attribute_accessor.lookup_or_add_for_write_span<float>("radius", bke::AttrDomain::Point);
|
||||
MutableSpan<float> point_radii = point_radii_writer.span;
|
||||
|
||||
if (radii) {
|
||||
for (size_t i = 0; i < radii->size(); i++) {
|
||||
point_radii[i] = (*radii)[i];
|
||||
if (widths) {
|
||||
for (size_t i = 0; i < widths->size(); i++) {
|
||||
point_radii[i] = (*widths)[i] / 2.0f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -150,7 +150,7 @@ void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
|
||||
|
||||
float radius = 0.1f;
|
||||
if (idx < usdWidths.size()) {
|
||||
radius = usdWidths[idx];
|
||||
radius = usdWidths[idx] / 2.0f;
|
||||
}
|
||||
|
||||
bp->radius = radius;
|
||||
|
||||
Reference in New Issue
Block a user