Hi, I'l trying to create render layers and then select objects in them
to connect different shaders. The problem is that in the same scipt I
can't select the render layers because the render layer window is not
refreshed.

def f1():
    mc.select('head_HR',r=1)
    sel = mc.ls(sl=1)
    for l in range(1,9):
        nameRL=('RL_%d' %l)
        mc.createRenderLayer (sel, name=nameRL, noRecurse=1)

def f2():
    for i in range(1,9):
        nameRL = 'RL_%d' %i
        mel.eval('layerEditorLayerButtonSelect 0 ' + nameRL)
        mc.select('head_HR', r=1)
        if i==5:
            mc.sets(forceElement='dgs_material1SG' )
        else:
            mc.sets(forceElement='importedMaterial_blackhole_s hdSG' )
        mc.select(clear=1)

f1()
f2()

In f2() I can't reach render layers created in f1(). If I launch f1(),
and when finished then f2() it's ok.
Is there a way to force refresh of render layer window, with a command
or with the API?

Thanks,
Philippe.
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to