Announcement

Collapse
No announcement yet.

Query batch camera rendering

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Query batch camera rendering

    Hi,

    Maybe this is not a specific V-Ray question, but it is for Maya and rendering with V-Ray, so I'm not sure where else to ask?

    Is there a way to query the exact current render camera during a batch render?
    Maya 2020/2022
    Win 10x64
    Vray 5

  • #2
    You can check out vrayBatchRender() in vrayRegisterRenderer.mel if you want this badly. $batchCamera can be used to get the current camera. However currently it's not global. I will make a note to implement "vrend -q camera".
    V-Ray/PhoenixFD for Maya developer

    Comment


    • #3
      Thank you. That is very helpful.
      Maya 2020/2022
      Win 10x64
      Vray 5

      Comment


      • #4
        Hi snivlem,

        Just to clear things up, did you mean that you want to query which camera renders at the moment during the batch render in Maya GUI?
        Alex Yolov
        Product Manager
        V-Ray for Maya, Chaos Player
        www.chaos.com

        Comment


        • #5
          Here's the hacky code snippet I use. However, I'll look into $batchCamera like ivaylo suggested.

          Code:
          global proc string vraySubmit:getRenderableCamera(){
                  //returns first renderable camera
          	string $cameraList[] = `listCameras -p -o`;
          	string $renderCamera;
          	for($camera in $cameraList){
          		int $renderable = `getAttr ($camera + ".renderable")`;
          		if ($renderable){
          			//setAttr vraySettings.batchCamera -type "string" $camera;
          			$renderCamera = $camera;
          			break;
          		}
          	}
          	return $renderCamera;
          }

          Comment


          • #6
            In PyMel, one line :

            Code:
            import pymel.all as pm
            renderCameras = [x.name() for x in pm.ls(ca=True) if x.renderable.get()]
            www.deex.info

            Comment


            • #7
              Originally posted by yolov View Post
              Hi snivlem,
              Just to clear things up, did you mean that you want to query which camera renders at the moment during the batch render in Maya GUI?
              Yes, I aim to have code in the MEL prerender, so I can get the exact name of the camera that will be used during the batch render.

              So for example, in my batch render scene I have these as renderable cameras.

              Camera1
              Camera2
              Camera3
              Camera4

              So when V-Ray starts rendering through Camera2 I can query this via pre render MEL and it returns the exact value "Camera2"...NOT the other cameras.

              In Maya GUI it is easy because of:

              string $renderPanel = `getRenderWindowPanel`;
              $camera = `renderWindowEditor -q -crc $renderPanel`;
              Maya 2020/2022
              Win 10x64
              Vray 5

              Comment


              • #8
                Thanks a lot for the reply. I messaged you with some more questions to find the most suitable way to implement this.

                I guess it would be best to call "vrend -q camera" (implemented already for this issue) from pre render MEL.
                V-Ray for Maya developer

                Comment

                Working...
                X