Overload MPxNode::legalConnection in Python

Overload MPxNode::legalConnection in Python

Anonymous
Not applicable
259 Views
1 Reply
Message 1 of 2

Overload MPxNode::legalConnection in Python

Anonymous
Not applicable
Hi,

I've got a scripted plug-in with a custom node. I need to overload MPxNode::legalConnection(), but I am not sure how to set the value of the boolean isLegal parameter to indicate whether or not the connection is valid. It looks to be some kind of SWIG wrapped pointer value

Any help would be greatly appreciated!
0 Likes
260 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Okay...a little searching the answer lies in the ctypes module:


import ctypes

def legalConnection(self, plug, otherPlug, asSrc, legal):
pLegal = ctypes.cast(legal.__long__(), ctypes.POINTER(ctypes.c_bool))
pLegal = False
0 Likes