Hey Justin

Yea I was trying to build a callable out of 2 strings so that I can input 
different modules with different functions. Atm for that test there really was 
no more code than that. For the moment I dropped the idea of making it shorter 
until I understand partial more. Its proving bit more difficult than I want it 
too and I think I will use it a lot in my scripts from now on so I need to 
study it more.

In any case could you possible show me an example how I would write this in 
partial?

litinv = 
cmds.checkBox("Invisible",onc='box_on(litinv,"invisible",lightsAll,lightsSel)',ofc='box_off(litinv,"invisible",lightsAll,lightsSel)')

My attempts failed badly.
litDS = cmds.checkBox('Double Side')
litDS_cbk = partial(light_editor.box_on, litDS, "doubleSided", lightsAll, 
lightsSel)
cmds.checkBox(litDS,e=True,cc=litDS_cbk)  

Also I just found one issue with my script, pretty strange one as that did not 
happen in past. In any case with the slider if I have 5 lights in my scene. I 
want to edit their intensity and so on it works just fine. However the second I 
add 1 extra light. The extra light is not affected any more. Its as if he don't 
re-evaluate the scene and I cant control it- I can control old lights but not 
the new one. Can you have a look at this code see if you spot obvious issue?

I'm using Vray lights and its pretty random. Errors I get :
# Error: 'NoneType' object is not iterable
# Traceback (most recent call last):
#   File "D:/Scripts/maya/scripts/Daz_Toolkit/Fin/Modules\light_editor.py", 
line 23, in lit_value
#     for shapes in transform:
# TypeError: 'NoneType' object is not iterable # 
# Error: setAttr: Not enough data was provided. The last 0 items will be 
skipped.

# Traceback (most recent call last):
#   File "D:/Scripts/maya/scripts/Daz_Toolkit/Fin/Modules\light_editor.py", 
line 14, in lit_value
#     cmds.setAttr(shapes+'.'+attribute,value)
# RuntimeError: setAttr: Not enough data was provided. The last 0 items will be 
skipped. # 
http://pastebin.com/8N9wgWQR
Thanks, bye.

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