ECToo / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

renderLayer.addAdjustments() problem #253

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem is simply a copy and paste error in the nodetypes.py file.  When 
adding adjustments to layers via the addAdjustments() function, no errors 
occur, it just doesn't work. i.e.

from pymel.core import *
newLayer = createRenderLayer(name="diffuse")
newLayer.addAdjustments("defaultResolution.width", noRecurse=True)

This returns:
#0 #
instead of:
// 1 //

This happens in maya 2011 and 2012, using both pymel version 1.0.0 and 1.0.3.

If I run:
editRenderLayerAdjustment("defaultResolution.width")
it works just fine.  My issue is the fact that I am trying to create new layers 
that I can't always predict their names, so I want to store them to a variable 
and be able to act on them from there.  If I use this work around, then I have 
to constantly set my render layer to the current layer, then set the layer 
adjustments from there.

So in the nodetypes.py it is defined as follows:

def addAdjustments(self, members, noRecurse):
        return cmds.editRenderLayerMembers( self, members, noRecurse=noRecurse )

def removeAdjustments(self, members ):
        return cmds.editRenderLayerMembers( self, members, remove=True )

instead of:

def addAdjustments(self, members, noRecurse):
        return cmds.editRenderLayerAdjustment( self, members, noRecurse=noRecurse )

def removeAdjustments(self, members ):
        return cmds.editRenderLayerAdjustment( self, members, remove=True )

Thanks for any help!
-Stu

Original issue reported on code.google.com by StuPSchw...@gmail.com on 15 Aug 2011 at 11:25

GoogleCodeExporter commented 9 years ago
fixed in latest on github - required a few more tweaks than the code given, but 
it works now. also added some tests

Original comment by elron...@gmail.com on 18 Aug 2011 at 11:36