Announcement

Collapse
No announcement yet.

vrscene - choosing render cam

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

  • vrscene - choosing render cam

    In Maya, when exporting a vrscene file, is there a way to define the render camera to be used on export besides whatever camera is the active viewport camera? I'm finding that whatever camera Maya is looking through at the time of export, is the camera that is used to render in vray standalone from the vrscene file. I also did a search through the docs and the help info of the vray.exe and could not find an option pertaining to the selection of a render cam.

    Also, is it possible to export a vrscene file with multiple cameras in it and then choose which camera to render from at render time?

    Currently settings up a custom submitter that will export vrscenes and push them to a Vray standalone job in Deadline. If there is no real control over which camera to link the vrscene export to, I suppose I could just get a list of all cameras in the scene, have the user select which one they want to render out of and then look through that one right before exporting the vrscene, but I'm hoping there is a cleaner way.

    Thank you for any and all help.

    -Clayton

  • #2
    Hi Clayton,

    Yes, you are correct - whatever camera is the active one in the viewport gets exported. At the moment, vrscenes can only have one camera. There's been talk about adding multiple camera support, but it's not trivial to implement.
    You could try adding your cameras to the renderable cameras list, then when batch rendering, Maya would usually render the scene through each camera one after the other. You could do the setup like this and then in batch just do Render -r vray -exportFileName <exportedVrscene> -noRender <mayaSceneFile> - this will not render, but instead just export the vrscene.
    A quick test gives me a copy of my vrscene each containing a different camera:
    1. render settings > common tab > renderable cameras - I've added my cameras to the list.
    2. "C:\Program Files\Autodesk\Maya2018\bin\Render.exe" -r vray -noRender -exportFileName "C:\Users\yolov\Desktop\camera_<Camera>.vrscen e" -exportSpecific "camera1" C:\Users\yolov\Desktop\cameras.ma
    --> I've set the <Camera> tag to avoid overwriting my files.
    --> this results in the same scene exported with a different camera each time
    Alex Yolov
    Product Manager
    V-Ray for Maya, Chaos Player
    www.chaos.com

    Comment


    • #3
      There's also more ways to do similar setups that would avoid the whole scene being exported again and again for each camera, but it's a bit more tricky to set up and is slightly hacky.

      In principle, you could export your main scene just once. Then export a few vrscenes containing only the different cameras, then put all of that together.
      There's two ways I can think of to do that - one would involve scripting and our python post-translate scene access api, and the other would involve just batch rendering and a few easy modifications to text file.

      The first way would be run a batch, similar to what I described in my previous post, but with additional modification to only export the camera to vrscene. Then export your main scene and use python scene access to append the camera-only scenes to the main scenes. Then you can just queue the resulting scenes for rendering.

      The other way involves doing the same batch for camera-only export again. Then a simple export of the main scene. Then creating an empty text file that uses the vrscene syntax and binding main scene to new camera using our #include statements. Create as many such empty "binders" as the number of cameras and queue up the binders (which call the rest of the vrscenes in turn).

      Both ways however would have to deal with potential render settings clashes, which would be a problem only if you change the render settings during one of the exports. And also you'd have to be careful for the exact order in which the cameras are loaded into vray, since the main scene would already contain a camera, that you want to overwrite with another one. But this is doable with some scripting.

      Let me know if you're interested in those and I can give you the full steps.
      Alex Yolov
      Product Manager
      V-Ray for Maya, Chaos Player
      www.chaos.com

      Comment


      • #4
        Sorry my reply took so long. Thank you for the information Yolov. I ended up just copying what Vray does when rendering a standard job as far as active viewport selection goes. The script just throws an error and fails unless a camera viewport is selected.

        'Let me know if you're interested in those and I can give you the full steps.'

        ^I appreciate this offer and might take you up on it in the future. Right now we are going to just see how generating a new .vrscene for each render submission goes. Although the .vrscene still needs to be uploaded to the farm/Deadline, I have this happening on the back-end in a separate process as to not impact that artists submitting.

        Thank you again for the help and information! Appreciate it!

        Comment


        • #5
          Originally posted by 9k_JHT View Post
          I appreciate this offer and might take you up on it in the future.
          Sure, just let me know.
          Alex Yolov
          Product Manager
          V-Ray for Maya, Chaos Player
          www.chaos.com

          Comment

          Working...
          X