|
I’m rewriting an old node of mine. I would like it to do the same thing it did but to an array of objects.
My question is how would you gurus structure this node? The original takes in a matrix and a surface. It has offset translation and rotation vector attributes. It spits out a new position and an arbitrary value in a separate attribute.
Rather than create multiple nodes of the same type, I would like to update this node so that it takes in an array of matrices, contains an array of trans/rot vec attrs. and returns 2 arrays, one for the position values with another array for the arbitrary values.
Initially I planned of converting the original attributes to arrays and simply outputing another array. I figured I could get the elemnt count of the matrices and iterate a loop the same number of times and spit out another array of the same length. The questions I have with this technique are: what if I have 4 incoming connections with 4 outgoing connections. If in the process of working your maya scene you delete one of the incoming connections, what happens to the mismatched number of outgoing connections? Do they adhere to their logical or physical index? Anothe question has to do with the efficiency of this approach. What if I have 20 incoming connections and only one of them needs to be updated. Wouln’t be a a waste of resources to go through 20 iterations when only one of the incoming connections needs updating?
So I thought of this other approach. What if I created an array of compound attributes which contained all the original attrs as children. So in a sense, I would be instancing the original node with each incoming connection. And the number of output attrs would not be an issue because they would only exist if an incoming connection was first created.
Let me know what you guys think!!!
|