i have only got 2020 unfortunately. api version 20200405. i suppose it's good news that it's not happening on 2022, but i would be curious to get some ideas on why it's failing here. i am resorting to checking maya version and setting the context as current, in case it's 2020... which is less than ideal. thanks for checking!
On Thursday, 29 July 2021 at 13:23:48 UTC+12 vince touache wrote: > super weird, it seems to work fine on 2022, meaning it might not be an > actual deprecation warning. Any chance you can try it with a newer version > of maya ? > > > > Le mercredi 28 juillet 2021 à 18:17:52 UTC-4, juan c a écrit : > >> 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! >> >> -- 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/6680dd22-888f-41b5-982b-ca124836cd5an%40googlegroups.com.