Hey Justin

Thanks so much for that ! All works perfectly and I managed to get the rest of 
my code working with it. Also thanks very much for the pointers! Will write my 
upper/lower cases this way from now on. 

Also I noticed that in order for slider to work I need those 3 lines
#define
litIntensityMultiplier = cmds.floatSliderGrp(field=True, maxValue=1000, pre=2, 
cw2=(60,20))
#link to module
cbk = partial(TMPcore.lit_value, litIntensityMultiplier, "intensityMult", 
lightsAll, lightsSel)
#link slider to module? 
cmds.floatSliderGrp(litIntensityMultiplier, e=True, cc=cbk, dc=cbk) 

Is there a way to shorten it to 1 by any chance? I will have quite few sliders 
and this simply triples the amount of code I need to manage.I tried writing and 
function but partial threw me an error :)

def partial_callback(float_name,module,function,attributes,lightsAll,lightsSel):
    cbk = partial(module+'.'+function,float_name,attributes,lightsAll,lightsSel)
    cmds.floatSliderGrp(float_name,e=True,cc=cbk,dc=cbk)

litIntensityMultiplier = cmds.floatSliderGrp(field=True, maxValue=1000, pre=2, 
cw2=(60,20))

partial_callback(litIntensityMultiplier,'TMP.core,"lit_value","intensityMult",lightsAll,lightsSel)

Further more I'm not sure if function would be good. As if I were to control 
100 lights with it there might be a lot of loops and lag at the end. So maybe 
having 3 lines of code is better.

-- 
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