Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.
There's currently no way to convert an OpenMaya object to OM2 or back. This fragments Python APIs: if you're using OpenMaya you can't use OM2 at all and vice versa. There's no way to migrate code or transition between them, since it's all or nothing.
Also, PyMEL uses OpenMaya, which means anyone building around PyMEL can only use OM and is locked out of OM2.
All that's needed to fix this is a way to convert MObject and MPlug between these APIs, so you can say:
from maya import OpenMaya as om from maya.api import OpenMaya as om2 obj1 = om.MObject() obj2 = om2.MObject(obj1) # OM1 MObject -> OM2 MObject
obj3 = om.MObject(obj2) # OM2 MObject -> OM1 MObject
plug1 = om.MPlug() plug2 = om2.MPlug(plug1) # OM1 MPlug -> OM2 MPlug
plug3 = om.MPlug(plug2) # OM2 MPlug -> OM1 MPlug
There's no need to support this for function sets, since you can just convert the MObject and create a new function set.
This would make OpenMaya2 a lot more accessible to people who are currently locked into OpenMaya1 and the other way around.
Can't find what you're looking for? Ask the community or share your knowledge.