Conflict between scripts using a named pipe and engine

   1928   2   0
User Avatar
Member
9 posts
Joined: Nov. 2017
Offline
I've have been having a conflict with the houdini engine plugin in maya and some of my python scripts I use for batching solutions.
I've kind of run out of ideas to resolve the conflict I'm finding.

My personal scripts, just like houdini engine, use a named pipe to communicate with a second instance of maya from time to time.
Usually this is used to mess with copies of currently open maya files or handle a bunch files of related to the currently open in mayaUI file.

However, whenever the houdini engine plugin is active or has been active it seems my scripts are incapable of creating a pipe of their own.
Initially I thought "Well I can just unload the plugin and it will work again." But whatever is blocking this process doesn't go away once the plugin is unloaded after having been loaded.

For now I do not default load the plugin and only load it for a few set tasks that require houdini engine and do a full relaunch of maya when I need some of my scripted named pipe functions after using houdini engine.


Included in attachment is a rar isolating the section of scripts that the conflict occurs with.
To make it work on your set up you'll have to edit:
LaunchingScript.py line 4
Batch/BatchReceiver.py line 56

Both lines have a variable refering to the path these scripts are existing in. Turn it into the path you put it locally.

Run it once to see what happens when houdini engine hasn't been active yet. Normally a window will pop up and launch a second process in multithread and show some output. (may need about 20 seconds to start outputting depending on init time of maya)
Then load houdini engine and run the launching script again. Note that it is failing in InterProcessCom.py at line 231 when it is trying to querry the pipe connection for any output.

So with all that explained and a setup provided. Any advice to have both our systems play together nicely?

Edit:
I'm in maya 2018.7 (so python 2.7)
Using houdini Engine 18.5.462
Edited by toxkillfraex - May 18, 2021 07:57:29

Attachments:
BatchIssueTester.rar (20.2 KB)

User Avatar
Staff
463 posts
Joined: Aug. 2019
Offline
I believe this isn't a conflict between named pipes, but actually a weird quirk with the way that mayapy standalone has with DLL load order. Essentially, after loading the Maya plugin, it picks up Houdini's DLLs instead of Maya's, resulting in library conflicts. What you can do to get around the issue is force your script to load the correct DLLs before starting standalone.

Place the following before import maya.standalone as stin Standalone/__init__.py:

import ctypes
ctypes.cdll.LoadLibrary('C:/Program Files/Autodesk/Maya2019/Python/Lib/site-packages/maya/standalone.pyd')
User Avatar
Member
9 posts
Joined: Nov. 2017
Offline
johnmather
import ctypes
ctypes.cdll.LoadLibrary('C:/Program Files/Autodesk/Maya2019/Python/Lib/site-packages/maya/standalone.pyd')
This indeed works with the houdini plugin loaded

No more unexpected end of line on pipe reading

Thanks allot for the help. <3

edit: thinking about it this may even help with other naughty plugin issues I've had. =O
Edited by toxkillfraex - May 20, 2021 04:10:39
  • Quick Links