Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maya 2023 bug #33

Open
xc278260759 opened this issue Jun 2, 2022 · 7 comments
Open

maya 2023 bug #33

xc278260759 opened this issue Jun 2, 2022 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@xc278260759
Copy link

xc278260759 commented Jun 2, 2022

maya 2023 bug
Snipaste_2022-06-02_19-31-15

@artbycrunk artbycrunk self-assigned this Jun 7, 2022
@artbycrunk artbycrunk added the question Further information is requested label Jun 7, 2022
@artbycrunk
Copy link
Owner

HI @xc278260759

try using this command instead

commandPort -n "localhost:7001" -stp "mel";

check this thread as well for resolution #25

@fislysandi
Copy link

i tried above command you said. didnt help

maya_cNw5sRaPKU

@mosadegh22
Copy link

In Maya 2023 have problem in socket port .
Please check.

@IlayaRG
Copy link

IlayaRG commented Oct 17, 2022

In Maya 2023 have problem in socket port . Please check.

How to Check that?

@kristafervale
Copy link

kristafervale commented Feb 25, 2023

Did anyone ever fix this issue? I'm having the same problem in Maya 2023:
commandPort -name "localhost:7001" -sourceType "mel";

# ----------------------------------------
# Exception occurred during processing of request from ('127.0.0.1', 59185)
# Traceback (most recent call last):
# #   File "F:\Program Files\Autodesk\Maya2023\Python\lib\socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
# #   File "F:\Program Files\Autodesk\Maya2023\Python\lib\socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
# #   File "F:\Program Files\Autodesk\Maya2023\Python\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
# #   File "F:\Program Files\Autodesk\Maya2023\Python\lib\socketserver.py", line 747, in __init__
    self.handle()
# #   File "F:\Program Files\Autodesk\Maya2023\Python\lib\site-packages\maya\app\general\CommandPort.py", line 134, in handle
    self.wfile.write(self.server.commandMessageQueue.get() + self.resp_term)
# #   File "F:\Program Files\Autodesk\Maya2023\Python\lib\socketserver.py", line 826, in write
    self._sock.sendall(b)
# TypeError: a bytes-like object is required, not 'str'
# ----------------------------------------

@kristafervale
Copy link

I have an update on what I found after doing a little digging around in Maya's source scripts.

in the file
F:\Program Files\Autodesk\Maya2023\Python\Lib\site-packages\maya\app\general\CommandPort.py

On line 134, as an experiment I changed it

from:
self.wfile.write(self.server.commandMessageQueue.get() + self.resp_term)

to:

self.server.commandMessageQueue.get() + self.resp_term
#self.wfile.write()

effectively telling it to go ahead and execute the message in the commandMessageQueue but don't do the self.wfile.write().

And wouldn't you know it, after reloading Maya everything worked as expected.

print("hello world")
outputted to the output just fine,

and
cmds.sphere(r=1,n="hell_world_sphere")
created a nurbs sphere called hello_world_spehre as expected.

I'm not sure what you will have to do to update your extension, obviously we can't all edit our Maya source code to make this work, but hopefully this will lead you in the right direction?

@ofekdavid
Copy link

you helped me better then ChatGPT :O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants