GetDDescription of a GVoperator Node disappears
-
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
-
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;
-
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.