From f01747b8b0499830ffe052438b98b57e86fab120 Mon Sep 17 00:00:00 2001 From: Arda Kutlu Date: Sat, 20 Apr 2024 23:39:25 +0100 Subject: [PATCH] QT bind issue fixed for Katana when Renderman plugin loaded. --- docs/source/installation/katana.rst | 6 ++++-- tik_manager4/dcc/dcc_install.py | 2 ++ tik_manager4/dcc/katana/main.py | 1 - tik_manager4/dcc/katana/setup/how-to-install.txt | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/source/installation/katana.rst b/docs/source/installation/katana.rst index 4c3b9db7..6e480733 100644 --- a/docs/source/installation/katana.rst +++ b/docs/source/installation/katana.rst @@ -5,7 +5,7 @@ Katana Integration .. tip:: - In Windows, it usually is ``%userprofile%/.katana`` + In Windows, it is under ``%userprofile%/.katana`` 2. If it is not already exists, create `init.py` in startup folder and add the following lines: @@ -13,9 +13,11 @@ Katana Integration # Tik Manager 4 [Start] import sys + import os tik_path = "PATH/TO/PARENT/FOLDER/OF/TIKMANAGER4/" if not tik_path in sys.path: sys.path.append(tik_path) + os.environ["QT_PREFERRED_BINDING_JSON"] = '{"tik_manager4.ui.Qt": ["PyQt5"], "default":["PyQt5"]}' # Tik Manager 4 [End] 3. Replace ``PATH/TO/PARENT/FOLDER/OF/TIKMANAGER4/`` with the path of where the PARENT of tik_manager folder is. Use forward slashes between folder names. @@ -23,7 +25,7 @@ Katana Integration .. attention:: The Path MUST be the parent of the tik_manager4 folder. If you extracted the contents directly from the zip file it will be something like ``tik_manager4-4.0.1-alpha``. -4. In the same startup directory, locate the `shelves` folder and copy the entire `/tik_manager4/dcc/katana/setup/shelves` folder to the `shelves` folder. +4. In the same startup directory, locate the `shelves` folder and copy the entire `/tik_manager4/dcc/katana/setup/tik4` folder to the `shelves` folder. 5. (Optional) To get the icons to show up in the shelf, you can edit the all shelf files (`main_ui.py`, `new_version.py`, `publish.py`) and replace the icon paths with the correct paths. Simply replace `PATH/TO/PARENT/FOLDER/OF/TIKMANAGER4` parts with the physical path of the parent folder of tik_manager4. diff --git a/tik_manager4/dcc/dcc_install.py b/tik_manager4/dcc/dcc_install.py index e8a6f3c5..c32924f9 100644 --- a/tik_manager4/dcc/dcc_install.py +++ b/tik_manager4/dcc/dcc_install.py @@ -468,9 +468,11 @@ def katana_setup(self, prompt=True): init_content = [ "# Tik Manager 4 [Start]\n", "import sys\n", + "import os\n", f"tik_path = '{self.tik_root.parent.as_posix()}'\n", "if not tik_path in sys.path:\n", " sys.path.append(tik_path)\n", + """os.environ["QT_PREFERRED_BINDING_JSON"] = '{"tik_manager4.ui.Qt": ["PyQt5"], "default":["PyQt5"]}'\n""" "# Tik Manager 4 [End]\n" ] diff --git a/tik_manager4/dcc/katana/main.py b/tik_manager4/dcc/katana/main.py index f6511f37..dcccc49f 100644 --- a/tik_manager4/dcc/katana/main.py +++ b/tik_manager4/dcc/katana/main.py @@ -2,7 +2,6 @@ import logging -# from PyQt5 import QtWidgets, QtGui, QtCore from tik_manager4.ui.Qt import QtWidgets, QtGui, QtCore import Katana from Katana import KatanaFile # pylint: disable=import-error diff --git a/tik_manager4/dcc/katana/setup/how-to-install.txt b/tik_manager4/dcc/katana/setup/how-to-install.txt index 4796c374..6e480733 100644 --- a/tik_manager4/dcc/katana/setup/how-to-install.txt +++ b/tik_manager4/dcc/katana/setup/how-to-install.txt @@ -5,7 +5,7 @@ Katana Integration .. tip:: - In Windows, it usually is ``%userprofile%/.katana`` + In Windows, it is under ``%userprofile%/.katana`` 2. If it is not already exists, create `init.py` in startup folder and add the following lines: @@ -13,9 +13,11 @@ Katana Integration # Tik Manager 4 [Start] import sys + import os tik_path = "PATH/TO/PARENT/FOLDER/OF/TIKMANAGER4/" if not tik_path in sys.path: sys.path.append(tik_path) + os.environ["QT_PREFERRED_BINDING_JSON"] = '{"tik_manager4.ui.Qt": ["PyQt5"], "default":["PyQt5"]}' # Tik Manager 4 [End] 3. Replace ``PATH/TO/PARENT/FOLDER/OF/TIKMANAGER4/`` with the path of where the PARENT of tik_manager folder is. Use forward slashes between folder names. @@ -23,7 +25,7 @@ Katana Integration .. attention:: The Path MUST be the parent of the tik_manager4 folder. If you extracted the contents directly from the zip file it will be something like ``tik_manager4-4.0.1-alpha``. -4. In the same startup directory, locate the `shelves` folder and copy the entire `/tik_manager4/dcc/katana/setup/tik4` folder into the `shelves` folder. +4. In the same startup directory, locate the `shelves` folder and copy the entire `/tik_manager4/dcc/katana/setup/tik4` folder to the `shelves` folder. 5. (Optional) To get the icons to show up in the shelf, you can edit the all shelf files (`main_ui.py`, `new_version.py`, `publish.py`) and replace the icon paths with the correct paths. Simply replace `PATH/TO/PARENT/FOLDER/OF/TIKMANAGER4` parts with the physical path of the parent folder of tik_manager4.