C++ array attr question

18 views
Skip to first unread message

Todd Widup

unread,
Feb 10, 2020, 8:19:37 PM2/10/20
to python_in...@googlegroups.com
I am trying to add an array attr to my node,  thats easy...but I am having an issue when I make that attr a vector

 aInValueX2 = nAttr.create("inX2", "ix2", MFnNumericData::kFloat);
nAttr.setKeyable(true);
nAttr.setHidden(false);
nAttr.setWritable(true);
nAttr.setChannelBox(true);

aInValueY2 = nAttr.create("inY2", "iy2", MFnNumericData::kFloat);
nAttr.setKeyable(true);
nAttr.setHidden(false);
nAttr.setWritable(true);
nAttr.setChannelBox(true);

aInValueZ2 = nAttr.create("inZ2", "i2z", MFnNumericData::kFloat);
nAttr.setKeyable(true);
nAttr.setHidden(false);
nAttr.setWritable(true);
nAttr.setChannelBox(true);

aInValue2 = nAttr.create("in2", "i2", aInValueX2, aInValueY2, aInValueZ2, &status);
nAttr.setArray(true);
nAttr.setKeyable(true);
nAttr.setHidden(false);
nAttr.setWritable(true);
nAttr.setChannelBox(true);
addAttribute(aInValue);

This is not adding the attribute in the node at all.  I can add each channel as an array, but when I make them the child of an attr and that attr an array it does nothing..it does compile fine, just no in2 attr in Maya...any suggestions?


--
Todd Widup
Creature TD / Technical Artist
todd....@gmail.com

Todd Widup

unread,
Feb 11, 2020, 12:35:49 AM2/11/20
to python_in...@googlegroups.com
well..got it working

Ravi Jagannadhan

unread,
Feb 11, 2020, 12:36:30 AM2/11/20
to python_in...@googlegroups.com
What was the issue?

“There are no dumb questions” - Carl Sagan.

On Feb 10, 2020, at 21:35, Todd Widup <todd....@gmail.com> wrote:


--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk34TwJ02%3Don95KtNac6JBiQhCB_QY6hjRW9JgKyePdh-nw%40mail.gmail.com.

Todd Widup

unread,
Feb 11, 2020, 12:47:46 AM2/11/20
to python_in...@googlegroups.com
not sure...when I had tried it previously it didnt work...this time it did...my example had a small typo and I fixed it

Reply all
Reply to author
Forward
0 new messages