Alembic: Support new Curves object type for export #119894
|
@ -125,13 +125,12 @@ void ABCCurveWriter::do_write(HierarchyContext &context)
|
|||
return;
|
||||
}
|
||||
|
||||
const VArray<bool> cyclic_values = curves.cyclic();
|
||||
const bool is_cyclic = cyclic_values.is_empty() ? false : cyclic_values.first();
|
||||
if (array_utils::booleans_mix_calc(curves.cyclic()) == array_utils::BooleanMix::Mixed) {
|
||||
CLOG_WARN(&LOG, "Cannot export mixed cyclic and non-cyclic curves in the same Curves object");
|
||||
return;
|
||||
}
|
||||
|
||||
const bool is_cyclic = curves.cyclic().first();
|
||||
Alembic::AbcGeom::BasisType curve_basis = Alembic::AbcGeom::kNoBasis;
|
||||
deadpin marked this conversation as resolved
Outdated
|
||||
Alembic::AbcGeom::CurveType curve_type = Alembic::AbcGeom::kVariableOrder;
|
||||
Alembic::AbcGeom::CurvePeriodicity periodicity = is_cyclic ? Alembic::AbcGeom::kPeriodic :
|
||||
|
@ -189,9 +188,9 @@ void ABCCurveWriter::do_write(HierarchyContext &context)
|
|||
* control point 1(+ width), right handle 1, left handle 2,
|
||||
* control point 2(+ width), ...
|
||||
* ] */
|
||||
for (int i_point = start_point_index; i_point < last_point_index; i_point++) {
|
||||
for (const int i_point : points.drop_back(1)) {
|
||||
verts.push_back(to_yup_V3f(positions[i_point]));
|
||||
deadpin marked this conversation as resolved
Hans Goudey
commented
Just noticed, I think this can be simpler as Just noticed, I think this can be simpler as `for (const int point : points) {`
|
||||
widths.push_back(radii[last_point_index] * 2.0f);
|
||||
widths.push_back(radii[i_point] * 2.0f);
|
||||
|
||||
deadpin marked this conversation as resolved
Hans Goudey
commented
Seems the radius should be accessed from the current point rather than always the last point in the curve Seems the radius should be accessed from the current point rather than always the last point in the curve
|
||||
verts.push_back(to_yup_V3f(handles_r[i_point]));
|
||||
verts.push_back(to_yup_V3f(handles_l[i_point + 1]));
|
||||
|
|
Loading…
Reference in New Issue
cast to
CurveType
for compiler warnings in the switch if we ever add a new type