I had a look with inspect

import inspect
import pymel.core as pm

node = pm.MeshFace('pSphere1.f[0]')
print inspect.getsourcelines(node.__eq__)
print inspect.getsourcefile(node.__eq__)


..and it looks like it all comes down to this.

def __eq__(self, other):
        if not hasattr(other, '__apicomponent__'):
            return False
        return self.__apicomponent__().isEqual(
other.__apicomponent__().object() )

Defined at general.py:3717


It does have an __apicomponent__ attribute, so it ends up comparing it to
other.__apicomponent__().object() which says that it is a:

Result: <maya.OpenMaya.MObject; proxy of <Swig Object of type 'MObject *'
at 0x0000000038F33E40> > #




On 26 February 2014 00:53, Justin Israel <[email protected]> wrote:

> I don't know much about the PyMel class structures, but it seems something
> is not defined properly for the __eq__ or __cmp__ methods of the base
> class, to reflect that they are different objects. There is a lot of
> inheritance in there so I am not really sure where to trace it back to
>
> f1 = pm.MeshFace("pSphere1.f[0]")
> f2 = pm.MeshFace("pSphere2.f[0]")
> f3 = pm.MeshFace("pSphere2.f[1]")
>
> # Should be False
> print f1 == f2
> # True
>
> # Should be False
> print f1 == f3
> # False
>
>
>
>
> On Wed, Feb 26, 2014 at 12:50 PM, Michael Boon <[email protected]> wrote:
>
>> Hi all,
>>
>> I have a situation where this happens:
>>
>> MeshFace(u'foo.f[38]') in [MeshFace(u'pillar_section2_lod0.f[38]')]#Result:
>> True
>>
>> These are Pymel MeshFaces. The object 'foo' is a result of a boolean
>> operation involving 'pillar_section2_lod0', but the two faces are not
>> the same on each object. I've deleted history on 'foo'.
>>
>> I'm not sure if the fact that both faces are index 38 is a coincidence or
>> not.
>>
>> Can someone explain why this might happen? It shouldn't happen, right? Or
>> do I have some misapprehension about MeshFaces?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/99ae04a0-ec47-4c15-9725-b2af0e3a19da%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1WJROzyGrUC29KeoZkz2-E_U16w0tmkDhBpX8qM%3DqjSg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODoUsAmL-fs2EX4TAa5b-%2BGoUwh7uTHieCoFSyWp1Wv7A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to