Originally posted by hohehohe2
[B]
f) So I did the second test. What if I create another node(D) and connect it to B?
g) I tested (A - B - C,D). The result was not satisfactory to me. Here I’m lost.
If you know where I’m first lost, please let me know.
Koichi [/B]
I guess you didn’t see my edit from above
Just saw your image. What is happening is that when you add D, B is already dirty, and D will pull out B’s output datablock (set to clean (0)) and there will be no need to re-calculate D as it has B’s current value and was added after B’s propagation flag was set.
Then, when you update A again, You set the dirty propagation in motion and it behaves as it should…
Hope that answers your question…
But anyway… I am starting to doubt if I am correct. But you have to understand that there’s a push-pull approach in Maya too. Push is, as you rightly say, where a upstream node (nearer the root) propagates it’s flag to the next downstream nodes and so forth.
The pull approach is when you request a value from a downstream node. The node will either give you its value straight away, or, if it’s dirty, pull the last clean value along the tree, evaluating it on the way as it goes through each node. Say if you were to ask D for its value. If D’s value is dirty, then it will go to its upstream node for the latest value… if that is also dirty that node will go to its parent and so on. If D’s parent is clean, its parent will simply give D the value and D will recalculate and give you its output value.
Hence the DAG paths will only have to be evaluated to the point where the next clean node is.
In an example say you have a transform matrix, a scale and a deform node attached to a geom node (in that order, with the matrix being root)
Now if you change the matrix, the change in the matrix’s values will have to be propagated right through to the geom node in oder for you to see the updated geometry correctly. If you change the deform node, the matrix and scale remain unaffected.
Say however you changed the matrix and didn’t update the viewport. Then the marix would be dirty and the mesh would be as it was before you changed the matrix node. If you then ask Maya to update the scene, maya will go to the geom and see that it has a dirty input. So the geom node will ask its parent (the deform) for its current value (as the geom only knows that its parent is dirty). The geom sees that its input is drity and requests an update from the scale node and so on.
If the same was done by simply changing the deform node, the geom node would see its input is dirty and request the deform node’s value. The deform node sees its input is clean (no upstream nodes have been changed) and then gives its output value without the need of recomputing it.
This saves time as only values that need recomputing are recomputed.
In your example number 2 you add D after B has been changed. As you see B is set to (0, 1) indicating its datablock (internally stored data) is clean, but C is still dirty and hasn’t been updated.
This means that D will get B’s most current and up-to-date value so no recalcualtion is needed on that node link. If you asked C for its out value, it would see that it needs to get a current value from B and request it.
Later, when you update A again, D becomes dirty because B has changed its value (1, 1) and therefore D will need to get B’s updated value.
God, I hope I am making sense… It’s starting to make my brain hurt now too 