33th...@gmail.com
unread,Feb 21, 2015, 1:39:27 PM2/21/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python_in...@googlegroups.com
Hey Guys,
I'm pretty sure I'm either adding this attribute wrong, or missing something else. I keep getting an Error when trying to add a kNurbsSurface attribute to a node using MFnTypedAttribute (maybe that's not the correct Fn to use?).
The error pops up when the attribute editor is open. The error I get is:
Cannot use data of type no type in a scalar operation.
Start of trace: (file: C:/Program Files/Autodesk/mentalrayForMaya2015/scripts/AETemplates/AEmentalrayNewMessage.mel, line 25).
AEmentalrayReplaceMessage (command window: line 1).
AEbuildControls (file: C:/Program Files/Autodesk/Maya2015/scripts/others/updateAE.mel, line 530).
updateAE (file: C:/Program Files/Autodesk/Maya2015/scripts/others/showEditor.mel, line 4402).
autoUpdateAttrEd (command window: line 1).
which doesn't mean a whole lot to me unfortunately. The code looks like this:
fnTypeAttr = om.MFnTypedAttribute()
op.inSurface = fnTypeAttr.create("inSurface", "inSurf", om.MFnData.kNurbsSurface )
fnTypeAttr.setReadable(1)
fnTypeAttr.setWritable(1)
fnTypeAttr.setStorable(0)
fnTypeAttr.setKeyable(0)
op.addAttribute(op.inSurface)
So how best to add a "inSurface" attribute, if I'm doing it wrong, or how do I fix this error if I am adding the attribute correctly?
Thanks!
Kev