Announcement

Collapse
No announcement yet.

Override Mtl - Get reference to original material?

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

  • Override Mtl - Get reference to original material?

    I want to make a material that queries the original for an opacity map, displacement or refraction. Is there any way to get the original material via the shadecontext or something else?

  • #2
    Hm, not directly. However if the override material is the top-level material, from the ShadeContext you can get a pointer to the INode, from that you can get a pointer to the material, check if it is VRayOverrideMtl material, get the first sub-material, which is the base one, and then try to use that.

    This will not work if the override material is inside another material, and not directly attached to the node, but it might still be useful.

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

    Comment


    • #3
      Great idea. Thanks Vlado!

      Comment


      • #4
        Out of curiosity, why do you need this, by the way?

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

        Comment


        • #5
          So that when we do "white" renders for camera approval, we don't have to exclude the glass materials manually. Then sometimes there are trees that use opacity mapped leaves so they can look odd, but going through and fixing those so they render as a 128 white material is a pain in the ass so we skip that. I figured the best place to do it would be a material you can use as the override material, which looks for any opacity maps or refraction and accounts for them.

          Comment


          • #6
            Hmm, very clever

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

            Comment


            • #7
              I'd love for this option as well - including an option to get the bump maps as well. Thanks!
              Akin Bilgic | CGGallery.com
              Modeler & Generalist TD

              V-Ray Render Optimization
              V-Ray DMC Calculator

              Comment


              • #8
                Just FYI this won't be happening anytime soon - i'm drowning in work and first off the bat is to finish off my MultiPlanar plugin. I just wanted to quickly check if it was even possible, and as Vlado points out it (probably) is!

                Comment


                • #9
                  Originally posted by vlado View Post
                  Hm, not directly. However if the override material is the top-level material, from the ShadeContext you can get a pointer to the INode, from that you can get a pointer to the material, check if it is VRayOverrideMtl material, get the first sub-material, which is the base one, and then try to use that.

                  This will not work if the override material is inside another material, and not directly attached to the node, but it might still be useful.

                  Best regards,
                  Vlado
                  Hi Vlado, how to do that? could please write a step by step tutorials about this?
                  thank you.
                  Best regards,
                  Jackie Teh
                  --

                  3ds max design 2023, V-Ray 6, Update 2 [6.20.03 build 32455]
                  AMD Threadripper 1950X @3.40 GHz | 64GB RAM | Nvidia RTX 3070 ti
                  Website: https://www.sporadicstudio.com
                  Email: info@sporadicstudio.com
                  YouTube: https://www.youtube.com/c/SporadicStudio

                  Comment

                  Working...
                  X