this may or may not operate the same as the globals query, but worth a shot in your case.
import maya.app.renderSetup.model.renderSetup as renderSetup rs = renderSetup.instance() layer = rs.getVisibleRenderLayer() # you can do all sorts of stuff/queries on the layer now... layer.name() # name of the layer On Mon, Jan 14, 2019 at 2:41 AM Juan Cristóbal Quesada < juan.cristobal...@gmail.com> wrote: > Hi, > > Im trying to retrieve the current layer being rendered in a batch > render process within an interactive maya session. > > currently im trying to do it like this: > > string $current_render_layer = `editRenderLayerGlobals -q > -currentRenderLayer`; > > And im setting this code as a mel script in the render options tab, as > "pre" script for preRenderLayerMel. > > When i launch the batch render im getting among other things the frame > number being rendered but i keep getting > > the same render layer name when rendering two different ones. > > Im guessing this code is not actually querying the batch render process, > but the Maya GUI tab. > > So my question is: how can i retrieve the current render layer that is > being rendered? Maybe there is another Maya API command that im not > aware of, or maybe in the render options scripts there are already some > global variables built in and the render layer would be one of those... > > Thanks > > -- > 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/1f4ed9b7-151b-f4cf-9a55-2eeade4eb98e%40gmail.com > . > For more options, visit https://groups.google.com/d/optout. > -- Josh Carey -- 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/CAA_9eyoprin_qHDFSk62xTey6GDMf%2BGfEy8BJKwyvHyXh8Z7cA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.