Announcement

Collapse
No announcement yet.

Quick preview workflow

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

  • Quick preview workflow

    I'm coming to Vray for Maya from a history of using max, vray and rpmanager.
    I'm trying to work out how one would use Maya to replicate the workflow I find very efficient in rpmanager. If anyone can point me in the right direction it would be much appreciated!
    In rpmanager, you can set a number of preview overrides, either to the vray renderer, or to specific object sets or even globally to parameters of specific object classes.
    For example, the key ones I would like to be able to do in Maya are:
    Render locally or send to farm with a preview override active (ie vray renderer threshold set to a different value). My thinking is to use the pre and post render mel, but I wonder if there is an easier approach I'm missing?
    Render locally or send to farm with a temporary override for vrayMtl use diffuse texture = false, and set diffuse colour = [180 180 180] (this is a great override as you get a whitecard render with bump and spec components untouched).
    Render locally or send to farm with a temporary override for all vrayLights to set a different subdivs.

    Are there any tools out there I can use to do this kind of thing? or simple code snippets?

    Thanks for any advice.
    p.
    Patrick Macdonald
    Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/




  • #2
    What you need is maya's render layers along with maya's render layer overrides. Essentially you can do any the things you want but using those options. All you have to do is create a render layer and put some of your objects in it, or you can make it global so everything in the scene is on that render layer. Then, while on that render layer you can right click any of the attributes and click - create render layer override, the attribute will turn orange, and input your value. This will override that attribute for the current render layer.

    You can assign shaders to objects in render layers and it will remember those assignments. You can create overrides for material connections so long as you first create layer override to any connection before replacing it.
    Dmitry Vinnik
    Silhouette Images Inc.
    ShowReel:
    https://www.youtube.com/watch?v=qxSJlvSwAhA
    https://www.linkedin.com/in/dmitry-v...-identity-name

    Comment


    • #3
      Thanks that Dmitry,
      I have been using the render layers, but it's early day so I'm still trying to understand how I can get the most out of them. They can probably do exactly what I need, but the initial setup seems a little more involved.
      I would need a seperate draft override setup for each render layer; ie

      - Masterlayer
      - - FG
      - - - FG draft
      - - BG
      - - - BG draft

      I would prefer to just have somewhere to set draft override properties that would apply to any layer I wish when I do a local or farm render. One large projects, I could have many layers, so having to double them up for drafts seems a bit of a pain. Also, would changes to the parent layer (FG) for example propogate through to the draft layer? or is the structure actually quite flat with the draft layers only picking up changes to the masterlayer? ; ie

      - Masterlayer
      - - FG
      - - FG draft
      - - BG
      - - BG draft

      I liked the way that rpmanager overrides can be set in one place to apply to all layers (or named/wildcarded layers) and to apply to specific objects or across all objects of a particular class. It's very powerful! For example, to do an override of the diffuse texture/colour of all materials using maya render layers I would have to create overrides for every material in the scene; with rpmanager I just create one class override. I guess I can do this quickly in Maya using the spreadsheet editor, so perhaps it's just a case of me needing to get rid of my old ways and to embrace the alternative approaches Maya offers

      Thanks again
      p.
      Patrick Macdonald
      Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



      Comment


      • #4
        Here's another quick question.
        If I have a texturemap in the diffuse slot of a vraymtl. In 3dsMax, I can disable the texture and use the colour. In Maya, if I try to set a layer override for this, I can't as there's no way to disable the texturemap; once it's connected Maya prevents my from setting a diffuse colour.

        I'm trying to create an override which is white-card but with the existing bump, reflection and glossiness maps of each material. (ie disable diffuse texture and set diffuse colour to grey/white)

        Is there any way to achieve this with an override? or would I need to create a copy of the entire shader (thus losing the benefits of overrides).
        Patrick Macdonald
        Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



        Comment


        • #5
          You could create a blend colors node, and slot the diffuse into Color 1, and have Color 2 set to white. Set Blender to 1, and then create a layer override and set it to 0 in your white-card renderlayer.
          CG Artist - RnD and CG Supervision at Industriromantik

          Comment


          • #6
            Actually, it might be easier to connect a Ramp node with a single white color in it, into the Blender slot. Connect this same ramp into all your blend color nodes for all your shaders. Then you create your override on the color of the ramp from white (1) to black (0). This will change ALL your shaders into a white diffuse with 1 swap, rather than having to do it on all your shaders.
            CG Artist - RnD and CG Supervision at Industriromantik

            Comment


            • #7
              Aha, that would work. Thanks!
              But isn't this all really laborious?
              Isn't it possible to write a one-liner pre-render script something like (in psuedo code )

              for mtl in vraymtl do ( mtl.diffusetexmapenabled=false; mtl.diffuse = color(0 0 0) )

              The problem being that the pre and post scripts in maya appear to be permanent, so one would have to first list the vraymtls in an array and store their enabled and color states too so they can be re-assigned after the render.

              Is there some mel magic that would do this?

              I know I'm being the 3d-app equivalent of an ex-smoker by banging on about max workflows and trying to make maya behave in the same way... so please be patient with me!

              Thanks for all the suggestions though, it is very useful to see examples of the mind-set required to leverage all the tricks out of Maya.
              Patrick Macdonald
              Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



              Comment


              • #8
                I actually wanted something similar, so I asked our coder (Fredrik Averpil here) if he could make a Pre Render MEL for it.
                Try this. Obviously change 1,1,1, to what ever color you like if you for example think pure white is abit too strong (As you rarely lit your scene for everything to be that bright)

                Just copy paste it into Pre Render MEL and it should work.

                global proc setWhite( string $material, string $attr ) {
                if (objExists( $material + $attr ) )
                {
                int $connected = `connectionInfo -isDestination ($material + $attr)`;
                if ($connected == 1) {
                $connection = `listConnections -d 1 -p 1 ($material + $attr)`;
                disconnectAttr $connection ($material + $attr);
                }
                setAttr ($material + $attr) 1 1 1;
                }
                }

                // define the attributes to disconnect (if connected) and set to white
                for ($material in `ls -materials`)
                {
                setWhite( $material, ".color" );
                setWhite( $material, ".annat_attribut" );
                }
                By the way, this will relink all your shaders in the scene. So if you are doing a local render, all your shaders will now have white diffuse. But I guess you wanted it for a batch render anyway? In that case it should work just fine.
                Last edited by Algehov; 02-06-2015, 01:40 AM.
                CG Artist - RnD and CG Supervision at Industriromantik

                Comment


                • #9
                  Thanks for that Algehov,
                  That does do what I'm after, but it's annoying that you can't use it to make an override for local renders.

                  Is there really no way to easily do this in Maya? I imagine another approach might be to programatically create a new renderlayer on the fly, and change the shaders/settings, but the code to do this will probably get pretty heavy... the psuedo code could be something like this...

                  pre render script.
                  -- create copy of current layer.
                  -- for all vray materials create a copy of the material and apply it to the original parent object as an object override material.
                  -- Remove the diffuse texture of these materials and set to white.
                  -- switch to the new temporary renderlayer and render.

                  post render script.
                  -- delete the temporary renderlayer and associated materials.

                  At least this would avoid the need to undo any physical changes to the scene that are required to do this kind of override.

                  The other method might be to send some python for vray to interpret at rendertime
                  Patrick Macdonald
                  Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                  Comment


                  • #10
                    Use Python scene access.
                    My plugin DeeX VRay Arsenal uses this.
                    www.deex.info

                    Comment


                    • #11
                      Hah, Deex! Yes, thanks, I had a feeling this was the way I should go! I'll do some testing tomorrow.
                      Thanks
                      p
                      Patrick Macdonald
                      Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                      Comment


                      • #12
                        Interesting!
                        Let us know if you figure out how to do it. Would be nice to have it working nicely in a local render aswell as you say.
                        CG Artist - RnD and CG Supervision at Industriromantik

                        Comment


                        • #13
                          Here's a great blog-post that explains how to get started...
                          http://cg.earlyworm.co.nz/vray-scene...ve-hit-render/
                          Patrick Macdonald
                          Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                          Comment


                          • #14
                            That guy basically already solved it. Here's some slightly tweaked code from his website that works in Maya 2016 with V-Ray nightly build 25823 on a couple of polyspheres with textures mapped onto them:

                            Code:
                            from vray.utils import *
                            nodes=findByType("Node") # Get all Node plugins
                            for node in nodes:
                                material = node.get("material") # Get the material
                                brdf = material.get("brdf") # Get the BRDF for the material
                                brdf.set("color_tex", Color(1.0, 1.0, 1.0)) # Set the BRDF color
                            You probably don't want to use (1.0, 1.0, 1.0) because then your scene could get quite blown out. Try some lower values for nicer results.
                            Last edited by Fredrik Averpil; 03-06-2015, 09:05 AM.
                            Best Regards,
                            Fredrik

                            Comment


                            • #15
                              For me, Python scene access is a powerful feature.
                              I hope to have this for VRay standalone, 3dmax...
                              www.deex.info

                              Comment

                              Working...
                              X