hi
i am trying to get some value at time:
from maya.api import OpenMaya
time = OpenMaya.MTime(20)
context = OpenMaya.MDGContext(time)
node_obj = OpenMaya.MSelectionList().add('persp').getDependNode(0)
node = OpenMaya.MFnDependencyNode(node_obj)
plug = node.findPlug('tx', False)
value = plug.asMDistance(context)
this freezes maya for a second or two and spits out this error:
# sys:1: DeprecationWarning: Call MPlug::asType() instead. If needed, use MDGContextGuard switch context.
it works fine on older maya versions, and using the old api.
any ideas?
cheers!