PDA

View Full Version : API: MArrayDataBuilder confusion


tredeger
10-11-2006, 08: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 );
CHECK_MSTATUS(returnStatus);

Then I need to create a builder for that handle:

MArrayDataBuilder evalTreeArrayBuilder = evalTreeArrayData.builder();
CHECK_MSTATUS(returnStatus);

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++) {
// EVAL TREE
MDataHandle evalTreeElementHandle = evalTreeArrayBuilder.addElement(j, &returnStatus);
CHECK_MSTATUS( returnStatus );
unsigned int outEvalTree = evalTreeElementHandle.asInt();
outEvalTree = evalTreeArray[j];

evalTreeElementHandle.set ( outEvalTree);
evalTreeElementHandle.setClean();
}

// set the attributes clean
evalTreeArrayData.set(evalTreeArrayBuilder);
evalTreeArrayData.setAllClean();

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.

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

.set((int) value);

did it. I'm embarrassed now.

CGTalk Moderation
10-11-2006, 08: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.