mikedatsik / tk-cinema

Shotgun Toolkit Engine for Maxon Cinema 4D https://www.maxon.net
Other
17 stars 12 forks source link

R23 compatablility #8

Closed JH-FP closed 3 years ago

JH-FP commented 3 years ago

Hello, I'm looking to get this working with R23, at the moment it doesn't. After correcting for the Python 3 syntax difference, C4D just says that it can't import sgtk as no such module if found. And yet this exact code wrks fine back in R21. Any ideas whats going on and what can be done about it? Thanks very much.

mikedatsik commented 3 years ago

Hi! I glad to hear, that someone uses my Cinema 4D plugin. I know that Shotgun and Cinema 23 uses python 3 from now, I even had a thought to rework my plugin for new python build.

But for a half year I worked at another company and don’t have access to shotgun and Cinema to continue development. If you have some questions, I will try to helf If I can.

Answering to your question, I think that Cinema in 23 version change something in plugin load process, and we need make some research to find what exactly have changed.

JH-FP commented 3 years ago

Hi,

OK, some I made some mild progress. I can get round the ‘can’t import’ sgtk bit by specifically adding the python folder within the project to my path. Although I’m not actually sure that this bypass is a good ideas, as I then get these errors instead (again only in R23, R21 is still fine. so I don’t understand whats being dealt with differently between the two):

Fri Feb 26 17:09:09 2021 - Shotgun Debug | Cinema engine | Debug: Shotgun tk-cinema: Cinema on Windows can deadlock if QtWebEngineWidgets is imported. Setting SHOTGUN_SKIP_QTWEBENGINEWIDGETS_IMPORT=1... Fri Feb 26 17:09:09 2021 - Shotgun Debug | Cinema engine | Debug: Shotgun tk-cinema: PySide2 not detected - trying for PySide now... Fri Feb 26 17:09:09 2021 - Shotgun Debug | Cinema engine | Debug: Shotgun tk-cinema: PySide not detected - it will be added to the setup now... PySide2/init.py: Unable to import shiboken2 from C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37, C:\Users\jhudson\AppData\Roaming\Maxon\Maxon Cinema 4D R23_DBA5903C\python37, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\lib, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\dlls, C:\Program Files\Shotgun, C:\Users\jhudson\AppData\Roaming\Maxon\python37\libs, C:\Users\jhudson\AppData\Roaming\Maxon\Maxon Cinema 4D R23_DBA5903C\python37\libs, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\lib\site-packages, V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python, C:/Program Files/Shotgun\Python\Lib\site-packages Fri Feb 26 17:09:09 2021 - Shotgun Debug | Cinema engine | Debug: Shotgun qt_importer: Requesting Qt4-like interface PySide2/init.py: Unable to import shiboken2 from C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37, C:\Users\jhudson\AppData\Roaming\Maxon\Maxon Cinema 4D R23_DBA5903C\python37, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\lib, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\dlls, C:\Program Files\Shotgun, C:\Users\jhudson\AppData\Roaming\Maxon\python37\libs, C:\Users\jhudson\AppData\Roaming\Maxon\Maxon Cinema 4D R23_DBA5903C\python37\libs, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\lib\site-packages, V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python, C:/Program Files/Shotgun\Python\Lib\site-packages Fri Feb 26 17:09:09 2021 - Shotgun Error | Cinema engine | Shotgun tk-cinema: Default engine QT definition failed to find QT. This may need to be subclassed. Traceback (most recent call last): File "V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python\tank\platform\engine.py", line 2139, in _define_qt_base importer = QtImporter() File "V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python\tank\util\qt_importer.py", line 51, in init ) = self._import_modules(interface_version_requested) File "V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python\tank\util\qt_importer.py", line 369, in _import_modules pyside = self._import_pyside() File "V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python\tank\util\qt_importer.py", line 180, in _import_pyside self._to_version_tuple(QtCore.qVersion()), AttributeError: 'NoneType' object has no attribute 'qVersion' Fri Feb 26 17:09:09 2021 - Shotgun Debug | Cinema engine | Debug: Shotgun qt_importer: Requesting Qt5-like interface PySide2/init.py: Unable to import shiboken2 from C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37, C:\Users\jhudson\AppData\Roaming\Maxon\Maxon Cinema 4D R23_DBA5903C\python37, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\lib, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\dlls, C:\Program Files\Shotgun, C:\Users\jhudson\AppData\Roaming\Maxon\python37\libs, C:\Users\jhudson\AppData\Roaming\Maxon\Maxon Cinema 4D R23_DBA5903C\python37\libs, C:\Program Files\Maxon Cinema 4D R23\resource\modules\python\libs\python37.win64.framework\lib\site-packages, V:\pipeline\shotgun\sgtk_configs\c4d_test\install\core\python, C:/Program Files/Shotgun\Python\Lib\site-packages Fri Feb 26 17:09:09 2021 - Shotgun Debug | Cinema engine | Debug: Shotgun qt_importer: No Qt matching that interface was found. Traceback (most recent call last): File "V:\resource\users\Jon H\PyCharmProjects\tk-cinema-master\startup\shotgun.pyp", line 179, in register_plugins() File "V:\resource\users\Jon H\PyCharmProjects\tk-cinema-master\startup\shotgun.pyp", line 167, in register_plugins for item in engine.import_module("tk_cinema").constant_apps.menu_prebuild: AttributeError:'NoneType' object has no attribute 'import_module'

So now it’s complaining about shiboken2 and Qt stuff.

You may well be right that R23 is handling plugins differently and thats cuasing issues.

mikedatsik commented 3 years ago

@JH-FP, @danbradham I’ve merged you pr in my tk-cinema repository. It’s very cool that you made python3 capability. I will try to touch to shotgun-cinema setup in nearest week, maybe I will find some issues. Anyway thanks for you contribution in this stuff.