Catch document and c4d object messages



  • On 31/10/2015 at 10:04, xxxxxxxx wrote:

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

    ---------
    Hello.

    Is there any way to catch all of document's triggered events ?
    I know that with the CoreMessage in dialogs, you can handle a lot of triggered messages.
    Can i do that without a dialog ?

    1) What i need is to know when the user moves around the bar in animation track of the document.
    I need to handle this event separately.

    2)  I have created a tag plugin which can be applied on camera objects. My tag plugin has to know when the user changes the camera object's projection settings.

    Thank you for your time.



  • On 01/11/2015 at 06:24, xxxxxxxx wrote:

    Howdy,

    A MessageData plugin can receive Core Messages.

    Adios,
    Cactus Dan





  • On 01/11/2015 at 15:34, xxxxxxxx wrote:

    Hello and thank you for your answers.

    Niklas, if i add an event notification to a camera object, will i be able to redirect the events that are related to its parameter modification to other objects ?

    Thank you for your time.



  • On 01/11/2015 at 15:36, xxxxxxxx wrote:

    Hello and thank you for your answers.

    Niklas, if i use the AddEventNofitication to any object, will i be able to redirect the events related to its parameter modification towards other objects ?

    thnx.



  • On 02/11/2015 at 02:36, xxxxxxxx wrote:

    Hello,

    the AddEventNotification() function is marked as private. This means that this function is only meant for internal use and may not be suitable for external developers.

    Best wishes,
    Sebastian



  • On 02/11/2015 at 03:56, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Hello and thank you for your answers.

    Niklas, if i add an event notification to a camera object, will i be able to redirect the events that are related to its parameter modification to other objects ?

    Thank you for your time.

    You can forward the message in whatever way you want, but that would usually not be necessary.
    For the first parameter to AddEventNotification(), you pass in the object that should receive all the
    messages of the object you called the method upon.

    camera->AddEventNotification(myTag, NOTIFY_EVENT_MESSAGE, NOTIFY_EVENT_FLAG_0, nullptr);
    

    Then the "myTag" will receive messages with the ID MSG_NOTIFY_EVENT which will be passed a
    NotifyEventData data pointer.

    Originally posted by xxxxxxxx

    Hello,

    the AddEventNotification() function is marked as private. This means that this function is only meant for internal use and may not be suitable for external developers.

    Best wishes,
    Sebastian

    For non-obvious reasons, it's pretty useful. 🙂



  • On 02/11/2015 at 06:13, xxxxxxxx wrote:

    Hello !

    To avoid using AddEventNotification, here is what i think as alternative:

    Use a MessageData Plugin to catcher core messages.
    On EVMSG_DOCUMENTRECALCULATED, check which c4d objects are dirty and update the data to other objects.

    Is this the right way ?

    Thank you.



  • On 02/11/2015 at 09:51, xxxxxxxx wrote:

    Hello,

    so you have a TagData plugin attached to the camera? Why don't you check the camera's parameters in the tag's Execute() function?

    Best wishes,
    Sebastian()


Log in to reply