Message sent when Document changes?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/01/2011 at 05:07, xxxxxxxx wrote:

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

    ---------
    Okay, it's probably obvious but I just can't find it:

    What message is sent to a dialog when a Document changes? (e.g. User loads new document, or switches to another (loaded) document through the Window menu.)

    I have data stored in the BaseDocument in a container, and a dialog that displays that data. The dialog needs to update itself when the document changes. But there is no Message or CoreMessage that looks as if it's modeling that event, and I don't want to waste processing time with a too-general event that is triggered by a huge number of other actions.

    Tried to find the Message by simple tests, but there are so many sent...



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/01/2011 at 09:59, xxxxxxxx wrote:

    MSG_DOCUMENTINFO should be the one.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/01/2011 at 15:16, xxxxxxxx wrote:

    Thanks! That is probably the one...

    Unfortunately, I cannot receive it. As far as I tested it, this message is only sent to descendants of C4DAtom. Neither the GeDialog nor the defining class for the command plugin, CommandData, have message methods that can receive this id - neither of them is derived from C4DAtom.

    While BasePlugin is derived from C4DAtom, I do not subclass this class directly but get it as result of the registration, giving me no chance to override the Message() method. PluginMessage() does not get the MSG_DOCUMENTINFO.

    Command, Message and CoreMessage in the GeDialog do not receive MSG_DOCUMENTINFO as far as I can see (and have a different signature).

    CommandData's Message() method does have the correct signature but does not receive a MSG_DOCUMENTINFO either. (According to the docs, it only ever receives two different messages.)

    I'm quite at a loss here. It looks as if only objects from the object tree can receive MSG_DOCUMENTINFO, and I don't have these available, just a dialog and the plugin itself.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 02/01/2011 at 17:27, xxxxxxxx wrote:

    Use a message plugin to receive the message and send it over to your commanddata or gedialog CoreMessage overloaded member function with a SpecialEventAdd().

    Should work.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/01/2011 at 05:21, xxxxxxxx wrote:

    Hmm, the message plugin doesn't get MSG_DOCUMENTINFO either (tested). According to the documentation, it's all EVMSG_ messages.

    The only message function that really receives MSG_ messages seems to be the one in the NodeData. This, however, would require an object tree object. If you only register the plugin and have its user-functionality invisible, so its objects will never get instantiated, then the message handler doesn't get called (again, tested). Seems as if the handler is only called within the object tree, with the actual plugin objects as parameter.

    I may be able to work through a PrefsDialogData plugin (despite not having any preferences...). This is derived from NodeData, and it doesn't require a tree object apparently (let's see whether it needs to be shown in the preferences dialog). Well, I'll try that and post a final solution here if it works...



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/01/2011 at 05:27, xxxxxxxx wrote:

    I think a scene hook may then be the better alternative.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/01/2011 at 12:44, xxxxxxxx wrote:

    You're right, this may be preferrable. I'll try the Scene Hook... thanks...


Log in to reply