Thanks Josh, but that doesnt work either, its querying the RenderSetup
Widget Configuration.
What im asking is to be notified of the render layer name when it is
actually being rendered in batch process, therefore, independent from the
main thread and GUI.
This is kind of a very specific geeky question.
Im having a bad time looking for answers as there apparently isnt a proper
documentation about the mel scripts options in the render options tabs.

Just to explain a little bit more: the reason why it must be done via a
preRenderLayerMel script in the render options tabs is because those are
callbacks called by the rendering process at the moment of effectively
proceeding the render (be it the layer, in pre/post, each frame in pre/post
or the whole rendering process). I dont want to query the RenderSetup or
the Legacy Render Layer system is this is the Configuration you have just
set up BEFORE  starting to render....

The render layer name (among other layer parameters) must be able to be
queried from the render options tabs pre/post RenderLayer Mel since this is
a script that is called when starting/finishing to process each render
layer! It just must be available somehow.

Either there is a huge lack of documentation about the render options, or
it is explained in a very hidden spot. Im guessing the first one!

El lun., 14 ene. 2019 a las 20:47, Josh Carey (<vfxcrea...@gmail.com>)
escribió:

> 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
> <https://groups.google.com/d/msgid/python_inside_maya/CAA_9eyoprin_qHDFSk62xTey6GDMf%2BGfEy8BJKwyvHyXh8Z7cA%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/CANOg8wWypYt5yGCJ-dyiRx5euZPuTiGS1x1%3DA75j%3DBJ35b56pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to