Announcement

Collapse
No announcement yet.

Export VRayMtl to third-party software ?

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

  • Export VRayMtl to third-party software ?

    Hello guys,

    I would want to export VRay Materials with an home-made 3dsmax export plugin.
    I already have the code to export Standard Materials and tried to apply the same logic to VRay Mats.

    But I can't find the VRayMtl class in the VRay SDK!?
    I saw the VRay SDK provided material examples to develop custom VRay Materials, but I didn't find the VRayMtl class, which is the class I would want to export...

    Am I missing something obvious?
    Has somebody already played with the VRay SDK?

    Thanks for advance,

  • #2
    I'm not sure what else you need; everything is already exposed through the normal 3ds Max APIs (e.g. Parameter block access, sub-textures etc)

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

    Comment


    • #3
      Ok, so my c++ skills and my comprehension of 3dsmax SDK may be not enough...
      I will give it another try alone and post a code example further if necessary.

      Thanks for the help!

      Comment


      • #4
        Hello again,

        Here is a sample of my code where I tried to export VRayMtl.

        First, I detect the CLASSID of the Material then redirect on the right DumpMaterial function.
        Here is my try of a dump function of VRay Mat.

        Code:
        void Max2ThirdParty::DumpMaterialVRay(Mtl* mtl, ThirdPartyMaterial &NMat, BOOL &OpacityValid)
        {
        	SkeletonMaterial* sklMat = (SkeletonMaterial*)mtl;
        	
        	// Get VRay Material Properties
        	Color Ambient		= sklMat->GetAmbient(t);
        	Color Diffuse		= sklMat->GetDiffuse(t);
        	Color Specular		= sklMat->GetSpecular(t);
        	float Shininess		= sklMat->GetShininess(t);
        	float ShinStr		= sklMat->GetShinStr(t);
        	float Transparency	= sklMat->GetXParency(t);
        	Color Emissive		= Color(0.0, 0.0, 0.0);
        
        	.....
        }
        Am I totally wrong?
        What is the right way to get VRayMtl parameters from the Mtl?

        Thanks,

        Comment


        • #5
          Here is an excerpt from the export code for the VRayMtl material that we use for V-Ray RT. I hope it will be useful - let me know if there are any questions.

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

          Comment


          • #6
            I searched a moment in the forum rules but I didn't find why I couldn't read your attachment...
            It seems my account do not allow me the reading... Any idea?

            Comment


            • #7
              Ok! I understood... Only VRay customers are allowed to read attachment.
              The company where I work do have Vray licenses. Where can I upgrade my account wih

              Comment


              • #8
                Please email us to vray@chaosgroup.com and our support guys will help you.

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

                Comment


                • #9
                  Hi, I write max scene exporter for my company.

                  I change a property in VRayMtl UI to a specific value, and then check all values in parameter blocks to find a match.
                  finally, I successfully extracted properties I need of VRayMtl(VRay3.2).

                  BUT, when I give my exporter to some of my clients who uses VRay 2.x, my exporter no longer work,
                  do I need to go through the process above again with every version of VRay?

                  Is there a better way to do this?
                  If there isn't, how often do you guys change parameter blocks in VRayMtl?

                  Comment


                  • #10
                    I can't tell you, sorry. When I did this material export a long time ago, I used a custom attribute to store and expose store some additional parameters.

                    Comment


                    • #11
                      Originally posted by wo8858 View Post
                      Is there a better way to do this?
                      You should first check if a parameter exists before doing anything with it.

                      If there isn't, how often do you guys change parameter blocks in VRayMtl?
                      Not very often, but sometimes new parameters are added in newer versions.

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

                      Comment

                      Working...
                      X