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

    GetDDescription of a GVoperator Node disappears

    Scheduled Pinned Locked Moved Bugs
    3 Posts 0 Posters 614 Views
    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 Offline
      Helper
      last edited by

      On 12/02/2013 at 11:22, xxxxxxxx wrote:

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

      ---------
      Hi,

      I have an xpresso node that I would like to enrich with some additional description elements. So I overload GetDDescription.

      As long as I do not change the "flags" everything is fine, but once I do set the loaded bit the original interface disappears!

      Bool XEditNode::GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags)
          { 
          	if (!description || !node) return FALSE; 
          	if (!description->LoadDescription(node->GetType())) return FALSE;
          	
          	flags |= DESCFLAGS_DESC_LOADED; //Without this, everything is fine..
          	return SUPER::GetDDescription(node, description, flags);
          }
      
      Can this be confirmed? Is there a workaround? I am really needing this.. :-/  
        
      Thanks for any info!!  
      Best  
      Samir  
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 13/02/2013 at 01:39, xxxxxxxx wrote:

        Ehrm, actually just a question: Isn't the parent-call already loading the description-resource that
        was passed on registration? So you wouldn't need to call LoadDescriptionResource() yourself.

        Perhaps something like this works:

        	if (!description || !node) return FALSE; 
        	if (!SUPER::GetDDescription(node, description, flags)) return FALSE;  
        	
        	// Add your elements..
        	return TRUE;
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 13/02/2013 at 02:26, xxxxxxxx wrote:

          Hi Niklas,

          thx. The answer is simple, the docs suggest to load the description, set the flags and then call the parent at the end of the function. It's actually almost the same as the code example in the docs.

          ust modify the passed description object as you wish, set the appropriate flags and then make sure to include a call to the parent at the end

          it works fine in all my objects, shaders, videoposts etc. BUT not in xpresso nodes.

          Also it is not very safe to presume the parent, which I don't know the internal code for(!), does what I want (though yes, one could assume that if I do not overload GetDDescription that the parent is the one doing the LoadDescription() call...but in the end it's just a logic assumption not a fail-safe knowledge of mine so going the suggested way is the way to go and it should work).

          But the more striking argument is that if I set the new flag (which is the problem here...it's NOT the description loading itself) who is going to react to the flag change and distributes an according info to the other nodes in the scene? My object doesn't so I assume one of the parent nodes? maybe the root nodedata? And that could be missing if I do not call my parent at the end after the flag change! (possibly resulting in something not updating..and which is not apparent to me directly)

          I currently simple do not set the flag. It works, the description does not disappear, but is it safe and valid? I don't like "gaps" in my code safety.

          Anyway, it would be great if the support could take a quick look so I can try something else or keep the hacking (as you NiklasR suggested too) or simply go on in development.

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