There seems to be issues when running this through maya 2022. I tested with maya 2020 and it works just fine, but 2022 blocks at an error code and can't send through commands to Maya.
First time around: See code output in script editor along with error code
Any further attempts: Error code
Expected behavior
Command output in the script editor
Result
# TypeError: a bytes-like object is required, not 'str'
# ----------------------------------------
# ----------------------------------------
# Exception happened during processing of request from('127.0.0.1', 50484)
# Traceback (most recent call last):
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 720, in __init__
self.handle()
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\site-packages\maya\app\general\CommandPort.py", line 134, in handle
self.wfile.write(self.server.commandMessageQueue.get() + self.resp_term)
# # File "C:\Program Files\Autodesk\Maya2022\Python37\lib\socketserver.py", line 799, in write
self._sock.sendall(b)
Additional context
The code did go through once, but I couldn't get it to print "hello" after, even after rebooting maya, visual studio code and resetting the port using the command found in visual studio code when I close maya:
commandPort -n "localhost:7001" -stp "mel" -echoOutput;
Settings
Windows
Edition: Windows 10 Home
Version: 21H2
OS build: 19044.1706
Description
There seems to be issues when running this through maya 2022. I tested with maya 2020 and it works just fine, but 2022 blocks at an error code and can't send through commands to Maya.
To Reproduce Steps to reproduce the behavior:
print("hello")
Expected behavior Command output in the script editor
Result
Additional context The code did go through once, but I couldn't get it to print "hello" after, even after rebooting maya, visual studio code and resetting the port using the command found in visual studio code when I close maya:
commandPort -n "localhost:7001" -stp "mel" -echoOutput;
Settings
Windows Edition: Windows 10 Home Version: 21H2 OS build: 19044.1706
Maya Version: Autodesk MAYA 2022
MayaCode Version: v1.5.0