PDA

View Full Version : API question: data attribute


davegreenwood
08-14-2009, 11:20 PM
hi all, I'm having a bit of trouble fully understanding how to pass 'heavy' data through connections... I'm trying to pass an MVectorArray as data not as a connectable array. Here's my code that does not work:

MDataHandle inpointsData = data.inputValue( inpoints, &returnStatus );
McheckErr(returnStatus, "Error getting inpoints data handle\n");

//- Read the input value from the handle.
MObject VectorArrayData = inpointsData.data();
MFnVectorArrayData dataFn(VectorArrayData);
MVectorArray particles = dataFn.array(&returnStatus);
McheckErr(returnStatus, "Error creating inPoints data\n");


My code compiles fine, but during debug on the particles variable line, the debugger jumps to the end of my compute... I don't get an error in maya though.
In the initialise I used :

the_node::inpoints = typedFn.create( "inpoints", "inp", MFnData::kVectorArray, &returnStatus );
McheckErr(returnStatus, "ERROR creating input attribute\n");

If this is wrong I probably need help with setting the same data as an output attribute too:)

Many thanks for any help.
Dave.

davegreenwood
08-15-2009, 10:52 AM
Got it, just a little typo when I set readable etc.

It's amazing what a nights sleep and a walk on the beach with your dog can do for spotting errors...

Dave.

CGTalk Moderation
08-15-2009, 10:52 AM
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.