Old thread, but I stumbled upon this recently.

Thanks to the layer.adjustments hint from Justin in this thread, I’m now
fetching overrides without stepping to a renderlayer (yay!):

def get_overrides(layer):
    overrides = {}
    c = 0
    for plug in cmds.listConnections(layer+'.adjustments',
destination=False, source=True, plugs=True):
        print 'Override found:', plug
        adjusted_values = []
        attr_values = cmds.getAttr(layer+'.adjustments[' + str(c) + ']')
        for attr_value in attr_values:
            unadjusted_value = attr_value[0]
            adjusted_value = attr_value[1]
            adjusted_values.append(adjusted_value)
        overrides[plug] = adjusted_values
        c += 1
    return overrides

overrides = get_overrides(layer='defaultRenderLayer')

Right now, this function returns any overrides for the given render layer.

Figured I’d share this.

Cheers,
Fredrik
​

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMEgRHkY3BkAfMC9%2B_xR53bVsOmMGsvcz7xOY4B40Nt1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to