You have a typo between the two ways you format the string :

tmpname = "%smaster_crtl" % sel.namespace()
tmp = "%smaster_ctrl" % selects[0].namespace()

crtl vs ctrl

On Wed, 11 Mar 2015 7:02 PM Panupat Chongstitwattana <panup...@gmail.com>
wrote:

> Hi.
>
> I ran into another problem. objExists is returning different result when I
> put it in a for loop.
>
> selects = pmc.selected()
>
> for sel in selects:
>     tmpname = "%smaster_crtl" % sel.namespace()
>     print tmpname
>     print pmc.objExists(tmpname)
> #
> SC05A_0110_ECh_LoopAnim_v002:SC05A_0020_Extra_Cheer_LoopAnim_v001:exMaleHair001:master_ctrl
> # False
>
> tmp = "%smaster_ctrl" % selects[0].namespace()
> print tmp
> print pmc.objExists(tmp)
> #
> SC05A_0110_ECh_LoopAnim_v002:SC05A_0020_Extra_Cheer_LoopAnim_v001:exMaleHair001:master_ctrl
> # True
>
> What could be the cause of this?
>
> --
> 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/53b82fa7-91de-4eee-b8f1-03d5c6c668e5%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/53b82fa7-91de-4eee-b8f1-03d5c6c668e5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA2HM_Xyw%3Dme4YZne6NkcfJz%3DaF2RyaDrEDqwe4XyrpZAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to