OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

Resolve: Match folder structure to other hosts

Open iLLiCiTiT opened this issue 2 years ago • 3 comments

Brief description

Make sure that code related to in-DCC logic is not imported in main host directory. This change gives ability to have resolve as module which is not possible at the moment.

Description

Changed all import to point directly to function locations or to openpype.hosts.resolve.api instead of openpype.hosts.resolve. Moved setup function from in-DCC functions to public code because is used in prelaunch hook.

Additional info

I don't have resolve so all changes are made blindly, please report any issues. Current structure would block development of some features thus this changes are needed to move on.

There is a lot of script files that seems to be duplicated or not used, we should consider remove those unused.

Testing notes:

  1. Resolve should work at least the same as before this PR

Resolves https://github.com/pypeclub/OpenPype/issues/3406

iLLiCiTiT avatar Aug 11 '22 17:08 iLLiCiTiT

I would love to check, but I am not able to make the Resolve work. Attempt to run Openpype_Menu script stops at importing OTIO:

    from opentimelineio import opentime
  File "C:\Users\robur\OpenPype\.venv\Lib\site-packages\opentimelineio\__init__.py", line 35, in <module>
    from . import (
  File "C:\Users\robur\OpenPype\.venv\Lib\site-packages\opentimelineio\opentime.py", line 1, in <module>
    from . _opentime import ( # noqa
ModuleNotFoundError: No module named 'opentimelineio._opentime'

Resolve 17.4.6 build 4 Python 3.6 Windows 10

jrsndl avatar Aug 15 '22 11:08 jrsndl

I would love to check, but I am not able to make the Resolve work. Attempt to run Openpype_Menu script stops at importing OTIO:

    from opentimelineio import opentime
  File "C:\Users\robur\OpenPype\.venv\Lib\site-packages\opentimelineio\__init__.py", line 35, in <module>
    from . import (
  File "C:\Users\robur\OpenPype\.venv\Lib\site-packages\opentimelineio\opentime.py", line 1, in <module>
    from . _opentime import ( # noqa
ModuleNotFoundError: No module named 'opentimelineio._opentime'

Resolve 17.4.6 build 4 Python 3.6 Windows 10

You have to install OpenTimelineIO separately into p3.6. The process should be explained in documentation I believe.

jakubjezek001 avatar Aug 17 '22 09:08 jakubjezek001

@iLLiCiTiT please also fix the pep8 before the merge ;)

jakubjezek001 avatar Aug 17 '22 15:08 jakubjezek001

please also fix the pep8 before the merge ;)

I can't. It's because the imports are after definition of bmdvr and bmdvf, but they must be defined before those imports because are replaced during that time. To fix it I would have to move those global variables elsewhere and change all related imports.

iLLiCiTiT avatar Aug 17 '22 16:08 iLLiCiTiT