View Full Version : MFnNumericAttribute setArray not giving multiple connections

04 April 2009, 12:05 AM
Hi all,

This should be really easy, but I can't figure it out. I have an array attribute for double values and all I want to do to connect multiple inputs to it - that's it. I made an array MFnTypedAttribute for a prior node and it works fine, I tried exactly the same technique for the MFnNumericAttribute but now the "Add New Item" button is gone and so I can't connect anymore than one input to the node - which kind of defeats the purpose of an array attribute...

Here's what's in the initialiser for that input:

nAttr = om.MFnNumericAttribute()
spSignalCurve_1DMixer.sc_1DM_inputs = nAttr.create("sc_1DM_inputs", "inS", om.MFnNumericData.kDouble, 0.0)

I've tried just changing the atrribute type to MFnTypedAttribute and keeping it's "type" to om.MFnNumericData.kDouble. This time the "Add New Item" button appears and works, but whenever I try to connect anything it greys out as if what I'm trying to connect isn't a double - but it is...

Any suggestions? I really can't work this out.

Robert Bateman
04 April 2009, 09:53 AM
nAttr.setWritable(1) ?

04 April 2009, 10:08 AM
No effect I'm afraid, I had setReadable(0) before and that did nothing either. What really confuses me is that Maya has an AETemplate specifically for creating the UI setup for a non-numeric multi attribute (AEnewNonNumericMulti.mel) but not one for numeric multi attributes, which is crazy!

I know I can create extra array attribute indices by querying their (as yet non-existent) contents, but I really wanted all this in the AETemplate. So, I'm currently in the process of copying and converting the guts of AEnewNonNumericMulti.mel into my own AETemplate, but this seems like a ridiculous hack for something so simple.

CGTalk Moderation
04 April 2009, 10:08 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.