inSurface attr on node

49 views
Skip to first unread message

33th...@gmail.com

unread,
Feb 21, 2015, 1:39:27 PM2/21/15
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

33th...@gmail.com

unread,
Feb 21, 2015, 2:44:07 PM2/21/15
to python_in...@googlegroups.com, 33th...@gmail.com
oh, I get it. you just hide the attribute. lol

Kev
Reply all
Reply to author
Forward
0 new messages