State:New|TargetRelease:No Target|icon_bug|icon_katana|database:public|Resolution:Fixed|BugID:270341|
Problem summary
Changes made to the "knots" attribute are ignored and the HydraViewer defaults to "Open" and the LegacyViewer defaults to "Clamped".
Customer reported version
katana.n_a
Customer reported platform
n/a
Steps to reproduce
1) Import a B-Spline curve with a degree value greater than 1.
2) Create an OpScript and link the curve with CEL.
3) Add the following code. This will set the "geometry.knots" attribute value to a "Clamped" curve.
local controlPoints = Interface.GetAttr("geometry.numVertices"):getValue()local degree = Interface.GetAttr("geometry.degree"):getValue()local multiplicity = degree + 1local knotsLen = controlPoints + multiplicitylocal knots = {}for i=1, knotsLen do if i <= multiplicity then knots[i] = 0 elseif i > knotsLen - multiplicity then knots[i] = knotsLen - (multiplicity*2-1) else knots[i] = i - multiplicity endendInterface.SetAttr("geometry.knots", FloatAttribute(knots)) Results) In the HydraViewer, note that the curve does not reach the endpoints vertices.
We're sorry to hear that
Please tell us why