Mm, it did not work for me, the message was still not triggered even with a message ID higher than ID_TREEVIEW_FIRST_NEW_ID.
I managed in a different way with PluginMessage and c4d.GePluginMessage
But contrarely to what say doc, it's not the easiest way if you want to pass some data lol, the data received from PluginMessage is not an object but a PyCapsule object.
Here is how I retreived the original data object, it's not very elegant but it works :
import ctypes
import _ctypes
def getObjectFromCapsule(capsule):
ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p
ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py_object, ctypes.c_char_p]
pointer = ctypes.pythonapi.PyCapsule_GetPointer(capsule, None)
return _ctypes.PyObj_FromPtr(pointer)
def PluginMessage(id, data):
if id == MY_UNIQUE_ID :
o = getObjectFromCapsule(data)
o['foo'] = 'bar'
return True
return False
And then in my other plugin :
o = {}
print(c4d.GePluginMessage(MY_UNIQUE_ID, o)) # {'foo': 'bar'}