Hi
I have a custom MPxLocator which has internal attribute 'worldPosition'. If i say with MEL "getAttr('obj.worldPosition')" this returns the worldPosition of locator correctly. I tried to do the same with API, but always got (0.0, 0.0, 0.0):
# 1-st method
plug = openMaya.MPlug(self.thisMObject(), self.worldPosition)
print plug.child(0).asDouble()
Result: (0.0, 0.0, 0.0)
# 2-nd method
plug = openMaya.MPlug(self.thisMObject(), self.worldPosition)
data = self._forceCache()
hdata = data.inputValue(plug)
print hdata.asDouble3()
Result: (0.0, 0.0, 0.0)
What i do wrong? Thanks