Hi Here are my 2cents...
The commandPort is kind of like a specialized application running to specifically expose the command API (MEL or Python). I would say if your goal is to control Maya through its own API, then the commandPort is meant for that and is the easiest because it is automatically served for your by Maya. You can also open the commandPort on different port numbers, if you need to run more than one Maya. How you orchestrate them choosing their port at startup is a something you would have to figure out. But it is the same problem you would have with tcp or http since applications must bind to unique ports on a host. The downside of the commandPort is that it is clunky for anything specialized. Between ZeroMQ or http, or even plain raw sockets, they kind of fall into the same group and I think it would just be a matter of who you want to expose a service to. If we agree on my previous point about the commandPort being a ready-made access to the Maya commands api, then it means tcp/http would be lower level and that you would have to do more work to get to the same point as the commandPort. That being said, I think it is much better suited for writing specialized access for a custom application that intends to use its own protocol as opposed to control Maya through its API. ZeroMQ happens to have a lot of neat tools to express different communication patterns. In some use-cases it could be interchangeable for an http interface. So all in all, I would say that a tcp/ZeroMQ/http/RESTful interface into Maya may only be useful if it is solving a specific application's implementation. Otherwise it would just be replicating something that is already there in the commandPort. And if you really wanted to export the Maya commands interface over http, you could probably get away with much less work than exposing a full coverage RESTful interface, by just accepting http requests to a certain port, with a defined json format, that could be dynamically mapped to the commands API. You probably don't even need flask for it. - Justin On Mon, Nov 3, 2014 at 10:38 PM, Marcus Ottosson <[email protected]> wrote: > Hi all, > > Is there any interest in a RESTful interface to Maya? > > The idea would be to facilitate external access of Maya from things like > Web Applications or externally running GUIs. > > I mocked up a minimal example of how it could look here: > > - https://github.com/abstractfactory/RestMEL > - https://github.com/abstractfactory/RestMEL/tree/master/restmel/demo > > # List all nodesimport requestsprint > requests.get("http://127.0.0.1:6000/node").text > > The Demo includes an externally running QML application. > > Alternatives > > What would be the benefits of something like this over the native > commandPort or ZeroMQ and c/o? > > - commandPort uses the same port for multiple instances of Maya, > causing only the first instance to get exposed. Can this be remedied? What > else is there about the commandPort that could be better? > - ZeroMQ relies on a binary library and isn’t as supported as plain > HTML. Meaning a web application could gain access to Maya via native > commands, whereas talking to a ZMQ server requires third-party binaries. > > Thoughts? > > Best, > Marcus > > -- > *Marcus Ottosson* > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODWwbwoQyVE1o_f0LvcC2DF%3Dfv1bCVA8vznHet8wqBy%3DA%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODWwbwoQyVE1o_f0LvcC2DF%3Dfv1bCVA8vznHet8wqBy%3DA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA19RLh1KavB%2BLg_CeBaSeR58FwaEXrh9gkQXUiy34Fc%2BA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
