Its this bit here:
    if isinstance(RGBname(str,unicode)):

At first glance it confused me because you are using upper case for a local 
variable RGBname, which is usually reserved for classes, so it seemed like you 
were making an instance of a class.
But really, the syntax of the isinstance call is wrong AND you have a typo in 
the variable:

    # type:
    RGBName vs RGBname

    # syntax error, should be changed to:
    if isinstance(RGBName, (str, unicode))

You could also avoid calling the cmds.ls two times to get the same results, by 
simply storing the results and then checking them, or returning early if the 
selection is not met

    sel = cmds.ls(sl=1,mat=1)
    if not sel:
        return

    # do something with sel




On May 19, 2013, at 9:00 AM, Daz wrote:

> Heya
> 
> Right so I've got a problem with the lines below. They are sort of taken out 
> of context so there is a bit more code around it(UI and other scripts etc etc 
> not related)
> 
> This is the code :
> 
> http://pastebin.com/kzwmF2dN
> 
> Now I got another version of it that works but it require me to copy the code 
> with slightly different variables over again for each control. So for 10 
> controllers I'm looking at 10 copies. I wanted to shorten it down to make it 
> a blueprint but I failed and I get this error:
> # UnboundLocalError: local variable 'RGBname' referenced before assignment # 
> 
> I can upload the code that works if that would be any help...
> 
> I have no idea at all whats wrong. I'm googling to find out what the unbound 
> thini means but I hit a wall :(
> 
> Any help would be great !
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to