Skip to content

Instantly share code, notes, and snippets.

@danvas danvas/
Created Sep 16, 2011

What would you like to do?
To find vector between curve points.
def vect(curv, pt2 = 1, pt1 = 0):
"""Returns a vector from two cvs on a curve. The argument curv is a PyMEL instance or string. For example:\vect('curve1', pt2 = 5, pt1 = 2) gives you a direction (i.e. vector) from cv[2] to cv[5] in curve1"""
if type(curv) == str:
curv =[0]
if curv.getShape().numCVs() <= pt2:
print('\n!! There are {0} cvs. Make sure your pt2 value is less than {0}. !!'.format(curv.getShape().numCVs()))
return [[pt2].getPosition()[0] -[pt1].getPosition()[0],[pt2].getPosition()[1] -[pt1].getPosition()[1],[pt2].getPosition()[2] -[pt1].getPosition()[2]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.