Hello @DronKozy,
Welcome to the Maxon developers forum and its community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.
- Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
- Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
- Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.
It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: How to Ask Questions.
About your First Question
I am afraid there is no really good way to do what you want to do. Without example code, I also have to somewhat guess what is going on. As lined out in our support procedures, we recommend to always accompany questions with compileable code.
I it is a bit fuzzy to me what you are doing, please tell me when I got it wrong. You have a BaseMaterial implementation which itself has LINK parameters which link to other materials. You now want to update MATPREVIEW parameter manually when your dependencies update.
Tracking Changes
Cinema generally follows an opt-out and not an opt-in update/message model. E.g., all objects get their GetVirtualObjects method called on each scene update, and it is then up to the object to decide if they actually want to update or just keep using their existing cache.
The evaluation of materials happens at render time, so there is no direct function which is called or message which is sent to your plugin when something in the scene is being updated. The messages you are using somewhat go into that direction, but you misunderstood a bit their purpose. MSG_UPDATE is sent when an external entity wants to inform a node that it modified dependent data and that the node should update its internal data (outside of the general scene state rebuild). It is not a message that is being sent each time the node has been updated. I could for example get a point object, modify its points, and then not send that message and that would be totally valid code. The object would only update once Cinema 4D reevaluates the object on its own, but sometimes this is desirable. For user interactions, Cinema 4D will usually send this message, but its purpose is still a bit different from what you think it is. The same goes for MSG_CHANGE.
The way to track changes in Cinema 4D, is the dirty system found on C4Datom. Cinema will usually automatically entail updates when the dirtiness of something changed, e.g., when a user changed the parameters of a node. The problem is that for LINK parameters (and also shader links), changes to the linked node do not count towards the data dirtiness of the node. Or in other words, Cinema does not consider a node A to be changed when the node B changed to which A links. For something like objects this is not really a problem due to the out-out update model, for material previews this means you can get event starved. The video below demonstrates the effect.