> I got the issue, where if I select only 1 pCube#, and it returns nothing,
> though it seems to be working if I only select 1 Root Node
> While that is one of the issue, can someone kindly guide me if I am
> writing my code correctly?

I could see why this might happen. The first thing you do is grab the
current selection ("sel"). So if you have a 'pCube#' selection, then that
is the item in the list. Then you call cmds.ls(sel, type='stkLevel') on
that list. Are you expecting that to somehow resolve the root node for you?
Because after you check if its the only item in the list, you hit the
"else" branch and return stkLevel_node[0]. What does that actually return?
What is in that list?

> I asked this because first I am still not that great of a scripter and I
> feel that I am forcing my way through while following those conditions

Well I do see that you are not returning from your function after you print
warnings. Like, if there is nothing selection, you still run the rest of
your function.

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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to