Hi @ferdinand,
As always thank you very much for the detailed answer. Please mind that I'm not a seasoned programmer at all, not even a programmer. That doesn't excuse anything, but there are likely many mistakes in my messages.
Thank you for reaching out to us. I must point out that your question is out of scope of support because you are using Corona. Thrid party libraries are out of scope of support as declared in our Forum Procedures. Please understand that we cannot run, debug, or help you with foreign APIs.
I know that Corona is out of the scope of this forum since I've already posted some questions about it, and we already discussed about it. But the objects and data particular to Corona are based on the class and methods of the Cinema 4D API as far as I can tell. If it is still out of scope let me know. I've already mailed the Corona devs and had a bit of help few years ago but that's all. I made a diagram recently that shows how the Node Editor is integrated through the API.
Messages
Thanks for the explanation regarding messages, but I still don't get it. I think it doesn't make sense to me that I have to tell Cinema something has changed since something has really changed ( = through the interpreted Python code) from my point of view when executing the code. My lack of programming background maybe doesn't help me here.
So in most cases, messages are used to trigger UI events / updates?
How do I know if I have to send a message or not to an object to update it ( or it's representation in the current document )?
How should I leverage CommandData.Message() and what is the difference with calling C4DAtom.Message / SendCoreMessage in Execute ? I'm really puzzled here.
What is more likely going wrong here, is how you assemble your shader graph. For your first plugin, this little stretch of code is trying to do a lot all at once. And especially when I would run into problems, I would try to reduce that. In play comes here then how the Corona API works. It is probably best when you ask the Corona team for help with that.
It's quite possible, but the thing is the code do exactly what I want (inserting a filter shader on top of any selected shader). But maybe I take too many shorcuts or that things are done in a unorthodox way. What would be the proper way to do this ? Split what's happening in Execute into multiple methods ?
¹ An added event will not be carried out right away but when the event queue is resolved. I.e., having one EventAdd at the end of your operation is equivalent to having multiple calls in one operation. EventAdd will only be carried out once you give control back to Cinema 4D.
Is it a problem ? The command is really simple and linear, really it's just a script wrapped in a class' method.
CommandData plugins also call EventAdd on their own after their Execute ran, so you do not have to do it yourself.
I suspected that but I don't get the same result if I comment out EventAdd. Ui doesn't update and links are missing on the node widgets. So what's happening here ?