Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Shader Parameters [SOLVED]

    SDK Help
    0
    3
    291
    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 22/10/2015 at 13:53, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello.

      I create a Material and in color channel i add an animated texture.
      How can i get the parameter values of this shader ?
      For example i need the values of Movie Start Frame and Movie End Frame.

      Thank you very much

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

        On 26/10/2015 at 03:20, xxxxxxxx wrote:

        Hello,

        the parameters of a shader can be accessed like any other parameter with GetParamter(). You just just have to access the shader:

          
        GeData data;  
        mat->GetParameter(DescID(MATERIAL_COLOR_SHADER), data, DESCFLAGS_GET_0);  
          
        BaseShader* shader = static_cast<BaseShader*>(data.GetLink(doc, Xbitmap));  
        if (!shader || !shader->IsInstanceOf(Xbitmap))  
         return false;  
          
        shader->GetParameter(DescID(BITMAPSHADER_TIMING_FROM), data, DESCFLAGS_GET_0);  
        const Int32 startTime = data.GetInt32();  
          
        shader->GetParameter(DescID(BITMAPSHADER_TIMING_TO), data, DESCFLAGS_GET_0);  
        const Int32 endTime = data.GetInt32();  
        

        Please notice that the "Movie Start Frame" and "Movie End Frame" parameters are only set after the "Calculate" button was pressed.

        best wishes,
        Sebastian

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

          On 26/10/2015 at 06:03, xxxxxxxx wrote:

          Thank you very much !

          1 Reply Last reply Reply Quote 0
          • First post
            Last post