Object Not Found?

Hi,

I have an UI with three attrFieldSliderGrp elements and others but they are not important for this question. If the user clicks on an iconTextRadioButton the slider should change. This is a part of my code:

CODE
#ask if 'rotateX' already exists
if mc.attrFieldSliderGrp('rotateX',q=True,exists=True) == 1:
    mc.deleteUI('rotateX',control=True)
mc.attrFieldSliderGrp('rotateX',min=min, max=max,at=joint+'.rx',p=self.controlLayoutName )

Maya enter this if request that shows that the attrFieldSliderGrp with the name 'rotateX' exists but when it should be deleted an error occurs "Object not found: rotateX".
It is so weird I don't understand what happens?

For any ideas I would be verry thankful.

There may be many rotateX named subnames just like in dag, so the names not uinique to deleteUI. So what you need to do is refeer to the full path name of the object

Thank you for this idea I tried it like this:

CODE
if mc.attrFieldSliderGrp('characterUI|characterTab|imageLayout|controlLayout|rotateX',q=True,exists=True) == 1:
    mc.deleteUI('characterUI|characterTab|imageLayout|controlLayout|rotateX',control=True)
mc.attrFieldSliderGrp('rotateX',min=min, max=max,at=joint+'.rx',p=self.controlLayoutName )

But the same error occures.

I tried it like this:

CODE
if mc.attrFieldSliderGrp('characterUI|characterTab|imageLayout|controlLayout|rotateX',q=True,exists=True) == 1:
    mc.deleteUI('characterUI|characterTab|imageLayout|controlLayout|rotateX',control=True)
mc.attrFieldSliderGrp('characterUI|characterTab|imageLayout|controlLayout|rotateX',min=min, max=max,at=joint+'.rx',p=self.controlLayoutName )

but then it do not enter the if request and I have three more slider instead of three changed slider.

Hi,

now I know what's gone wrong. I wrote

CODE
if mc.attrFieldSliderGrp('characterUI|characterTab|imageLayout|controlLayout|rotateX',q=True,exists=True) == 1:
       mc.deleteUI('characterUI|characterTab|imageLayout|controlLayout|rotateX',controle=True)
mc.attrFieldSliderGrp('rotateX',min=min, max=max,at=joint+'.rx',p='characterUI|characterTab|imageLayout|controlLayout')

but an attrFieldSliderGrp doesn't seem to be a controle. So this object was not found.

The right way to delete an attrFieldSliderGrp with deleteUI() is:
CODE
if mc.attrFieldSliderGrp('characterUI|characterTab|imageLayout|controlLayout|rotateX',q=True,exists=True) == 1:
    mc.deleteUI('characterUI|characterTab|imageLayout|controlLayout|rotateX')
mc.attrFieldSliderGrp('rotateX',min=min, max=max,at=joint+'.rx',p='characterUI|characterTab|imageLayout|controlLayout')

Maybe this can help other ^^

QUOTE(beast0815 @ 01/15/09, 05:43 PM) [snapback]298940[/snapback]
but an attrFieldSliderGrp doesn't seem to be a control. So this object was not found.

Yes its a layout that has all the controlls inside it, you can go inside it and delte the individual children if you wish.