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

    GeData?

    SDK Help
    0
    3
    242
    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 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?

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

        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

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

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

          Thanks, for the as always clear explanation.

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