Python rpc

Any help on how to setup rpc to accept data from houdini?
I tried copying a houdini module to the maya C:\Program Files\Autodesk\Maya2011\Python\Lib\site-packages directory

but tells me no module named_hou

any solutions? would require someone to help me out.thank you

Can you use something like ZeroMQ to set up a communication? Or if you want to try something not-as-good-but-very-simple, look at the SimpleXMLRPCServer examples for python. If that doesn’t serve your needs, please be more clear with what you need.

Hi,

You can use rpyc, this module is included by default in Houdini. I have used it for live connection between Maya and Houdini.

create a pythonrc.py file containing:

import houxmlrpc
houxmlrpc.run(port=8888)

and place that in the side effects software/houdini######/houdini/python2.6libs folder. this wil open houdini with port 8888 open

and in maya use this while houdini is open:

sys.path.append( ‘C:/Program Files/Side Effects Software/Houdini######/houdini/python2.6libs’ )
import houxmlrpc
hou = houxmlrpc.ServerProxy( ‘http://localhost:8888’ ).hou

hou is then the module like it is used in houdini, hope this clears it up

#####= houdini version number

no i basically would live to implement live connection between houdini and maya.

what all do we need to learn in achieveing this?
do we need to understand threads? and any other concepts?please share your knowledge.
is there any good resources on remote procedures calls with python/

So I just saw this, but that’s an interesting idea.
I imagine that every command needs to have a translation to a similar houdini command and they both get executed simultaneously?
Or is there something simpler behind it all?

Vifx, don’t get too far into your head. Yes you will need to understand threads and IPC. Are you sure you are ready for something like this? Maybe pick something more people have done and that is less incredibly difficult?

I am trying to setup the zeroMQ to try and test some stuff with Maya 2011, but I seem to have some issue importing the zmq package.
I downloaded the windows installer of zmq for python version 2.6 and pasted it in the maya python site-packages folder but I am having trouble both with the 32bit and 64bit version of zmq (I got both the 32 and 64bit installer for zmq).

import zmq
# Error: DLL load failed: The specified procedure could not be found.
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "C:\Program Files (x86)\Autodesk\Maya2011\Python\lib\site-packages\zmq\__init__.py", line 35, in <module>
#     from zmq import core, devices
#   File "C:\Program Files (x86)\Autodesk\Maya2011\Python\lib\site-packages\zmq\core\__init__.py", line 26, in <module>
#     from zmq.core import (constants, error, message, context,
# ImportError: DLL load failed: The specified procedure could not be found. # 

I would assume I am having some version mismatch somewhere between the compiled modules of zmq and maya’s python version?

edit: nvm, it seems I managed to get something to compile after hunting down a full visual studio and setting up the proper env variables in order to compile the python bindings properly.

[QUOTE=greuh;14054]I am trying to setup the zeroMQ to try and test some stuff with Maya 2011, but I seem to have some issue importing the zmq package.
I downloaded the windows installer of zmq for python version 2.6 and pasted it in the maya python site-packages folder but I am having trouble both with the 32bit and 64bit version of zmq (I got both the 32 and 64bit installer for zmq).

import zmq
# Error: DLL load failed: The specified procedure could not be found.
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "C:\Program Files (x86)\Autodesk\Maya2011\Python\lib\site-packages\zmq\__init__.py", line 35, in <module>
#     from zmq import core, devices
#   File "C:\Program Files (x86)\Autodesk\Maya2011\Python\lib\site-packages\zmq\core\__init__.py", line 26, in <module>
#     from zmq.core import (constants, error, message, context,
# ImportError: DLL load failed: The specified procedure could not be found. # 

I would assume I am having some version mismatch somewhere between the compiled modules of zmq and maya’s python version?[/QUOTE]

i dont know the answer to this problem, but it might be better to post it in a separate topic as most people assume this is relevant to python rpc which is a python connection module and this is a python library related error

[QUOTE=peerke88;14064]i dont know the answer to this problem, but it might be better to post it in a separate topic as most people assume this is relevant to python rpc which is a python connection module and this is a python library related error[/QUOTE]
sensible point, I’ll open a new thread about that

I couldn’t find any other thread, but I came across the same problem. Seems something is wrong with the dll in the Python 2.6. 0MQ installer.
I compiled the module myself using VC Express 2008 / Python 2.6 x86 and it worked (make sure the dll is in the path and can be found). Takes about 5 mins in total.

C++ source used: http://download.zeromq.org/zeromq-2.2.0.zip
Python source used: https://github.com/zeromq/pyzmq/downloads/pyzmq-2.2.0.zip

Then pretty much follow the instructions on the 0mq website:

  • In Visual C++ open the solution builds\msvc\msvc.sln.
  • Build the solution.
  • ØMQ libraries will be in the lib subdirectory.
  • on the command line change to where pyzmq is and run (set up your python build environment before that):
    > python setup.py configure --zmq=<wherever-the-0mq-src-is>\zeromq-2.2.0
    > python setup.py install

hope that helps :slight_smile: