Closed GoogleCodeExporter closed 9 years ago
i believe your problem is that you're calling getTranslation on the locator
shape, not the transform:
x = spaceLocator()
x
# Result: nt.Transform(u'locator2') #
x.getTranslation()
# Result: dt.Vector([0.0, 0.0, 0.0]) #
s = x.getShape()
s
# Result: nt.Locator(u'locatorShape2') #
s.getTranslation()
# Error: nt.Locator(u'locatorShape2') has no attribute or method named
'getTranslation'
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# File
"/Users/chad/Documents/dev/luma/python/thirdParty/pymel/pymel/core/nodetypes.py"
, line 1732, in
__getattr__
# return super(GeometryShape,self).__getattr__(attr)
# File
"/Users/chad/Documents/dev/luma/python/thirdParty/pymel/pymel/core/nodetypes.py"
, line 301, in
__getattr__
# raise AttributeError,"%r has no attribute or method named '%s'" % (self,
attr)
# AttributeError: nt.Locator(u'locatorShape2') has no attribute or method named
'getTranslation' #
Original comment by chad...@gmail.com
on 10 Apr 2010 at 11:21
You're right...however, the node that the .listConnections() method returns has
changed, at least in this example.
I just extracted pymel 1.0.0rc2 and 1.0.1 right next to each other, and changed
my
maya.env between the two. When using 1.0.0rc2, when I print type(loc1) I get
nt.Transform. When I do the same with 1.0.1, I get nt.Locator. Makes sense why
I was
getting the error, I'm just not sure if it was intentional that the type of node
returned has changed.
Original comment by jspatr...@gmail.com
on 11 Apr 2010 at 2:12
ah, i know what the problem is now. listConnections was returning transforms
of shapes even when the actual
connection went to the shape. this was fixed in pymel, but it's such a
fundamental change that maybe we ought
to make a new flag for the command to enable this behavior. i'll talk it over
with the other developers.
Original comment by chad...@gmail.com
on 11 Apr 2010 at 2:25
Sorry, my description was really misleading (err....inaccurate). That makes
sense that
the return value is to the actual object that it's connected to: since I take
it
that's a permanent change, I'll update my scripts to work with it. Thanks!
Original comment by jspatr...@gmail.com
on 11 Apr 2010 at 3:20
hang on. it might not be the best decision on our part. i'm still looking into
it.
Original comment by chad...@gmail.com
on 11 Apr 2010 at 4:01
we rolled this change back. 1.0.2 will be out soon along with a few other
updates.
Original comment by chad...@gmail.com
on 12 Apr 2010 at 7:11
Original issue reported on code.google.com by
jspatr...@gmail.com
on 9 Apr 2010 at 5:11Attachments: