hey peter, datatypes are kept in their own module to protect them from clashing with nodes. For example, there's a Time node and a Time data type.
from pymel import * v1 = datatypes.Vector(1,2,3) v2 = datatypes.Vector(2,2,2) v1.dot(v2) On Apr 7, 2009, at 6:13 PM, pjrich wrote: > > Hi all -- I'm new to both Python and Pymel, so I'm not sure where my > problem lies: > >>>> A = (1,1,1) >>>> B = (2,2,2) >>>> dot(A,B) > # Error: can't multiply sequence by non-int of type 'tuple' > # Traceback (most recent call last): > # File "<maya console>", line 3, in <module> > # File "[snip]\pymel\util\arrays.py", line 6534, in dot > # return reduce(lambda x, y: x+y, a*b, 0.) > # TypeError: can't multiply sequence by non-int of type 'tuple' # > > And I can't seem to cast anything specifically as a vector: > >>>> A = vector(1,1,1) > # Error: name 'vector' is not defined > # Traceback (most recent call last): > # File "<maya console>", line 1, in <module> > # NameError: name 'vector' is not defined # > > I see in the docs that there's a Vector class in the Pymel core, but I > can't get the examples in there to work either -- do I still need to > include something somewhere? > > Thanks! > Peter > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
