Apparently shifting the sAttr.addField()'s to after the addAttribute() does 
the trick...

On Saturday, May 3, 2014 7:15:59 AM UTC+10, MonsterAdurm wrote:
>
> 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
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/c2735c17-3faf-4732-8285-66a5e1e98cb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to