Right, though I'm still getting nothing.
I've got layer overrides enabled for multiple objects,
cmds.editRenderLayerAdjustment will return overrides, I can see
connections between the overridden attributes and the adj.plug
attribute of the render layer, but still nothing from
'renderLayer.attributeOverrideScript'.



On Sep 4, 11:14 am, damon shelton <[email protected]> wrote:
> Jesse,
> the attribute override script will return None if there are no overrides
> turned on or off
> **so if all overrides are set to Scene(default)
>
> once you turn one of the attributes on, it adds that attribute=0 or
> attribute =1 to the attributeOverrideScript attr which is a string attribute
>
> On Fri, Sep 3, 2010 at 10:31 PM, Jesse Capper <[email protected]>wrote:
>
>
>
> > Damon, I've never been able to get the attributeOverrideScript
> > attribute to return anything but a None type :/
>
> > Dave, check out the renderLayer attribute 'adjustments'.  It's a
> > compound attribute with two child (is that the right word?) attrs
> > 'plug' and 'value':
>
> >    'plug' will return the connected attribute's current value
> >    'value' will return the attribute's render layer override value
>
> > You can get all render layer overrides and their adjustment index by
> > doing a listConnections on renderLayer.adjustments.  Someone might be
> > able to tell you a cleaner way to do this, but it works for me (this
> > is what I think renderLayer.attributeOverrideScript should do, but
> > that just returns None for me)
>
> > ###
> > rlayer = 'layer1'
> > rlOvrs = cmds.listConnections(rlayer + '.adjustments', p=True, c=True)
> > for i in range(0, len(rlOvrs), 2):
> >    rlConn = rlOvrs[i]  # returns 'layer1.adjustments[#].plug'
> >    ovrAttr = rlOvrs[i+1]
> >    ovrIndex = rlConn.split(']')[0]
> >    ovrIndex = ovrIndex.split('[')[-1]
>
> >    ovrVal = cmds.getAttr(rlayer + '.adjustments[%s].value' %
> > ovrIndex)
>
> >    print '%s = %s' % (ovrAttr, ovrVal)
>
> > On Sep 3, 10:48 am, Dave Nunez <[email protected]> wrote:
> > > Hey guys, have been trying to query layer overrides attrs and I can't
> > > find where the attribute overrides are.
>
> > > from the docs,
>
> > > # Query the current layer for the list of adjustments
> > > cmds.editRenderLayerAdjustment( query=True, alg=True )
> > > # castsShadows         nurbsSphereShape1.castsShadows
> > > #                      pPlaneShape1.castsShadows
> > > #                      pSphereShape1.castsShadows
> > > # instObjGroups        pCylinderShape1.instObjGroups[0]
> > > # motionBlurByFrame    defaultRenderGlobals.motionBlurByFrame
> > > # receiveShadows       nurbsSphereShape1.receiveShadows
> > > #                      pPlaneShape1.receiveShadows
> > > #                      pSphereShape1.receiveShadows
> > > # shadingSamples       defaultRenderQuality.shadingSamples
>
> > > so from the example above, how would I get the
> > > pPlaneShape1.castsShadows attr for that render layer.
>
> > > I could switch layers using the gui and get the attrs that way but
> > > that would take a long time.
>
> > > Cheers, -d
>
> > > --
> > > When things get too complicated, it sometimes makes sense to stop and
> > > wonder: Have I asked the right question?
> > > -Enrico Bombieri
>
> > --
> >http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to