LC #42 Pipers Alley

View Full Version : API: MArrayDataBuilder confusion

10-11-2006, 07:01 PM
I'm having some trouble getting my compute function working properly with the MArrayDataBuilder.

Ok, my output attribute is an array. So I get a handle to it with:

MArrayDataHandle evalTreeArrayData = data.outputArrayValue( evalTree, &returnStatus );

Then I need to create a builder for that handle:

MArrayDataBuilder evalTreeArrayBuilder = evalTreeArrayData.builder();

I have an array (evalTreeArray) that stores the calculated values I want in my output array. But I can't figure out how to get those values into the builder. This is not working:

for (unsigned int j = 0; j < numPeers; j++) {
MDataHandle evalTreeElementHandle = evalTreeArrayBuilder.addElement(j, &returnStatus);
CHECK_MSTATUS( returnStatus );
unsigned int outEvalTree = evalTreeElementHandle.asInt();
outEvalTree = evalTreeArray[j];

evalTreeElementHandle.set ( outEvalTree);

// set the attributes clean

When I try to compile, I'm getting a notice that the overloaded .set method is ambiguous, but I can't seem to get the syntax right which will disambiguate the fella.

Thanks in advance for any help. I'm stumped.

10-11-2006, 07:12 PM
uh, nevermind. I'm dumb.

.set((int) value);

did it. I'm embarrassed now.

CGTalk Moderation
10-11-2006, 07:12 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.