Ah thank you. Such a silly mistake :( Is there any draw back if I don't check objExists but instead go for this?
try: PyNode(string) except: print "something" On Wednesday, March 11, 2015 at 2:02:06 PM UTC+7, Justin Israel wrote: > > 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 <panu...@gmail.com > <javascript:>> 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/8f3151a3-7a9b-4fdc-8721-f8cb60d35c10%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.