Announcement

Collapse
No announcement yet.

Overriding all Vrayscene materials using the snippet editor

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

  • Overriding all Vrayscene materials using the snippet editor

    Hello everyone,
    I was wondering if there's a way to override a vray scene with a matte material. Doesn't work from the object properties options so currently I'm giving the "Scene Overrides" section a go. What I've done is exported a box as vray scene, with assigned VrayMtlWrapper which has a VratMtl as base (I noticed that when you don't have a base material plugged in you can't get a -1 alpha cont.). Next I loaded the vrayscene. into the "from file" section and used the snipped example code given in the documentation, as follows:

    Node <*>{
    material=matteovr;
    }

    I think the "<*>" part doesn't work as I think it should (selecting all geometry nodes). Any help is appreciated.

    Thanks!

  • #2
    Hello!

    Your script is correct for assigning new material to all geometry in a VRayScene object. However this will not work for making the geometry matte (this is currently logged in our bug tracking system as VMAX-8113).

    At the moment we can only set the values for the matte inside the snippet. Since you have assigned VRayMtlWrapper to the original scene prior exporting, these matte-controlling parameters are available in the scene and can be edited using the snippet.
    Copy and paste this in the Snippet editor:
    Code:
    MtlWrapper <mtl_ovr*>{
      alpha_contribution=-1;
      matte_surface=1;
      shadows=1;
      affect_alpha=1;
      matte_for_secondary_rays=1;
    }
    The "mtl_ovr" is the name of my VRayMtlWrapper material in my original scene - the one that I exported. There is no need to assign material to the VRayScene object with this override - we simply modify the values of the original VRayMtlWrapper read from the vrscene.
    I hope this helps your case.

    Best regards,
    Margarita
    Margarita Stoeva | chaos.com
    Chaos QA (V-Ray for 3ds Max)

    Comment


    • #3
      Is the problem (VMAX-8113) still unsolved in V-Ray 5?


      OakCorp Japan - Yuji Yamauchi
      oakcorp.net
      v-ray.jp

      Comment


      • #4
        Hello!

        Yes, there is development regarding this case and it will be available in V-Ray 5: VRayScene object can be set to matte using V-Ray Object properties.
        This is done the general way and no Snippet overrides are needed.

        Best regards,
        Margarita
        Margarita Stoeva | chaos.com
        Chaos QA (V-Ray for 3ds Max)

        Comment


        • #5
          Can 3ds Max assign V-Ray Object properties to a specific object in a vrscene? (Without override snippet.)

          Looking at V-Ray 5 BETA2, it seems that can only set V-Ray Object properties for the entire VRayScene object.

          OakCorp Japan - Yuji Yamauchi
          oakcorp.net
          v-ray.jp

          Comment


          • #6
            Hello!

            V-Ray object properties are set to the entire VRayScene object and should effect all the geometry loaded with the vrscene by design.

            If you want to explicitly modify the object properties of specific geometry from that vrscene, you still need to use the VRayScene Snippet Editor in the Scene Overrides rollout.
            Have in mind that only parameters which were exported in the vrscene can be adjusted with it. Trying to overwrite values to parameters which were not exported (because they had default values in the original scene) will not work.

            Best regards,
            Margarita
            Margarita Stoeva | chaos.com
            Chaos QA (V-Ray for 3ds Max)

            Comment


            • #7
              That improvement is halfway.
              At least, if you can read only the specified geometry from vrscene, we can split vrscene into multiple and may be able to take advantage of VRayObjectproperties.

              The user will want to overwrite the material(VRayMtlWrapper etc..) of a particular object in the vrscene.

              Please add it to Wish list.

              OakCorp Japan - Yuji Yamauchi
              oakcorp.net
              v-ray.jp

              Comment


              • #8
                Hello,

                Output a vrscene from V-Ray Houdini with VRayMtlWrapper, but the material name is not recognized.

                In the case of the attached vrscene, how is the material name expressed in Snippet overrides?

                |obj|geo1|wrapperMtl|wrapperMtl ?

                Attached Files

                OakCorp Japan - Yuji Yamauchi
                oakcorp.net
                v-ray.jp

                Comment


                • #9
                  Hello, CHAOS SupprtTeam

                  Is there a specialist who can answer my question?

                  OakCorp Japan - Yuji Yamauchi
                  oakcorp.net
                  v-ray.jp

                  Comment


                  • #10
                    flat The wrapper override should look something like this:
                    Code:
                    MtlWrapper VRayMtlWrapper2@wrapper {
                    matte_surface=1;
                    }
                    In your case the code should look like this:
                    Code:
                    MtlWrapper |obj|geo1|wrapperMtl|wrapperMtl {
                    matte_surface=1;
                    }
                    There is an example in the technical documentation here.
                    Last edited by hermit.crab; 23-06-2020, 05:25 AM.
                    Aleksandar Hadzhiev | chaos.com
                    Chaos Support Representative | contact us

                    Comment


                    • #11
                      Hello, Aleksandar

                      Thank you for answering. I understand that it is OK if I simply quote from vrscene.
                      However, it doesn't seem to work.


                      What's wrong?
                      I will attach a test scene. I am using V-Ray Next Updade 3.2.
                      Attached Files

                      OakCorp Japan - Yuji Yamauchi
                      oakcorp.net
                      v-ray.jp

                      Comment


                      • #12
                        The wrapper material does not seem to be applied to the geometry. Either export it again with the applied VRayMtlWrapper or edit the "testGeometry_nodes.vrscene" by typing in the VRayWrapperMtl name ("|obj|geo1|wrapperMtl|wrapperMtl") as its material. Here is an example scene.

                        FYI, I made an edit of the code above since writing the base material is not necessary.
                        Last edited by hermit.crab; 23-06-2020, 05:27 AM.
                        Aleksandar Hadzhiev | chaos.com
                        Chaos Support Representative | contact us

                        Comment


                        • #13
                          Hello,Mr.Aleksandar

                          Oh. I didn't notice that you didn't assign any materials.
                          I changed _nodes.vrscene and it worked!

                          Thank you for your advice.

                          Best wishes,

                          OakCorp Japan - Yuji Yamauchi
                          oakcorp.net
                          v-ray.jp

                          Comment

                          Working...
                          X