MFnEnumAttribute list empty c++

29 views
Skip to first unread message

MonsterAdurm

unread,
May 2, 2014, 5:15:59 PM5/2/14
to python_in...@googlegroups.com
Hi guys,
This is c++ related and my first post so apologies if im breaking conventional rules for posting here..

 ive got this enum attribute that ive created in the same manner as dozens of other attributes without problem for my custom locator code, which otherwise appears to be working fine..

// possible locator shapes
MString shapeTypes[10] = { "diamond", "sphere", "star", "prism", "cube", "disc", "triangle",
"circle", "square", "pentagram" };

.....

MFnEnumAttribute eAttr, shapeAttr;

......


for (int s = 0; s < 10; s++)
{
shapeAttr.addField(shapeTypes[s], s);
}
shapeEnum = shapeAttr.create("shape", "shape", 5, &status);
CHECK_MSTATUS_AND_RETURN_IT(status);

.....

addAttribute(shapeEnum);

....

It appears to set the default property properly which I can access with the getAttr etc, but in the AE it appears blank ( no options for selecting ), and attempting to setAttr on the attribute gives this error msg:

// Error: line 2: setAttr: Cannot set the attribute 'acLocator1.shape' below its minimum value of 1000. // 

Anyone ever had same issue? I assume im missing something pretty basic, and my other enums are working fine so im thinking maybe its not to do with the code specifically, but im a bit lost on this one so any direction would be fantastic..

Cheers

MonsterAdurm

unread,
May 3, 2014, 1:31:30 AM5/3/14
to python_in...@googlegroups.com
Apparently shifting the sAttr.addField()'s to after the addAttribute() does the trick...
Reply all
Reply to author
Forward
0 new messages