Shader Parameters [SOLVED]

  • On 22/10/2015 at 13:53, xxxxxxxx wrote:

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


    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

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


    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,

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

    Thank you very much !

Log in to reply