I'm trying to move the pivot of a plane to a vertex in this case vertex 2, the thing works in mel, but Im having a hard time with the translation to maya/python.
The mel code looks like:
polyPlane -w 10 -h 10 -sx 1 -sy 1 -ax 0 1 0 -cuv 2 -ch 1;
move 5 0 5
$posn = `pointPosition -w Plot.vtx`;
move -a $posn $posn $posn Plot.scalePivot Plot.rotatePivot ;
The real problem is with lines 3 to 5, the rest is trivial.
The first issue is with posn, in mel the result is 0 0 0, but in python it gives [0.0, 1.1102230246251565e-015, 0.0]
The next problem is moving the pivot, I still don't get how to pass this type of arguments, and as a result the pivot doesn't move...
I was trying this in python:
select(all = None)
W = 10
H = 10
myPlane = polyPlane (w = W, h = H, sx = 1, sy = 1, ax = (0,1,0), cuv = 2, ch = 1)
move(W/2, 0, H/2)
# This gives an different result [0.0, 1.1102230246251565e-015, 0.0]
posn = pointPosition(w = '%s.vtx' %(myPlane))
# My options didn't work
move(a = (posn, posn, posn), ' %s.scalePivot %s.rotatePivot' % (myPlane, myPlane))
#move('-a %i %i %i %s.scalePivot %s.rotatePivot' % (posn, posn, posn, myPlane, myPlane))
#move(a = '%i %i %i %s.scalePivot %s.rotatePivot' % (posn, posn, posn, myPlane, myPlane))
Can you give me a hand?
And by the way, normally I get the following errors:
SyntaxError: non-keyword arg after keyword arg
Error string: "(kFailure): Unexpected Internal Failure".
Is there a place were I can find out what those mean?
Hmm nevermind I solved it with Xform