Hi,

It should read :

from pymel import *
a=[-1,1,0]
b=[-1,-1,0]
c=[1,1,0]
d=[1,-1,0]
print center(a,b,c,d)

or

from pymel import *
a=[-1,1,0]
b=[-1,-1,0]
c=[1,1,0]
d=[1,-1,0]
ctr = center(a,b,c,d)
print ctr

Does that work ?

*args indicates a variable number of arguments, so center(p, *args) takes at 
least one argument, and possibly as much as you want (all the points of the 
face), so :

print center() would complain
print center(a) would print a
print center(a, b) would print the center of a and b thus (a + b)/2

etc.

If you can't import Vector then you probably have  a pymel installation
problem (wrong path in PYTHONPATH or the like).

Olivier

Dimitry wrote:
> Hi Oliver,
>
> thank you for you answer! that's what i need! But it seams not to work
> on my mac :(
> if i put
>
> from pymel import *
> a=[-1,1,0]
> b=[-1,-1,0]
> c=[1,1,0]
> d=[1,-1,0]
> center([a,b,c,d])
> print center
>
> i got:
> # Error: name 'center' is not defined
> # Traceback (most recent call last):
> #   File "<maya console>", line 6, in <module>
> # NameError: name 'center' is not defined #
>
> i tried also Ofers suggestion
> v1 = Vector([1,2,3])
> v2 = Vector([2,3,4])
> print v1 + v2
>
> with a same effect:
> # Error: cannot import name Vector
> # Traceback (most recent call last):
> #   File "<maya console>", line 1, in <module>
> # ImportError: cannot import name Vector #
>
> and what means *args?
>
> All the Best!
> Dimitry
>
>
> >
>
>   


-- 
Olivier Renouard


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

Reply via email to