--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c7179212-45b6-4d11-ac56-fec98e67fa31n%40googlegroups.com.
Okay, but I'm still aimless, lolwhat I have and I don't know if something answers what it says would be the poath configured for Maya and the other for Houdini.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c0314e9b-9b0b-472b-82fd-5fc5bfaeba53n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0GKDZNnGmoGdwGB8z5nY__Eq9K14C%3DxzJKQfkf1EB0%2Bw%40mail.gmail.com.
Justin,You're now a Unity employee? ;-)Big news!!
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5aRp83uPHjJPO-4mJf6iQNgQ%2Bzdiff_QW3puzgjGUVbLQ%40mail.gmail.com.
Sorry for the delay, I've been very busy !!!I need to work externally with Maya and Houdini at the same time.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9631c354-b551-4e5d-a8a7-b2ea66eccf23n%40googlegroups.com.
I wonder whether wires have been crossed, and that the question isn’t about accessing Maya and Houdini libraries from one process, but one process calling out to both Maya and Houdini?
For example, is this what you want?
import hou
from maya import cmds
cmds.displayWarning("I'm Maya, and this is a Houdini node: %s" % hou.node("/obj"))
Or this?
import subprocess
maya_exe = r"c:\program files\autodesk\maya2022\bin\mayapy.exe"
houdini_exe = r"c:\program files\sidefx\houdini16.0\bin\hpython.exe"
pymel_script = r"c:\path\to\maya_script.py"
houdini_script = r"c:\path\to\houdini_script.py"
subprocess.call("%s -m %s" % (houdini_exe, houdini_script))
subprocess.call("%s -m %s" % (maya_exe, maya_script))
The first example will most likely be very unstable; both Maya and Houdini will have assumed they are the only ones loading libraries into the process. It’d be like having both Qt 5.4 and 5.12 imported at the same time. Technically possibly, probably, but probably not a good idea.
The second example would allow you to write your two scripts that automate Maya and Houdini separately, and trigger both of them from a terminal. My impression is that this is what you’re looking for.
Yes it wasn’t meant to run, it was meant to communicate an idea. :) Does it make sense what it’s trying to do? Is it what you are looking for? If so, subprocess
is the right module to accomplish this task. And, it’s possible you can remove the -m
and it may just work as-is.