I usually do it like this (sort of):

current_layer = cmds.editRenderLayerGlobals( query=True,
currentRenderLayer=True ) # Register the currently active render layer
cmds.editRenderLayerGlobals(currentRenderLayer='renderLayerA') # step
to renderLayerA
cmds.setAttr('vraySettings.primaryEngine', 0) # Set some value
cmds.editRenderLayerAdjustment('vraySettings.primaryEngine') # Create
the override
...
...
...
cmds.editRenderLayerGlobals(currentRenderLayer=current_layer) # Step
back to the renderlayer you had active before running the script

​

On Wed, Oct 29, 2014 at 10:52 PM, Justin Israel <justinisr...@gmail.com>
wrote:

> Sorry no one has replied to this. I will take a stab. Do you mean how to
> change RenderLayer Member Overrides, programmatically?
>
> Like this?
>
> cmds.setAttr("layer1.attributeOverrideScript", "primaryVisibility=", 
> type="string")
>
> cmds.setAttr("layer1.attributeOverrideScript", "primaryVisibility=0", 
> type="string")
>
> cmds.setAttr("layer1.attributeOverrideScript", "primaryVisibility=1", 
> type="string")
>
> ​
>
> On Tue, Oct 28, 2014 at 10:41 PM, <jacobgo...@gmail.com> wrote:
>
>> Hi all
>>
>> Does anyone know any scripting to change a layer override attribute value
>> without actually having that render Layer active?
>>
>> So active Render Layer is A and I am going to set an objects primary ray
>> off/on for Render Layer B.
>>
>> Thanks
>>
>> Jacob
>>
>> --
>> 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 python_inside_maya+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/44926a6c-88b8-4b0a-a7b0-630281b1d91b%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0zfs42JLKV2NwXFPUvgdfK_J8%3D31YjhFgabzyJcYNieg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0zfs42JLKV2NwXFPUvgdfK_J8%3D31YjhFgabzyJcYNieg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to