Announcement

Collapse
No announcement yet.

Global options - Max Depth

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

  • Global options - Max Depth

    Hi all,

    is there a way to set the 'Global max depth' for reflection and refraction independently?

    cheers,

    Steve

  • #2
    Originally posted by sherridge101 View Post
    Hi all,

    is there a way to set the 'Global max depth' for reflection and refraction independently?

    cheers,

    Steve
    You can in Python Scene Access...
    1) Get all materials
    2) Set all materials

    Do not forget that in render global, the "max depth" in an override depth, not a clamp depth...
    www.deex.info

    Comment


    • #3
      Hi bigbossfr,

      great, thanks for that.

      Would that be something a non programmer (like myself) could do?

      cheers,

      Steve

      Comment


      • #4
        Originally posted by sherridge101 View Post
        Hi bigbossfr,

        great, thanks for that.

        Would that be something a non programmer (like myself) could do?

        cheers,

        Steve
        Sorry for the late reply. I did this in 5 mins :

        Code:
        import vray.utils as vr
        
        def setMaxDepth(reflMax=None, refrMax=None):
            refracAttrs = ["refraction_depth"]
            reflecDepth = ["trace_depth", "reflection_depth"]
            for node in vr.findByType("*"):
                allAttrs = vr.getPluginParams(node)
                for attr in refracAttrs:
                    if refrMax and attr in allAttrs and int(node.get(attr)) < refrMax:
                        node.set(attr, refrMax)
                for attr in reflecDepth:
                    if reflMax and attr in allAttrs and int(node.get(attr)) < reflMax:
                        node.set(attr, reflMax)
        
        setMaxDepth(reflMax=20, refrMax=10)

        Add this code into "Post-translate python script" in Maya render global ---> VRay common

        Change this last line with you max depth : setMaxDepth(reflMax=20, refrMax=10)

        If you want just max reflection depth to 20 : setMaxDepth(reflMax=20)

        If you want just max refraction depth to 20 : setMaxDepth(refrMax=20)

        Or both : setMaxDepth(reflMax=20, refrMax=20)

        Vlado : i see an attribute : mtl_limitDepth in vraySettingsOptions. It is what i am thinking ? (a clamp?)
        Last edited by bigbossfr; 10-10-2013, 02:18 PM.
        www.deex.info

        Comment


        • #5
          Originally posted by bigbossfr View Post
          Vlado : i see an attribute : mtl_limitDepth in vraySettingsOptions. It is what i am thinking ? (a clamp?)
          Nope; it's the same the global V-Ray option in the Maya interface, so it's an override, not a clamp.

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #6
            Awesome, cheers bigbossfr.

            Comment

            Working...
            X