You’ve got it. :)

In this case, you’re getting instances of a class called Camera, which has
a number of parent classes, each adding additional methods to the Camera
class.

>>> camera = pm.ls(type='camera')[0]
>>> camera_class = type(camera)
>>> camera_superclasses = camera_class.__mro__

>>> print camera_superclasses
(<class 'pymel.core.nodetypes.Camera'>,
 <class 'pymel.core.nodetypes.Shape'>,
 <class 'pymel.core.nodetypes.DagNode'>,
 <class 'pymel.core.nodetypes.Entity'>,
 <class 'pymel.core.nodetypes.ContainerBase'>,
 <class 'pymel.core.nodetypes.DependNode'>,
 <class 'pymel.core.general.PyNode'>,
 <class 'pymel.util.utilitytypes.ProxyUnicode'>,
 <type 'object'>) #

That is why this particular instance has so many members for you to call.

>>> dir(camera)
['activeColor',
 'addAttr',
 'addBookmark',
 'addChild',
 'addPrefix',
 'applyBookmark',
 'attr',
 'attrDefaults',
 'attrInfo',
 ...

​

On 23 March 2015 at 21:50, Simon Davies <simonj.dav...@hotmail.co.uk> wrote:

> Thanks I think its becoming clearer:)
>
> So in my example this part of the code:
>
> pm.ls(type='camera')[0]
>
> is an instance of a class and that class contains the "getParent" and
> "getTranslation" methods, which means that the instance has access to those
> methods.
>
> --
> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/360d4fa5-26f7-4b76-9421-3fd098038a80%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
konstrukt...@gmail.com

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAemjt2A2t6x26d9CjA6fp%3Def5Dh6FL2oVcXGTd2LNGew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to