From fb16f1e7e1843eb0d0bbf93ecaf3602dffdbe246 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 7 Apr 2021 13:44:33 +0200 Subject: [PATCH 1/5] Fix clean up of composition must propagate to instance --- .../aftereffects/plugins/publish/remove_publish_highlight.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py b/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py index 291f22e3b8..d2b3fd1b12 100644 --- a/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py +++ b/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py @@ -21,3 +21,4 @@ class RemovePublishHighlight(openpype.api.Extractor): item = instance.data comp_name = item["comp_name"].replace(stub.PUBLISH_ICON, '') stub.rename_item(item["comp_id"], comp_name) + instance.data["comp_name"] = comp_name From 38926fe85e96bebde76a0dcf926e3d776c57b3a5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 8 Apr 2021 10:10:20 +0200 Subject: [PATCH 2/5] updated custom session with new timeout attribute --- openpype/modules/ftrack/ftrack_server/lib.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openpype/modules/ftrack/ftrack_server/lib.py b/openpype/modules/ftrack/ftrack_server/lib.py index 91f3712136..88f849e765 100644 --- a/openpype/modules/ftrack/ftrack_server/lib.py +++ b/openpype/modules/ftrack/ftrack_server/lib.py @@ -3,11 +3,11 @@ import sys import logging import getpass import atexit -import tempfile import threading import datetime import time import queue +import appdirs import pymongo import requests @@ -165,7 +165,6 @@ class ProcessEventHub(SocketBaseEventHub): def wait(self, duration=None): """Overriden wait - Event are loaded from Mongo DB when queue is empty. Handled event is set as processed in Mongo DB. """ @@ -252,7 +251,7 @@ class CustomEventHubSession(ftrack_api.session.Session): self, server_url=None, api_key=None, api_user=None, auto_populate=True, plugin_paths=None, cache=None, cache_key_maker=None, auto_connect_event_hub=False, schema_cache_path=None, - plugin_arguments=None, **kwargs + plugin_arguments=None, timeout=60, **kwargs ): self.kwargs = kwargs @@ -331,6 +330,7 @@ class CustomEventHubSession(ftrack_api.session.Session): self._request.auth = ftrack_api.session.SessionAuthentication( self._api_key, self._api_user ) + self.request_timeout = timeout self.auto_populate = auto_populate @@ -368,8 +368,9 @@ class CustomEventHubSession(ftrack_api.session.Session): # rebuilding types)? if schema_cache_path is not False: if schema_cache_path is None: + schema_cache_path = appdirs.user_cache_dir() schema_cache_path = os.environ.get( - 'FTRACK_API_SCHEMA_CACHE_PATH', tempfile.gettempdir() + 'FTRACK_API_SCHEMA_CACHE_PATH', schema_cache_path ) schema_cache_path = os.path.join( From ae5d05a813cae233c0d1e002b3e7072c8e0db9fb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 8 Apr 2021 10:10:44 +0200 Subject: [PATCH 3/5] ftrack server waits until event hub is connected --- .../modules/ftrack/ftrack_server/ftrack_server.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/openpype/modules/ftrack/ftrack_server/ftrack_server.py b/openpype/modules/ftrack/ftrack_server/ftrack_server.py index 285ca29dc5..bd67fba3d6 100644 --- a/openpype/modules/ftrack/ftrack_server/ftrack_server.py +++ b/openpype/modules/ftrack/ftrack_server/ftrack_server.py @@ -1,4 +1,5 @@ import os +import time import types import logging import traceback @@ -10,7 +11,6 @@ from openpype.lib import ( modules_from_path ) - log = PypeLogger.get_logger(__name__) """ @@ -120,6 +120,18 @@ class FtrackServer: if not session: session = ftrack_api.Session(auto_connect_event_hub=True) + # Wait until session has connected event hub + if session._auto_connect_event_hub_thread: + # Use timeout from session (since ftrack-api 2.1.0) + timeout = getattr(session, "request_timeout", 60) + started = time.time() + while not session.event_hub.connected: + if (time.time() - started) > timeout: + raise RuntimeError(( + "Connection to Ftrack was not created in {} seconds" + ).format(timeout)) + time.sleep(0.1) + self.session = session if load_files: if not self.handler_paths: From d6fb7b47639933f034e4d8cdc41f156e3b3aae85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 8 Apr 2021 12:28:54 +0200 Subject: [PATCH 4/5] updated linux build environment --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aae79f2358..73620d7885 100644 --- a/README.md +++ b/README.md @@ -166,14 +166,23 @@ sudo yum install qt5-qtbase-devel
Use pyenv to install Python version for OpenPype build -You will need **bzip2**, **readline** and **sqlite3** libraries. +You will need **bzip2**, **readline**, **sqlite3** and other libraries. -**Ubuntu:** +For more details about Python build environments see: + +https://github.com/pyenv/pyenv/wiki#suggested-build-environment + +**For Ubuntu:** ```sh -sudo apt install libbz2-dev libreadline-dev libsqlite3-dev +sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ``` -1) install **pyenv** +**For Centos:** +```sh +yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel +``` + +**install pyenv** ```sh curl https://pyenv.run | bash From e2f8a5836d8be3c81de6c0e24d8366536459c229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:24:17 +0200 Subject: [PATCH 5/5] updated web documentation --- website/docs/dev_build.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/website/docs/dev_build.md b/website/docs/dev_build.md index 01e53918d2..9523035705 100644 --- a/website/docs/dev_build.md +++ b/website/docs/dev_build.md @@ -65,23 +65,20 @@ To build pype on linux you wil need: - **[curl](https://curl.se)** on systems that doesn't have one preinstalled. - Python header files installed (**python3-dev** on Ubuntu for example). -- **[CMake](https://cmake.org/)**: to build some external openPype dependencies. -- **bzip2**, **readline** and **sqlite3** libraries. +- **bzip2**, **readline**, **sqlite3** and other libraries. Because some Linux distros come with newer Python version pre-installed, you might need to install **3.7** version and make use of it explicitly. Your best bet is probably using [pyenv](https://github.com/pyenv/pyenv). -You can use your package manager to install **git** and **cmake**. +You can use your package manager to install **git** and other packages to your build +environment. Use curl for pyenv installation :::note Install build requirements for **Ubuntu** - ```sh -sudo apt install build-essential checkinstall -sudo apt install git cmake curl -sudo apt install libbz2-dev libreadline-dev libsqlite3-dev +sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git ``` In case you run in error about `xcb` when running Pype, @@ -95,8 +92,7 @@ sudo apt install qt5-default :::note Install build requirements for **Centos** ```sh -sudo yum install git cmake python3-devel python3-pip -sudo yum install bzip2-devel readline-devel sqlite-devel +yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel git ``` In case you run in error about `xcb` when running Pype, @@ -108,6 +104,8 @@ sudo yum install qt5-qtbase-devel ::: +For more information about setting your build environmet please refer to [pyenv suggested build environment](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) + #### Common steps for all Distros Use pyenv to prepare Python version for Pype build