Maya Addon Error during Publish

Hi,

Development & Testing Environment
windows 10
Maya 2023, 2024

  • The workfile & create GUI are working well.
  • During publish, when the Extract PointCache is executing it results in an error (below)

Does anyone have any ideas or pointers on how we can solve this ?

DEBUG: Extracting pointcache..
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402131938_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\admin\AppData\Local\Ynput\AYON\addons\openpype_3.18.5\openpype\hosts\maya\plugins\publish\extract_pointcache.py", line 89, in process
    with suspended_refresh(suspend=suspend):
  File "C:\Program Files\Autodesk\Maya2023\Python\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "C:\Users\admin\AppData\Local\Ynput\AYON\addons\openpype_3.18.5\openpype\hosts\maya\api\lib.py", line 141, in suspended_refresh
    original_state = cmds.ogs(query=True, pause=True)
RuntimeError: Maya command error

Thank you,
Ashish

The cmds.ogs(query=True, pause=True) should be a fine command to run, but for some reason it fails for you.

Could it be that you have some viewport customizations? Maybe you are not using Viewport 2.0 but a legacy viewport? If so, do you know how by code to detect the viewport that’s in use?

Thank you BigRoy

I was accessing the systems via RDP. Once I switched over to them natively / using DCV the error went away.

Best Regards,
Ashish

I recall seeing there being a Maya environment variable which might resolve this for RDP.

You can try: MAYA_ALLOW_OPENGL_REMOTE_SESSION=1.

See: Using Maya with Windows Remote Desktop Connection

However, that seems to force OpenGL instead of DirectX11 - if that solves it we might want to do some more DirectX11 tests to see if the code works as intended.

Anyway, if you have a high need for RDP here then definitely debug some more and report back. Potentially there’s something we can do to fix things. E.g. we might be able to ignore or detect the state for cmds.ogs calls in better ways for these edge cases.