hi
need real expert advice here (looking at you, mr. J:)
i've got this piece of code in C, which is supposed to be modifying colorPerVertex node. i am setting a bunch of plugs, which are deep in hierarchy (example plug path is in the comments of code). i'm trying to squeeze more performance here, pre-caching as much info as possible:
http://pastebin.com/AqZkA2jQ
i've got attribute handles pre-cached earlier, as well as face list for each vertex (i'm storing this as a single array, using another array for indexing)
in short, outer loop runs from "firstVert" to "lastVert" (i'm specifying this as range, which can be as big as 0..numVerts and as small as vertN..vertN - updating just one vertex).
inner loop runs through all vertex faces, and sets vertexFaceColorRGB values.
you can nevermind the rest of the algorithm, i've got it cached pretty much to the point where there's one pointer increase per vertex and one pointer increase per vertex face. the biggest performance hit is "selectAncestorLogicalIndex", and i wanted to know, if it's the fastes way to access a plug like this? if not, what would be the correct way to access many plugs in the form of:
polyColorPerVertex1.colorPerVertex.vertexColor[52].vertexFaceColor[52].vertexFaceColorRGB.vertexFaceColorR
one more note would be - mostly this algorithm will modify existing plugs, as number of vertices and face vertices will remain the same, so creation of new plugs isn't the cause here either.
PS: pasted slightly buggy code, 25th line should actually be with " * " :
for (int o=faceIndexOffsetFrom;o<faceIndexOffsetTo;o++,face++)