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

    GetParameter while SetDParameter

    SDK Help
    0
    3
    612
    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 13/12/2017 at 01:46, xxxxxxxx wrote:

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

      ---------
      I have a kind of chicken and egg situation.
      I am sure there are tons of solutions to solve this, but was wondering if I am not looking at it the wrong way.

      I have a checkbox in a tag description. When the user checks the checkbox I want to update the drawing in a GeUserArea of a GeDialog.
      However, the drawing method checks the state of that checkbox to draw this or that via

        
      DoUserAreaRedraw()  
      {  
      ...  
        Bool enabled = FALSE;  
        if (tag)  
        {  
            GeData d;  
            tag->GetParameter( checkboxID , d, DESCFLAGS_GET_0);  
            enabled = d.GetBool();  
        }  
      ...  
      }  
      

      In Tag::SetDParameter I check on the checkbox:

        
      Bool Tag::SetDParameter(GeListNode* node, const DescID& id, const GeData& t_data, DESCFLAGS_SET& flags)  
      {  
        if (!node)  
            return FALSE;  
        
        const Int32& gadgetID = id[0].id;  
        switch (gadgetID)  
        {  
            case checkboxID:  
                DoUserAreaRedraw();  
        
      ...  
        }  
        
        return SUPER::SetDParameter(node, id, t_data, flags);  
      }  
      

      Problem is thus that while the SetDParameter is processed the actual parameter is not yet updated and the drawing fails to visualize the correct information, as it obtains the "old" value of the parameter.

      What would be the better approach to resolve this?
      Thanks in advance,
      Daniel

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

        On 13/12/2017 at 02:48, xxxxxxxx wrote:

        Hello,

        you can catch the message MSG_DESCRIPTION_POSTSETPARAMETER which will be sent after the parameter has been set.

        See also NodeData::Message() Manual.

        best wishes,
        Sebastian

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

          On 13/12/2017 at 03:45, xxxxxxxx wrote:

          But of course, that's obvious.
          Sorry to waste your time Sebastian, and thanks for refreshing my memory.

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