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
    • Register
    • Login

    GetDataInstance and GetParameter in TagData Read

    SDK Help
    0
    7
    188
    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 16/09/2016 at 00:47, xxxxxxxx wrote:

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

      ---------
      Hello.

      I have a filename parameter, which I try to retrieve in Read method (TagData plugin).

      Here is the code using GetDataInstance and GetParameter

      //1
      BaseContainer* tag_data = tag->GetDataInstance();
      String filename = tag_data->GetFilename(FILENAME_PARAM).GetString();
        
      //2
      GeData ge_data;
      tag->GetParameter(FILENAME_PARAM, ge_data, DESCFLAGS_GET_PARAM_GET);
      String filename = ge_data.GetFilename().GetString();
      

      The first filename gets the value correctly, while the second filename string appears empty.
      Why GetParameter doesn't return the value correctly ?

      Thank you.

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

        On 16/09/2016 at 02:07, xxxxxxxx wrote:

        Hi,

        you are using DESCFLAGS_GET_PARAM_GET, which is the flag for saying, the parameter got read successfully. Can you please try, if the problem persists, if you use DESCFLAGS_GET_0 instead?

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

          On 16/09/2016 at 05:44, xxxxxxxx wrote:

          Hello.

          Using DESCFLAGS_GET_0 returns the correct value. So I assume that whenever I want to read a parameter, I have to use DESCFLAGS_GET_0 right ?
          When am I supposed to use DESCFLAGS_GET_PARAM_GET ?

          Thank you for your time.

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

            On 16/09/2016 at 05:50, xxxxxxxx wrote:

            Hi,

            DESCFLAGS_GET_PARAM_GET is used inside GetDParameter() to mark the successful retrieval of the parameter. You don't pass it into GetParameter().

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

              On 16/09/2016 at 06:16, xxxxxxxx wrote:

              Hello.

              I didn't know that. I assume SET_PARAM_SET does the same right (in SetDParameter)?

              thnx.

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

                On 16/09/2016 at 08:56, xxxxxxxx wrote:

                Yes. Sorry, I got disturbed, while posting. I actually wanted to mention this in my post.

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

                  On 16/09/2016 at 09:01, xxxxxxxx wrote:

                  Even worse, I forgot to post the links to our documentation.
                  Manuals on GetDParameter() and SetDParameter() and here the API reference: GetDParameter() and SetDParameter().

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