GeData?



  • On 11/11/2013 at 12:20, xxxxxxxx wrote:

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

    ---------
    C++ is, compared to Python, sometimes a bit mysterious.

    I have found out, thanks to this forum, how to set the blendmode in a layer shader.
    But getting the blend mode is something I do not yet understand.
    That is because I do not fully understand GeData?

    How to get the blending mode out of this GeData, or how to interpreted GeData?

    Set: 	res = layer->SetParameter(LAYER_S_PARAM_SHADER_MODE, BlendMultiply);
    Get:	res = layer->GetParameter(LAYER_S_PARAM_SHADER_MODE, blendMode);
    

    Another "simple" question:
    Is there no SearchMaterial (or SearchObject) as in Python?



  • On 11/11/2013 at 14:15, xxxxxxxx wrote:

    GeData is just a container. Similar to BaseContainer.

    The workflow to retrieve data from it as follows:
    -Create an empty GeData instance with whatever variable name you prefer (typically it's named "d" or "data")
    -Use GetParameter() to fill the GeData container with some value you want to retrieve (usually descriptions or description ID's)
    -Get the value out of the GeData container by using the specific type of data you saved into it

    Example:

        GeData bm;  
      layer->GetParameter(LAYER_S_PARAM_SHADER_MODE, bm);     //LAYER_S_PARAM_SHADER_MODE is a LONG value  
      LONG blendMode = bm.GetLong();                          //So we look in the GeData container for a LONG type of result  
      GePrint("blendMode = " + LongToString(blendMode));  
      
      GeData bv;  
      layer->GetParameter(LAYER_S_PARAM_SHADER_BLEND, bv);   //LAYER_S_PARAM_SHADER_BLEND is a Real value  
      Real blendValue = bv.GetReal();                        //So we look in the GeData container for a Real type of result  
      GePrint("BlendStrength = " + RealToString(blendValue));
    

    If you're wondering how I knew what type LAYER_S_PARAM_SHADER_MODE & LAYER_S_PARAM_SHADER_BLEND were.
    I got that info from looking at the lib_layershader.h file for these two IDs.

    -ScottA



  • On 11/11/2013 at 23:51, xxxxxxxx wrote:

    Thanks, for the as always clear explanation.


Log in to reply