You could also do a.length() to get he result. There are a bunch of
useful functions built into the Vector class here is a link to the
documentation where you can see a list of some of the other ones like
unit() etc

http://pymel.googlecode.com/svn/docs/pymel.core.datatypes.Vector-class.html

On Mon, Apr 13, 2009 at 9:53 AM, pjrich <zoomcrack...@gmail.com> wrote:
>
>>>>import pymel
>>>>a = datatypes.Vector([1, 1, 1])
>>>>mel.mag(a)
>
> # Error: line 1: Invalid call to "mag".  Check number and types of
> arguments expected by the procedure. #
> # Error: Error occurred during execution of MEL script: line 1:
> Invalid call to "mag".  Check number and types of arguments expected
> by the procedure.
> # Traceback (most recent call last):
> #   File "<maya console>", line 4, in <module>
> #   File "C:/Documents and Settings/pjrich/My Documents/maya/2009/
> scripts\pymel\core\language.py", line 589, in _call
> #     return self.eval(cmd)
> #   File "C:/Documents and Settings/pjrich/My Documents/maya/2009/
> scripts\pymel\core\language.py", line 697, in eval
> #     raise e, "Error occurred during execution of MEL script: %s" %
> ( msg )
> # MelError: Error occurred during execution of MEL script: line 1:
> Invalid call to "mag".  Check number and types of arguments expected
> by the procedure. #
>
> Would MetaMayaArrayTypeWrapper or getMelRepresentation() help here?
> How do you use them anyway?
> Alternately, I see a mag() in vector.py in the pycon branch, how do I
> get it and use it?
>
> I'm not so hung up on mag(), I can do that by hand if necessary... but
> I feel like I'm missing some fundamental assumption somewhere which
> would answer all of these questions at once. Or do I just need to read
> all the docs again?
>
> Thanks...
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to