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

    CustomGui Data

    SDK Help
    0
    4
    385
    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 18/08/2015 at 12:38, xxxxxxxx wrote:

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

      ---------
      Greetings !

      I have created a customgui extending the CustomGuiData class.
      I use it in resource file as:
      String MY_PARAMETER_NAME {CUSTOMGUI: MY_PLUGIN_CUSTOM_GUI}

      The class i use that extends CustomGuiData contains a DataStructure (lets say vector).

      What i want to do is to use the GetParameter function of C4DAtom as

      GeData parameter_data;
      my_tag.GetParameter(DescLevel(MY_PARAMETER_NAME ), parameter_data, DESCFLAGS_GET_PARAM_GET );
      

      and somehow make parameter_data contain the complex data structure from CustomGuiData .

      What i do now is serializing that vector to String is GetData and deserializing from string to vector in SetData of CustomGuiData subclass.
      Can i avoid that and use the vector as it is in GetData and SetData ?

      Thank you.

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

        On 18/08/2015 at 22:52, xxxxxxxx wrote:

        you will need a CustomDataType class "plugin" , there is an example in the sdk.

          
        	BaseContainer* data = ((BaseMaterial* )node)->GetDataInstance();
        	GeData parameter_data;
        	data->GetParameter(MY_PARAMETER_NAME , parameter_data);
        	yourCustomDataTypeClass* cData = static_cast<yourCustomDataTypeClass*> (parameter_data.GetCustomDataType(YOUR_CUSTOM_DATA_TYPE_PLUGIN_ID));  
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 19/08/2015 at 01:45, xxxxxxxx wrote:

          Hello,

          as Mohamed pointed out, there is a difference between data and GUI. The job of a custom GUI is to display the given datatype and to offer user interaction. The data itself is stored and handed over to the datatype.

          So if your custom GUI should handle vectors, you should assign it to a parameter of the type vector.  Or you create a new, custom datatype. You find an example on custom datatypes and GUIs on GitHub.

          Best wishes,
          Sebastian

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

            On 28/08/2015 at 10:02, xxxxxxxx wrote:

            Hello peterakos,

            was your question answered?

            Best wishes,
            Sebastian

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