What Python in Maya to query number of EPs in a curve?


#1

Greetings,
I am working on a Python script, and I need to query the number of Edit Points in a NURBS curve.
I have found examples for how to query the number of Control Vertices, but I can’t find anything about Edit Points.
What command(s) can be used to return the number of Edit Points in a curve?

Or, if Control Vertices are the only thing that can be found out, what is the relation of number of CVs to number of EPs?
(Apparently CVs = spans + degree, found MEL examples, but no Python syntax examples.
However, I can’t see a consistent pattern to the number of CVs relative to EPs to create a formula…)

Thank you! I am a rigger new to coding, but I am eager to learn…


#2

Since edit points appear between spans the formula should be:

NumberOfEditPoints = NumberOfSpans + 1

Or you simply use pymel:

import pymel.core as pm
c = pm.ls(sl=True)
c.numEPs()