Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Accessing V-Ray Material Parameters [SOLVED]

    SDK Help
    0
    4
    391
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 04/01/2017 at 02:22, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   16+ 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi there,

      I simply cannot get this to work. Please help!
      I try to set the color and to exchange Texture links within an Advanced VRay material and its Advanced Bitmap Shader.
      This is what I have so far (getting the link to a V-Ray Advanced Material from a Texture-Tag and trying to read out the shader loaded to the Diffuse Layer 1 -> Diffuse Color Texture slot) :

      BaseTag* TexTag = MyObjekt->GetTag(Ttexture);
      if (TexTag)
      {
           BaseMaterial* Material = ((TextureTag* )TexTag)->GetMaterial(true);
           if (Material)
           {
                if (Material->GetType() == 5703)
                {
                     // Material is of Type V-Ray Advanced Material
                     GeData Vray_data;
                              Material->GetParameter(DescID(4100), Vray_data, DESCFLAGS_GET_0); // VRAYMATERIAL_COLOR1_SHADER -> Texture link field in the material
                              BaseShader *shader = static_cast<BaseShader*>(Vray_data.GetLink(doc, 0));

      }
           }
      }

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 05/01/2017 at 01:42, xxxxxxxx wrote:

        Hi Arndt, thanks for writing us.

        With reference to your code I'd say it looks fine at a least from a Cinema 4D SDK point of view. So I guess, there must be something happening on the V-Ray implementation side. Unfortunately the MAXON SDK Support team has no information about it, hence I suggest you to directly ask the VRAYforC4D guys (LAUBlab) or somebody in our community can help out.

        As side note please I also invite you to make use of the

        tag to include your code snippets in order to improve code readability.

        Best, Riccardo

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 05/01/2017 at 06:11, xxxxxxxx wrote:

          Hi Riccardo,

          thanks for your reply. I will try to contact LaubLab directly then.

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 06/01/2017 at 05:46, xxxxxxxx wrote:

            Hi Arndt,

            may be try this code instate.

              
            BaseTag* TexTag = Mein Objekt->GetTag(Ttexture);  
            if (TexTag) {  
              BaseMaterial* Material = static_cast<TextureTag*>(TexTag)->GetMaterial(true);  
              if (Material) {  
                  if (Material->GetType() == 1020295) {  
                      // Material ist ein V-Ray Advanced Material  
                      BaseContainer *bc = Material->GetDataInstance();  
                      BaseShader *shader = static_cast<BaseShader*>(bc->GetLink(VRAYMATERIAL_COLOR1_SHADER, doc));  
              
                  }  
              }  
            }  
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post