Hi!
I’m trying to create a curve from code. I get existing curve’s data like CVs, knots, periodic or not and degree and feed it into a cmds.curve command.
Here’s an example using data I got from a standard circle curve:
pts = [[0.7836116248912245, 4.798237340988473e-17, -0.7836116248912246], [6.785732323110912e-17, 6.785732323110912e-17, -1.1081941875543877], [-0.7836116248912245, 4.798237340988472e-17, -0.7836116248912244], [-1.1081941875543881, 3.517735619006027e-33, -5.74489823752483e-17], [-0.7836116248912245, -4.7982373409884725e-17, 0.7836116248912245], [-1.1100856969603225e-16, -6.785732323110917e-17, 1.1081941875543884], [0.7836116248912245, -4.798237340988472e-17, 0.7836116248912244], [1.1081941875543881, -9.253679210110099e-33, 1.511240500779959e-16], [1.1081941875543881, -9.253679210110099e-33, 1.511240500779959e-16], [1.1081941875543881, -9.253679210110099e-33, 1.511240500779959e-16], [1.1081941875543881, -9.253679210110099e-33, 1.511240500779959e-16]]
cmds.curve(p=pts,
d=3.0,
per=True,
k=(-2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0))
However it gives me a “maya command error”. If I remove periodic and knots flags then it creates the curve, but it’s obviously open and not a closed circle.
I’m at a loss, there’s no explanation, just a generic error, and I assume that data should be correct as it’s grabbed from an existing curve.
What is my mistake here?