Hi there,

I'm having some problems implementing the read/write ASCII methods for MPxData. 
 Writing it doesn't seem to be a problem, but reading the arglist within the 
readASCII method is proving to be rather confusing.

I'm trying to create an MDoubleArray using MArgList::get() or 
MArglist::asDoubleArray. but give me the same results.  However, when I just 
loop over the length of the array, and fill each value individually from the 
arglist, it works.


void ProxyData::readArrayFromASCII(MDoubleArray &array, const MArgList &args, 
unsigned &lastParsedElement){
    unsigned int len = (unsigned) args.asInt(lastParsedElement++);
    if (!len)
        return;

    // this works  
    array.setLength(len);
    for (int i = 0; i < len; ++i)
        args.get(lastParsedElement++, array[i]);

//    // I dont know why this doesnt work
//    MStatus stat;
//    stat = args.get(lastParsedElement, array);
//    CHECK_MSTATUS(stat);

}


>From the docs, it states the index argument should point to the int number of 
>items in the array, and the array should follow.  So in my ascii, I have 
>something like:   5 0.21 0.35 0.78 0.89 1.2

also, setting the size of the array first, doesn't seem to help.


Any ideas?
Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/121c22b8-a19d-49f2-8e05-38a3857fc6f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to