On 01/06/2015 at 08:00, xxxxxxxx wrote:
I'll try to explain it, first, and if it will still be helpful, I can create a stripped down version of the
code tomorrow :-)
The Dirty-Count problem is sort of solved. Remaining:
- DescID() does not accept zero-ID DescLevels
- GetDParameter() is called multiple times for a single parameter
I guess the first is a limitation of the current implementation of the DescID class. There might have been
some reason to it, but if it won't break anything, I would greatly appreciate if this would be changed some day. To give just a little more detail, the following is the problem:
DescID(3, 0) == DescID(3) && DescID(3, 0 9) == DescID(3);
DescID(3, 0).GetDepth() == 1;
The latter appears when using the op[id] = value Syntax in Python, but I have yet to test it using
C4DAtom::GetParameter() from C++. If I use an ID that has multiple levels, like DescID(4005, 9, 2) ,
NodeData::GetDParameter() is not called once for the ID, but three times. And if during any of those
three calls, one does fail to retrieve a value, the others will never be invoked. What you in
GetDParameter() is
- DescID(4005)
- DescID(4005, 9)
- DescID(4005, 9, 2)
I want to use a DescID as an array subscript for the data in my plugin and return the data at that index.
The format I use currently is DescID(4005, row + 1, column + 1). The thing here is that before I get
passed the DescID that I expect, I get two "invalid" DescIDs. And I have to return a valid value for them,
otherwise I will never get the third, correct DescID in NodeData::GetDParameter().
Mainly this is a performance bottleneck and secondly, I want it to be an error to use a DescID that is
ill formed (so only DescID(4005) or DescID(4005, 9) should not succeed in retrieving a value, but
DescID(4005, 9, 2) should).
Thanks for your help,
-Niklas