On 26/08/2014 at 09:36, xxxxxxxx wrote:
So I managed to get this to work! After finding A post HERE. I Knew that it was possible but there was no way to sift through that amount of data in an efficient was.
So checking the C++ documentation I found that p1 and p2 actually stand for c4d.BFM_CORE_PAR1 and c4d.BFM_CORE_PAR2 this resulted in much excitement! :smile:
I was then able to get somewhere and I feel this kind of information should be included in the docs and freely available. So I hope this will help anyone in the future trying to do the same thing and with that share their own findings.
So here's how to make it work...
Outside of the plugin: (In this case p1 is either 1 or 2 but can be any integer)
c4d.SpecialEventAdd(PLUGIN_ID,p1 = 1)
Within the plugin:
def CoreMessage(self, id, msg) :
if id == PLUGIN_ID:
# Get the Void Container
P1MSG_UN = msg.GetVoid(c4d.BFM_CORE_PAR1)
# Get the actual data (This is beyond my knowledge but it works!)
pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]
P1MSG_EN = pythonapi.PyCObject_AsVoidPtr(P1MSG_UN)
if P1MSG_EN == 1: # If p1 = 1
if P1MSG_EN == 2: # If p1 = 2
#Do Something else