Hi !
I reiterate because in fact the problem is not completely resolved.
```
from maya import cmds, OpenMaya, utils
def qd_handle_attr_cb(mp):
print mp.adString()
def qd_dirty_plug_cb(mo, mp, *args, **kwargs):
if OpenMaya.MFnAttribute(mp.attribute()).name() != 'fileName':
return
print mp.adString()
utils.executeDeferred(qd_handle_attr_cb, OpenMaya.MPlug(mp.node(),
mp.attribute()))
cmds.addExtension(nodeType='transform', longName='fileName',
dataType='string')
s_node_1 = cmds.createNode('transform')
s_node_2 = cmds.createNode('transform')
cmds.connectAttr('{0}.fileName'.format(s_node_1),
'{0}.fileName'.format(s_node_2))
msl = OpenMaya.MSelectionList()
msl.add(s_node_2)
mo = OpenMaya.MObject()
msl.getDependNode(0, mo)
i_call_back = OpenMaya.MNodeMessage.addNodeDirtyPlugCallback(mo,
qd_dirty_plug_cb)
# OpenMaya.MNodeMessage.removeCallback(i_call_back)
```
If I set* s_node_1.fileName* my callback is append but the value setted on
*s_node_2.fileName* is not valid. The attribute *s_node_2.fileName* has a
delay value.
You have solution for this case ?
Le jeudi 6 août 2020 à 09:20:13 UTC+2, Rémi Deletrain a écrit :
> Thanks Justin ! Your solution works.
>
> I did not know the utils module and the executeDeferred method ...
>
> Thank you again !
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/6dd44781-3a7a-4281-b323-049c607acd1dn%40googlegroups.com.