Search code examples
pythonreal-timemaya

Sending single commands to a maya node


I'm planning on creating a maya node that pulls some input from a serial port or some other kind of real time input. Each time I wish to receive input I must have an open connection to a unix file like unix, so far so simple.

My question is this, how do I send the maya node a one time command like connect or disconnect. I only know how to set up a simple 'attribute effects' stye relationship between attributes which isn't quite right for this situation. The only solution i could think of would be to add a non animatable boolean attribute to the node and run the connect disconnect methods whenever that attribute was changed, does this seem like a sensible solution?


Solution

  • If your goal is to support an external controller, there are a lot of examples on the net that use the commandport as an interface to external controllers. The clockServer example that comes with the Maya SDK shows how it can be done; and as an example of how to conver that into There's also Dave Moore's hacked up Xbox 360 controller server based on the clock server here that might give you an idea how to tackle it.