Announcement

Collapse
No announcement yet.

Quick preview workflow

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

  • #16
    Originally posted by bigbossfr View Post
    For me, Python scene access is a powerful feature.
    I hope to have this for VRay standalone, 3dmax...
    Yes, I've been having great success using this. It's amazing! It will probably take me a while to think of all the handy things you can do with it, but for now, being able to do renderer/material/object overrides is fantastic.
    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


    • #17
      One question ... when using the code in my previous post (#14 on this page), if a VRayMtl has reflection color (or reflection color) set to something other than black (0.0, 0.0, 0.0), the diffuse color is not changed with that code. How come?
      Any way to work around this and maintaining the shader's reflection/refraction?

      Also, when using e.g. getTypeParams(pluginType) ... where does the returned list get printed?
      Best Regards,
      Fredrik

      Comment


      • #18
        Hm so it seems the color texture attribute has different names depending on which brdf is being hit:

        Code:
        # Error: line 0: Exception: file ...\maya_vray\scripts\vray\plugin.py line 88: A parameter with name "THIS_WONT_WORK" doesn't exist for plugin "VRayMtl1@brdflayered". # 
        # Error: line 0: Exception: file ...\maya_vray\scripts\vray\plugin.py line 88: A parameter with name "color_tex" doesn't exist for plugin "VRayMtl1@diffuse". #
        Where can I find a list of attributes depending on which brdf is being hit?
        Best Regards,
        Fredrik

        Comment


        • #19
          If you want a white diffuse color, my guess is that the easiest way is to override color gain to 0.0 and set color offset to the desired color. But you will have a performance penalty. File textures have a "Disable load" option though.

          The python code will work in a very limited cases. You must check for layered brdf and then walk through the brdfs looking for diffuse brdfs. It will be probably easier to check for diffuse brdf

          Code:
          from vray.utils import *
          brdfs = findByType("BRDFDiffuse") 
          for brdf in brdfs:
          	brdf.set("color_tex",  Color(1.0, 1.0, 1.0))
          getTypeParams() returns a python list of strings. It doesn't print anything.
          V-Ray/PhoenixFD for Maya developer

          Comment


          • #20
            Originally posted by ivaylo.ivanov View Post
            If you want a white diffuse color, my guess is that the easiest way is to override color gain to 0.0 and set color offset to the desired color.
            But if you have additional nodes after the file texture corrected the texture in different ways, this will not work right? Also, you have textures being plugged in into bump/reflection/glossiness etc, that you wanna keep intact.
            Basically what we want is to keep the shader as it is, and have its diffuse color overriden to a gray/white.
            CG Artist - RnD and CG Supervision at Industriromantik

            Comment


            • #21
              The draw back is that you can't share textures of course. Ok, maybe a better method is to use layered texture and toggle "layer is visible"?
              V-Ray/PhoenixFD for Maya developer

              Comment


              • #22
                I guess that could work yes. (If you set up all your shaders this way, always).
                Isnt there a way to just simply disconnect the diffuse texture slot from any inputs (if any) and change the diffuse color to (0.6, 0.6, 0.6) or such in a Post Translate Python Script?
                If you do it as a pre render mel it works, but all your shaders would actually change, and you only want that to happen in render time.
                CG Artist - RnD and CG Supervision at Industriromantik

                Comment


                • #23
                  Disconnecting things will change the shading network, which is a complicated shading network event. It's probably a bad design decision for Maya to allow this even for layers. You are allowed only to override values. I think Maya's node system is very sound, even if sometimes it's more work to make it the "right way". If you want a shortcut, use the Python script, but you must deal with the internal VRay representation. Using pre-render MEL is probably the worse choice.
                  V-Ray/PhoenixFD for Maya developer

                  Comment


                  • #24
                    I think what Simon is asking is whether there's a way to do something like:

                    Code:
                    brdf.disconnect("color_tex") # Disconnect (break connection) any texture mappings
                    Best Regards,
                    Fredrik

                    Comment


                    • #25
                      When you set new parameter, you are fully replacing the old one. You can also delete a parameter, and it will use the default value. But it's not very useful, and seems not implemented in Maya.
                      V-Ray/PhoenixFD for Maya developer

                      Comment


                      • #26
                        Im not sure if I understand. Are we still talking about doing this as a Post Translate Python Script?
                        Then deleting the parameter and then change the default value (often black?) to the desired color, is just what im after. This is not done in the scene (as a pre render mel would do it), but just during the render. The scene shouldnt change, and all shaders should still have their textures assigned just like before. And whenever you wanna render it normally you just remove the python script?

                        Maybe im looking at this in the wrong way
                        CG Artist - RnD and CG Supervision at Industriromantik

                        Comment


                        • #27
                          Sory, I mean the Python scene access in Maya. You can't change a default value there, so there isn't really something like disconnect either. You just replace the value (this is what both of the Python scripts are doing).
                          V-Ray/PhoenixFD for Maya developer

                          Comment

                          Working...
                          X