You don't need to addAttribute on attributes added to a compound. Once you 
add the compound, it will add the children. Attributes are also storable 
and readable by default so you don't need to explicitly set them so. 
Attributes are also not keyable by default.

I'm not sure if it makes sense to have a matrix attribute be keyable.

It could also be the short name is already taken by some other attribute, 
which is why I usually just use the long name as the short name.

On Friday, June 25, 2021 at 1:31:34 PM UTC-7 todd.wi...@gmail.com wrote:

> so tracked it to the compound, its failing to add it..thanks for the 
> pointer Marcus, not to track down what is causing the fail
>
> On Fri, Jun 25, 2021 at 11:22 AM Todd Widup <todd....@gmail.com> wrote:
>
>> caught that last night and fixed it, still dont get the compound
>>
>> On Thu, Jun 24, 2021 at 10:41 PM Marcus Ottosson <konstr...@gmail.com> 
>> wrote:
>>
>>> Looks like poseDriver is added twice.
>>>
>>>     cmpAttr.addChild(poseDriver);
>>>     cmpAttr.addChild(poseDriver);
>>>
>>> Don’t forget to check the status after each call. It’ll tell you when 
>>> any of them fails, which in this case is likely the second call to adding 
>>> poseDriver.
>>>
>>> On Fri, 25 Jun 2021 at 05:53, Todd Widup <todd....@gmail.com> wrote:
>>>
>>>> MStatus ArsenalPoseManager2::initialize()
>>>> {
>>>> MStatus status;
>>>> MFnNumericAttribute nAttr;
>>>> MFnMatrixAttribute mAttr;
>>>> MFnMessageAttribute meAttr;
>>>> MFnTypedAttribute tAttr;
>>>> MFnCompoundAttribute cmpAttr;
>>>>
>>>> dataFile = tAttr.create("PoseFile", "psf", MFnData::kString);
>>>> tAttr.setInternal(true);
>>>> tAttr.setUsedAsFilename(true);
>>>> tAttr.setStorable(true);
>>>> tAttr.setKeyable(false);
>>>> addAttribute(dataFile);
>>>>
>>>> poseDriver = meAttr.create("poseDriver", "pd");
>>>> meAttr.setArray(false);
>>>> meAttr.setStorable(true);
>>>> meAttr.setKeyable(false);
>>>> addAttribute(poseDriver);
>>>>
>>>> poseDriverValue = nAttr.create("poseAttribute", "pa", 
>>>> MFnNumericData::kFloat);
>>>> nAttr.setArray(false);
>>>> nAttr.setStorable(true);
>>>> nAttr.setKeyable(true);
>>>> addAttribute(poseDriverValue);
>>>>
>>>> poseName = tAttr.create("poseName", "pn", MFnData::kString);
>>>> tAttr.setArray(false);
>>>> tAttr.setStorable(true);
>>>> tAttr.setKeyable(false);
>>>> addAttribute(poseName);
>>>>
>>>> poseNode = meAttr.create("poseNode", "pnd");
>>>> meAttr.setArray(false);
>>>> meAttr.setStorable(true);
>>>> meAttr.setKeyable(false);
>>>> addAttribute(poseNode);
>>>>
>>>> poseMatrix = mAttr.create("poseMatrix", "pm", 
>>>> MFnMatrixAttribute::kDouble);
>>>> mAttr.setArray(false);
>>>> mAttr.setStorable(true);
>>>> mAttr.setKeyable(true);
>>>> addAttribute(poseMatrix);
>>>>
>>>> poseSets = cmpAttr.create("poseSet", "ps");
>>>> cmpAttr.setArray(true);
>>>> cmpAttr.addChild(poseNode);
>>>> cmpAttr.addChild(poseMatrix);
>>>> cmpAttr.setReadable(true);
>>>> cmpAttr.setUsesArrayDataBuilder(false);
>>>> addAttribute(poseSets);
>>>>
>>>> poseData = cmpAttr.create("poseData", "pd");
>>>> cmpAttr.setArray(true);
>>>> cmpAttr.addChild(poseDriver);
>>>> cmpAttr.addChild(poseDriver);
>>>> cmpAttr.addChild(poseName);
>>>> cmpAttr.addChild(poseSets);
>>>> cmpAttr.setReadable(true);
>>>> cmpAttr.setUsesArrayDataBuilder(false);
>>>> addAttribute(poseData);
>>>>
>>>> return MS::kSuccess;
>>>> }
>>>>
>>>>
>>>> that was working on the build I did the other day, but all of a sudden 
>>>> its not adding the compound attribute, no error or anything just not 
>>>> there.  Any thoughts as to why?
>>>>
>>>>
>>>> -- 
>>>> Todd Widup
>>>> Creature TD / Technical Artist
>>>> todd....@gmail.com
>>>>
>>>> -- 
>>>> 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 python_inside_m...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/CABBPk36ThRdY1qiR_6JU4JY3%3DH--LVqqtc9ZYHAfu6X15iH%2BCA%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/CABBPk36ThRdY1qiR_6JU4JY3%3DH--LVqqtc9ZYHAfu6X15iH%2BCA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>>> 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 python_inside_m...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCaxoO9eCP6czw9UYD32BFc8V35zLrJLR%3DFBBUzxvKpYg%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCaxoO9eCP6czw9UYD32BFc8V35zLrJLR%3DFBBUzxvKpYg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Todd Widup
>> Creature TD / Technical Artist
>> todd....@gmail.com
>>
>
>
> -- 
> Todd Widup
> Creature TD / Technical Artist
> todd....@gmail.com
>

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/cd3f87a4-81f7-4673-9b61-ba0b1decb215n%40googlegroups.com.

Reply via email to