Existential questions on attribute dirtying

60 views
Skip to first unread message

justin hidair

unread,
Mar 12, 2018, 10:37:38 PM3/12/18
to Python Programming for Autodesk Maya


every now and then when changing , disconnecting , connecting an attribute , MPxNode::setDependentsDirty() is called( easily observable)  ,
if there's no connected output no compute is called() . However ,

 1) What happens if a user change two different attributes at the same time ? ( e.g. move two transforms dag nodes ) ,
do Maya automatically order the thing and it seems to happen "at the same time " or does it open a black hole ?

 2) How would I change two different  attributes on a node with its output connected , without calling compute() two times ?

justin hidair

unread,
Mar 12, 2018, 10:43:29 PM3/12/18
to Python Programming for Autodesk Maya
By the way anyone here uses Visual Studio Code ? I love that editor so much man

Justin Israel

unread,
Mar 13, 2018, 6:20:36 AM3/13/18
to python_in...@googlegroups.com
I don't write Maya plugins so take my reply with a grain of salt. I just thought to engage on a high level.  
Are these questions maybe trying to reach beyond the expected concern of the Maya Mpxnode plugin architecture? Does it actually matter how Maya handles the effect of a user simultaneously changing multiple attributes? If the stated goal of an mpxnode is to not look at any external state and only handle the data blocks you are given, shouldn't that result in correct behavior? At one point in time you might handle the state of one attribute change, followed by another compute when the second attribute changes. But maybe in some other circumstance Maya may end up being able to concatenate the changes before triggering computes. If you adhere to only evaluating your local data then you are always correct in either circumstance. The trade off, as you are fully aware, would be potentially more computes in a smaller time frame than you would want. 
So that being said, maybe other experienced plugin writers have some tricks to offer, to try and buffer the compute operations. But to me it just seems like the intent is to stick to the bounds of the plugin interface and compute when you are called. 


--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1d3df591-1fd9-401e-a8a8-f604ab55cf04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cedric Bazillou

unread,
Mar 13, 2018, 3:55:55 PM3/13/18
to Python Programming for Autodesk Maya
Normally, should not concern yourself with that.
when you layout your node you have to define  the relationship between inputs  and output.

so if you check that your output plug needs to be refreshed one of the driver will trigger the computation and then your output will be written and mark dirty.
the other drivers wont have any effect at this point... ( from memory as i dont use maya that much at work anymore)

justin hidair

unread,
Mar 13, 2018, 9:21:01 PM3/13/18
to python_in...@googlegroups.com

Thank you guys , yes I guess if one has to ask these questions then there is a serious design issue on this one’s node .

 

Sent from Mail for Windows 10

--

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_m...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages