PDA

View Full Version : adding a bool attribute to a node(API)


NateH
01-15-2008, 04:29 PM
Im writing a new node in a python scripted plugin, but I cant seem to find any way of adding a boolean attribute with a checkbox to the node. Can anyone post some example code for nodeInitializer to define a checkbox boolean node attribute (either C++ or python is fine, but python preffered)

BenBarker
01-15-2008, 07:11 PM
Sorry, I only have C++. I'll leave out the prototypes and the class declaration and stuff, this is the meat of it:


MFnNumericAttribute nAttr;
MStatus stat;
...
drawGuide = nAttr.create("drawGuide", "dGd", MFnNumericData::kBoolean , 0, &stat);
...
stat = addAttribute(drawGuide);

NateH
01-15-2008, 07:24 PM
Thanks, that did the trick.

CGTalk Moderation
01-15-2008, 07:24 PM
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.