yes, found that earlier after stripping it all down. thanks justing :)

--sven

On Fri, Apr 3, 2015 at 2:15 PM, Justin Israel <[email protected]>
wrote:

>
>  On Sat, 4 Apr 2015 7:32 AM Sven Pohle <[email protected]> wrote:
>
> hi,
>
> i'm just getting back to some maya api c++ and am hitting my head on the
> following:
>
> i have an input and output array of matrices. for the number of inputs i
> want the node to create the number of outputs. but my following code
> doesn't seem to work. i based it on some devkit nodes who do something
> similar with other data types as outputs. any help?
>
> // initialize
> aInputMatrices = mAttr.create("inputMatrices", "inputMatrices");
> mAttr.setStorable(false);
> mAttr.setConnectable(true);
> mAttr.setArray(true);
> mAttr.setHidden(true);
> mAttr.setUsesArrayDataBuilder(true);
> addAttribute(aInputMatrices);
>
> aOutputMatrices = mAttr.create("outputMatrices", "outputMatrices");
> mAttr.setStorable(false);
> mAttr.setWritable(false);
> mAttr.setStorable(false);
> mAttr.setArray(true);
> mAttr.setUsesArrayDataBuilder(true);
> addAttribute(aOutputMatrices);
> attributeAffects(aInputMatrices, aOutputMatrices);
>
> // compute method
> MStatus status;
>
>     MArrayDataHandle hInputMatrices = data.inputArrayValue(aInputMatrices,
> &status);
>     CHECK_MSTATUS_AND_RETURN_IT(status);
>
>     cout << "count: " << hInputMatrices.elementCount() << endl;
>
>     MArrayDataHandle hOutputMatrices =
> data.outputArrayValue(aOutputMatrices, &status);
>     CHECK_MSTATUS_AND_RETURN_IT(status);
>
>     MArrayDataBuilder builder(aOutputMatrices,
> hInputMatrices.elementCount(), &status);
>     CHECK_MSTATUS_AND_RETURN_IT(status);
>
>     for (unsigned int listIndex=0; hInputMatrices.elementCount();
> listIndex++) {
>
>  Is this a typo?
> Did you really want:
>
> for (unsigned int listIndex=0; i <  hInputMatrices.elementCount();
> listIndex++) {
>
>
>         cout << listIndex << endl;
>         MDataHandle outHandle = builder.addElement(listIndex);
>
>         hInputMatrices.jumpToElement(listIndex);
>         MMatrix curMat = hInputMatrices.inputValue(&status).asMatrix();
>
>         outHandle.setMMatrix(curMat);
>     }
>
>     status = hOutputMatrices.set(builder);
>     CHECK_MSTATUS_AND_RETURN_IT(status);
>
>     status = hOutputMatrices.setAllClean();
>     CHECK_MSTATUS_AND_RETURN_IT(status);
>
>     return status;
>
> --
> 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/172e8560-a221-4539-9ea5-57f1e235d4d1%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/172e8560-a221-4539-9ea5-57f1e235d4d1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Python Programming for Autodesk Maya" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/python_inside_maya/IB3BIrAQAaI/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0ZLOkGdzY9rUP%2B_XciEOq8z9XaLChcteEX_iHdHOuvgw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0ZLOkGdzY9rUP%2B_XciEOq8z9XaLChcteEX_iHdHOuvgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAG3%2BXockrpt-JFHsQsc4v9fqk3m9TVZH6jWAJiDwOS0USiw4YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to