diff --git a/.gitignore b/.gitignore
index f1295e32eb..2ea7d93c5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,7 @@ Network Trash Folder
Temporary Items
.apdisk
+
# CX_Freeze
###########
/build
@@ -68,7 +69,7 @@ coverage.xml
node_modules/
package-lock.json
-pype/premiere/ppro/js/debug.log
+openpype/premiere/ppro/js/debug.log
# IDEA
diff --git a/.gitmodules b/.gitmodules
index 31e7764741..d286419ee5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -5,9 +5,9 @@
[submodule "repos/avalon-unreal-integration"]
path = repos/avalon-unreal-integration
url = git@github.com:pypeclub/avalon-unreal-integration.git
-[submodule "pype/modules/ftrack/python2_vendor/ftrack-python-api"]
- path = pype/modules/ftrack/python2_vendor/ftrack-python-api
+[submodule "openpype/modules/ftrack/python2_vendor/ftrack-python-api"]
+ path = openpype/modules/ftrack/python2_vendor/ftrack-python-api
url = https://bitbucket.org/ftrack/ftrack-python-api.git
-[submodule "pype/modules/ftrack/python2_vendor/arrow"]
- path = pype/modules/ftrack/python2_vendor/arrow
+[submodule "openpype/modules/ftrack/python2_vendor/arrow"]
+ path = openpype/modules/ftrack/python2_vendor/arrow
url = git@github.com:arrow-py/arrow.git
\ No newline at end of file
diff --git a/README.md b/README.md
index 456655bfb9..aae79f2358 100644
--- a/README.md
+++ b/README.md
@@ -1,38 +1,49 @@
-Pype
+OpenPype
====
Introduction
------------
-Multi-platform open-source pipeline built around the [Avalon](https://getavalon.github.io/) platform,
-expanding it with extra features and integrations. Pype connects asset database, project management
-and time tracking into a single modular system. It has tight integration
-with [ftrack](https://www.ftrack.com/en/), but it can also run independently.
+Open-source pipeline for visual effects and animation built on top of the [Avalon](https://getavalon.github.io/) framework, expanding it with extra features and integrations. OpenPype connects your DCCs, asset database, project management and time tracking into a single system. It has a tight integration with [ftrack](https://www.ftrack.com/en/), but can also run independently or be integrated into a different project management solution.
-To get all the key information about the project, go to [PYPE.club](http://pype.club)
+OpenPype provides a robust platform for your studio, without the worry of a vendor lock. You will always have full access to the source-code and your project database will run locally or in the cloud of your choice.
+
+
+To get all the information about the project, go to [OpenPype.io](http://openpype.io)
Requirements
------------
-Pype will run on most typical hardware configurations commonly found in studios around the world.
-It is installed on artist computer and can take up 3Gb of space depending on number of versions
-and other dependencies.
-For well functioning [ftrack](https://www.ftrack.com/en/) event server, we recommend a
-linux virtual server with [Ubuntu](https://ubuntu.com/) or [CentosOS](https://www.centos.org/).
-CPU and RAM allocation need differ based on the studio size, but a 2GB of RAM, with a
-dual core CPU and around 4GB of storage should suffice.
+We aim to closely follow [**VFX Reference Platform**](https://vfxplatform.com/)
-Pype needs running [mongodb](https://www.mongodb.com/) server with good connectivity as it is
-heavily used by Pype. Depending on project size and number of artists working connection speed and
-latency influence performance experienced by artists. If remote working is required, this mongodb
-server must be accessible from Internet or cloud solution can be used. Reasonable backup plan
-or high availability options are recommended.
+OpenPype is written in Python 3 with specific elements still running in Python2 until all DCCs are fully updated. To see the list of those, that are not quite there yet, go to [VFX Python3 tracker](https://vfxpy.com/)
-Building Pype
+The main things you will need to run and build OpenPype are:
+
+- **Terminal** in your OS
+ - PowerShell 5.0+ (Windows)
+ - Bash (Linux)
+- [**Python 3.7.8**](#python) or higher
+- [**MongoDB**](#database)
+
+
+It can be built and ran on all common platforms. We develop and test on the following:
+
+- **Windows** 10
+- **Linux**
+ - **Ubuntu** 20.04 LTS
+ - **Centos** 7
+- **Mac OSX**
+ - **10.15** Catalina
+ - **11.1** Big Sur (using Rosetta2)
+
+For more details on requirements visit [requirements documentation](https://openpype.io/docs/dev_requirements)
+
+Building OpenPype
-------------
-To build Pype you currently need [Python 3.7](https://www.python.org/downloads/) as we are following
+To build OpenPype you currently need [Python 3.7](https://www.python.org/downloads/) as we are following
[vfx platform](https://vfxplatform.com). Because of some Linux distros comes with newer Python version
already, you need to install **3.7** version and make use of it. You can use perhaps [pyenv](https://github.com/pyenv/pyenv) for this on Linux.
@@ -44,27 +55,27 @@ development tools like [CMake](https://cmake.org/) and [Visual Studio](https://v
#### Clone repository:
```sh
-git clone --recurse-submodules git@github.com:pypeclub/pype.git
+git clone --recurse-submodules git@github.com:Pypeclub/OpenPype.git
```
-#### To build Pype:
+#### To build OpenPype:
1) Run `.\tools\create_env.ps1` to create virtual environment in `.\venv`
-2) Run `.\tools\build.ps1` to build pype executables in `.\build\`
+2) Run `.\tools\build.ps1` to build OpenPype executables in `.\build\`
-To create distributable Pype versions, run `./tools/create_zip.ps1` - that will
-create zip file with name `pype-vx.x.x.zip` parsed from current pype repository and
+To create distributable OpenPype versions, run `./tools/create_zip.ps1` - that will
+create zip file with name `openpype-vx.x.x.zip` parsed from current OpenPype repository and
copy it to user data dir, or you can specify `--path /path/to/zip` to force it there.
-You can then point **Igniter** - Pype setup tool - to directory containing this zip and
+You can then point **Igniter** - OpenPype setup tool - to directory containing this zip and
it will install it on current computer.
-Pype is build using [CX_Freeze](https://cx-freeze.readthedocs.io/en/latest) to freeze itself and all dependencies.
+OpenPype is build using [CX_Freeze](https://cx-freeze.readthedocs.io/en/latest) to freeze itself and all dependencies.
### macOS
You will need [Python 3.7](https://www.python.org/downloads/) and [git](https://git-scm.com/downloads). You'll need also other tools to build
-some Pype dependencies like [CMake](https://cmake.org/) and **XCode Command Line Tools** (or some other build system).
+some OpenPype dependencies like [CMake](https://cmake.org/) and **XCode Command Line Tools** (or some other build system).
Easy way of installing everything necessary is to use [Homebrew](https://brew.sh):
@@ -81,7 +92,7 @@ brew install cmake
3) Install [pyenv](https://github.com/pyenv/pyenv):
```sh
brew install pyenv
-echo 'eval "$(pypenv init -)"' >> ~/.zshrc
+echo 'eval "$(pyenv init -)"' >> ~/.zshrc
pyenv init
exec "$SHELL"
PATH=$(pyenv root)/shims:$PATH
@@ -98,14 +109,14 @@ pyenv install 3.7.9
5) Set local Python version
```sh
-# switch to Pype source directory
+# switch to OpenPype source directory
pyenv local 3.7.9
```
-#### To build Pype:
+#### To build OpenPype:
1) Run `.\tools\create_env.sh` to create virtual environment in `.\venv`
-2) Run `.\tools\build.sh` to build Pype executables in `.\build\`
+2) Run `.\tools\build.sh` to build OpenPype executables in `.\build\`
### Linux
@@ -115,7 +126,7 @@ You will need [Python 3.7](https://www.python.org/downloads/) and [git](https://
To build Python related stuff, you need Python header files installed (`python3-dev` on Ubuntu for example).
You'll need also other tools to build
-some Pype dependencies like [CMake](https://cmake.org/). Python 3 should be part of all modern distributions. You can use your package manager to install **git** and **cmake**.
+some OpenPype dependencies like [CMake](https://cmake.org/). Python 3 should be part of all modern distributions. You can use your package manager to install **git** and **cmake**.
Use pyenv to install Python version for Pype build
+Use pyenv to install Python version for OpenPype build
You will need **bzip2**, **readline** and **sqlite3** libraries.
@@ -177,8 +188,8 @@ exec $SHELL
# install Python 3.7.9
pyenv install -v 3.7.9
-# change path to pype 3
-cd /path/to/pype-3
+# change path to OpenPype 3
+cd /path/to/openpype-3
# set local python version
pyenv local 3.7.9
@@ -186,42 +197,42 @@ pyenv local 3.7.9
```
- We've detected Pype is not configured yet. But don't worry, + We've detected OpenPype is not configured yet. But don't worry, this is as easy as setting one or two things.
""") self.main_label.setWordWrap(True) self.main_label.setStyleSheet("color: rgb(200, 200, 200);") - # Pype path info + # OpenPype path info # -------------------------------------------------------------------- - self.pype_path_label = QtWidgets.QLabel( - """This is Path to studio location where Pype versions + self.openpype_path_label = QtWidgets.QLabel( + """This is Path to studio location where OpenPype versions are stored. It will be pre-filled if your MongoDB connection is already set and your studio defined this location.
- Leave it empty if you want to install Pype version that comes with - this installation. + Leave it empty if you want to install OpenPype version that + comes with this installation.
- If you want to just try Pype without installing, hit the middle - button that states "run without installation". + If you want to just try OpenPype without installing, hit the + middle button that states "run without installation".
""" ) - self.pype_path_label.setWordWrap(True) - self.pype_path_label.setStyleSheet("color: rgb(150, 150, 150);") + self.openpype_path_label.setWordWrap(True) + self.openpype_path_label.setStyleSheet("color: rgb(150, 150, 150);") # Path/Url box | Select button # -------------------------------------------------------------------- @@ -135,7 +139,7 @@ class InstallDialog(QtWidgets.QDialog): input_layout.setContentsMargins(0, 10, 0, 10) self.user_input = FocusHandlingLineEdit() - self.user_input.setPlaceholderText("Path to Pype versions") + self.user_input.setPlaceholderText("Path to OpenPype versions") self.user_input.textChanged.connect(self._path_changed) self.user_input.setStyleSheet( ("color: rgb(233, 233, 233);" @@ -148,7 +152,7 @@ class InstallDialog(QtWidgets.QDialog): self._btn_select = QtWidgets.QPushButton("Select") self._btn_select.setToolTip( - "Select Pype repository" + "Select OpenPype repository" ) self._btn_select.setStyleSheet( ("color: rgb(64, 64, 64);" @@ -282,13 +286,13 @@ class InstallDialog(QtWidgets.QDialog): # -------------------------------------------------------------------- bottom_widget = QtWidgets.QWidget() bottom_layout = QtWidgets.QHBoxLayout() - pype_logo_label = QtWidgets.QLabel("pype logo") - pype_logo = QtGui.QPixmap(self._icon_path) - # pype_logo.scaled( - # pype_logo_label.width(), - # pype_logo_label.height(), QtCore.Qt.KeepAspectRatio) - pype_logo_label.setPixmap(pype_logo) - pype_logo_label.setContentsMargins(10, 0, 0, 10) + openpype_logo_label = QtWidgets.QLabel("openpype logo") + openpype_logo = QtGui.QPixmap(self._icon_path) + # openpype_logo.scaled( + # openpype_logo_label.width(), + # openpype_logo_label.height(), QtCore.Qt.KeepAspectRatio) + openpype_logo_label.setPixmap(openpype_logo) + openpype_logo_label.setContentsMargins(10, 0, 0, 10) # install button - - - - - - - - - - - - - - - - - - - - - - - - - - - self.install_button = QtWidgets.QPushButton("Install") @@ -298,7 +302,7 @@ class InstallDialog(QtWidgets.QDialog): "padding: 0.5em;") ) self.install_button.setMinimumSize(64, 24) - self.install_button.setToolTip("Install Pype") + self.install_button.setToolTip("Install OpenPype") self.install_button.clicked.connect(self._on_ok_clicked) # run from current button - - - - - - - - - - - - - - - - - - - - - - @@ -325,7 +329,7 @@ class InstallDialog(QtWidgets.QDialog): bottom_layout.setContentsMargins(0, 10, 10, 0) bottom_layout.setAlignment(QtCore.Qt.AlignVCenter) - bottom_layout.addWidget(pype_logo_label, 0, QtCore.Qt.AlignVCenter) + bottom_layout.addWidget(openpype_logo_label, 0, QtCore.Qt.AlignVCenter) bottom_layout.addStretch(1) bottom_layout.addWidget(self.install_button, 0, QtCore.Qt.AlignVCenter) bottom_layout.addWidget(self.run_button, 0, QtCore.Qt.AlignVCenter) @@ -405,7 +409,7 @@ class InstallDialog(QtWidgets.QDialog): ) # add all to main main.addWidget(self.main_label, 0) - main.addWidget(self.pype_path_label, 0) + main.addWidget(self.openpype_path_label, 0) main.addLayout(input_layout, 0) main.addWidget(self.mongo_label, 0) main.addWidget(self._mongo, 0) @@ -418,9 +422,9 @@ class InstallDialog(QtWidgets.QDialog): self.setLayout(main) - # if mongo url is ok, try to get pype path from there + # if mongo url is ok, try to get openpype path from there if self._mongo.validate_url() and len(self.path) == 0: - self.path = get_pype_path_from_db(self.mongo_url) + self.path = get_openpype_path_from_db(self.mongo_url) self.user_input.setText(self.path) def _on_select_clicked(self): @@ -473,7 +477,7 @@ class InstallDialog(QtWidgets.QDialog): else: self._mongo.set_valid() - if self._pype_run_ready: + if self._openpype_run_ready: self.done(3) return @@ -498,8 +502,8 @@ class InstallDialog(QtWidgets.QDialog): """Change button behaviour based on installation outcome.""" status = result.status if status >= 0: - self.install_button.setText("Run installed Pype") - self._pype_run_ready = True + self.install_button.setText("Run installed OpenPype") + self._openpype_run_ready = True def _update_progress(self, progress: int): self._progress_bar.setValue(progress) @@ -636,7 +640,7 @@ class PathValidator(MongoValidator): """Validate path to be accepted by Igniter. Args: - path (str): path to Pype. + path (str): path to OpenPype. pos (int): current position. Returns: @@ -646,7 +650,7 @@ class PathValidator(MongoValidator): """ # allow empty path as that will use current version coming with - # Pype Igniter + # OpenPype Igniter if len(path) == 0: return self._return_state( QValidator.State.Acceptable, "Use version with Igniter", path) diff --git a/igniter/install_thread.py b/igniter/install_thread.py index a184a19d36..bf5d541056 100644 --- a/igniter/install_thread.py +++ b/igniter/install_thread.py @@ -8,10 +8,10 @@ from Qt.QtCore import QThread, Signal, QObject # noqa from .bootstrap_repos import ( BootstrapRepos, - PypeVersionInvalid, - PypeVersionIOError, - PypeVersionExists, - PypeVersion + OpenPypeVersionInvalid, + OpenPypeVersionIOError, + OpenPypeVersionExists, + OpenPypeVersion ) from .tools import validate_mongo_connection @@ -26,9 +26,9 @@ class InstallResult(QObject): class InstallThread(QThread): """Install Worker thread. - This class takes care of finding Pype version on user entered path + This class takes care of finding OpenPype version on user entered path (or loading this path from database). If nothing is entered by user, - Pype will create its zip files from repositories that comes with it. + OpenPype will create its zip files from repositories that comes with it. If path contains plain repositories, they are zipped and installed to user data dir. @@ -49,65 +49,67 @@ class InstallThread(QThread): def run(self): """Thread entry point. - Using :class:`BootstrapRepos` to either install Pype as zip files + Using :class:`BootstrapRepos` to either install OpenPype as zip files or copy them from location specified by user or retrieved from database. """ - self.message.emit("Installing Pype ...", False) + self.message.emit("Installing OpenPype ...", False) - # find local version of Pype + # find local version of OpenPype bs = BootstrapRepos( progress_callback=self.set_progress, message=self.message) local_version = bs.get_local_live_version() - # if user did entered nothing, we install Pype from local version. + # if user did entered nothing, we install OpenPype from local version. # zip content of `repos`, copy it to user data dir and append # version to it. if not self._path: # user did not entered url if not self._mongo: # it not set in environment - if not os.getenv("PYPE_MONGO"): + if not os.getenv("OPENPYPE_MONGO"): # try to get it from settings registry try: - self._mongo = bs.registry.get_secure_item("pypeMongo") + self._mongo = bs.registry.get_secure_item( + "openPypeMongo") except ValueError: self.message.emit( "!!! We need MongoDB URL to proceed.", True) self.finished.emit(InstallResult(-1)) return else: - self._mongo = os.getenv("PYPE_MONGO") + self._mongo = os.getenv("OPENPYPE_MONGO") else: self.message.emit("Saving mongo connection string ...", False) - bs.registry.set_secure_item("pypeMongo", self._mongo) + bs.registry.set_secure_item("openPypeMongo", self._mongo) - os.environ["PYPE_MONGO"] = self._mongo + os.environ["OPENPYPE_MONGO"] = self._mongo self.message.emit( - f"Detecting installed Pype versions in {bs.data_dir}", False) - detected = bs.find_pype(include_zips=True) + f"Detecting installed OpenPype versions in {bs.data_dir}", + False) + detected = bs.find_openpype(include_zips=True) if detected: - if PypeVersion( + if OpenPypeVersion( version=local_version, path=Path()) < detected[-1]: self.message.emit(( f"Latest installed version {detected[-1]} is newer " f"then currently running {local_version}" ), False) - self.message.emit("Skipping Pype install ...", False) + self.message.emit("Skipping OpenPype install ...", False) if detected[-1].path.suffix.lower() == ".zip": - bs.extract_pype(detected[-1]) + bs.extract_openpype(detected[-1]) self.finished.emit(InstallResult(0)) return - if PypeVersion(version=local_version).get_main_version() == detected[-1].get_main_version(): # noqa + if OpenPypeVersion(version=local_version).get_main_version() == detected[-1].get_main_version(): # noqa self.message.emit(( f"Latest installed version is the same as " f"currently running {local_version}" ), False) - self.message.emit("Skipping Pype install ...", False) + self.message.emit("Skipping OpenPype install ...", False) self.finished.emit(InstallResult(0)) return @@ -118,17 +120,17 @@ class InstallThread(QThread): else: if getattr(sys, 'frozen', False): self.message.emit("None detected.", True) - self.message.emit(("We will use Pype coming with " + self.message.emit(("We will use OpenPype coming with " "installer."), False) - pype_version = bs.create_version_from_frozen_code() - if not pype_version: + openpype_version = bs.create_version_from_frozen_code() + if not openpype_version: self.message.emit( - f"!!! Install failed - {pype_version}", True) + f"!!! Install failed - {openpype_version}", True) self.finished.emit(InstallResult(-1)) return - self.message.emit(f"Using: {pype_version}", False) - bs.install_version(pype_version) - self.message.emit(f"Installed as {pype_version}", False) + self.message.emit(f"Using: {openpype_version}", False) + bs.install_version(openpype_version) + self.message.emit(f"Installed as {openpype_version}", False) self.progress.emit(100) self.finished.emit(InstallResult(1)) return @@ -136,39 +138,39 @@ class InstallThread(QThread): self.message.emit("None detected.", False) self.message.emit( - f"We will use local Pype version {local_version}", False) + f"We will use local OpenPype version {local_version}", False) - local_pype = bs.create_version_from_live_code() - if not local_pype: + local_openpype = bs.create_version_from_live_code() + if not local_openpype: self.message.emit( - f"!!! Install failed - {local_pype}", True) + f"!!! Install failed - {local_openpype}", True) self.finished.emit(InstallResult(-1)) return try: - bs.install_version(local_pype) - except (PypeVersionExists, - PypeVersionInvalid, - PypeVersionIOError) as e: + bs.install_version(local_openpype) + except (OpenPypeVersionExists, + OpenPypeVersionInvalid, + OpenPypeVersionIOError) as e: self.message.emit(f"Installed failed: ", True) self.message.emit(str(e), True) self.finished.emit(InstallResult(-1)) return - self.message.emit(f"Installed as {local_pype}", False) + self.message.emit(f"Installed as {local_openpype}", False) self.progress.emit(100) return else: # if we have mongo connection string, validate it, set it to - # user settings and get PYPE_PATH from there. + # user settings and get OPENPYPE_PATH from there. if self._mongo: if not validate_mongo_connection(self._mongo): self.message.emit( f"!!! invalid mongo url {self._mongo}", True) self.finished.emit(InstallResult(-1)) return - bs.registry.set_secure_item("pypeMongo", self._mongo) - os.environ["PYPE_MONGO"] = self._mongo + bs.registry.set_secure_item("openPypeMongo", self._mongo) + os.environ["OPENPYPE_MONGO"] = self._mongo self.message.emit(f"processing {self._path}", True) repo_file = bs.process_entered_location(self._path) diff --git a/igniter/openpype.ico b/igniter/openpype.ico new file mode 100644 index 0000000000..f0c15accc4 Binary files /dev/null and b/igniter/openpype.ico differ diff --git a/igniter/openpype_icon.png b/igniter/openpype_icon.png new file mode 100644 index 0000000000..6eae8abca3 Binary files /dev/null and b/igniter/openpype_icon.png differ diff --git a/igniter/pype.ico b/igniter/pype.ico deleted file mode 100644 index 746fc36ba2..0000000000 Binary files a/igniter/pype.ico and /dev/null differ diff --git a/igniter/pype_icon.png b/igniter/pype_icon.png deleted file mode 100644 index c17d6ee4c1..0000000000 Binary files a/igniter/pype_icon.png and /dev/null differ diff --git a/igniter/terminal_splash.py b/igniter/terminal_splash.py index 1a7645571e..1d85fd3927 100644 --- a/igniter/terminal_splash.py +++ b/igniter/terminal_splash.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -"""Pype terminal animation.""" +"""OpenPype terminal animation.""" import blessed from pathlib import Path from time import sleep @@ -15,7 +15,7 @@ except AttributeError: def play_animation(): - """Play ASCII art Pype animation.""" + """Play ASCII art OpenPype animation.""" if NO_TERMINAL: return print(term.home + term.clear) diff --git a/igniter/tools.py b/igniter/tools.py index 4ed4ae67f4..ff2db6bc7e 100644 --- a/igniter/tools.py +++ b/igniter/tools.py @@ -2,10 +2,12 @@ """Tools used in **Igniter** GUI. Functions ``compose_url()`` and ``decompose_url()`` are the same as in -``pype.lib`` and they are here to avoid importing pype module before its +``openpype.lib`` and they are here to avoid importing OpenPype module before its version is decided. """ +import sys +import os from typing import Dict, Union from urllib.parse import urlparse, parse_qs from pathlib import Path @@ -130,6 +132,7 @@ def validate_mongo_connection(cnx: str) -> (bool, str): try: client = MongoClient(**mongo_args) client.server_info() + client.close() except ServerSelectionTimeoutError as e: return False, f"Cannot connect to server {cnx} - {e}" except ValueError: @@ -161,7 +164,7 @@ def validate_mongo_string(mongo: str) -> (bool, str): def validate_path_string(path: str) -> (bool, str): - """Validate string if it is path to Pype repository. + """Validate string if it is path to OpenPype repository. Args: path (str): Path to validate. @@ -185,73 +188,68 @@ def validate_path_string(path: str) -> (bool, str): return True, "valid path" -def load_environments(sections: list = None) -> dict: - """Load environments from Pype. +def get_openpype_global_settings(url: str) -> dict: + """Load global settings from Mongo database. - This will load environments from database, process them with - :mod:`acre` and return them as flattened dictionary. - - Args: - sections (list, optional): load specific types - - Returns; - dict of str: loaded and processed environments. - - """ - import acre - - from pype import settings - - all_env = settings.get_environments() - merged_env = {} - - sections = sections or all_env.keys() - - for section in sections: - try: - parsed_env = acre.parse(all_env[section]) - except AttributeError: - continue - merged_env = acre.append(merged_env, parsed_env) - - return acre.compute(merged_env, cleanup=True) - - -def get_pype_path_from_db(url: str) -> Union[str, None]: - """Get Pype path from database. - - We are loading data from database `pype` and collection `settings`. + We are loading data from database `openpype` and collection `settings`. There we expect document type `global_settings`. Args: - url (str): mongodb url. + url (str): MongoDB url. Returns: - path to Pype or None if not found - + dict: With settings data. Empty dictionary is returned if not found. """ try: components = decompose_url(url) except RuntimeError: - return None - mongo_args = { + return {} + mongo_kwargs = { "host": compose_url(**components), "serverSelectionTimeoutMS": 2000 } port = components.get("port") if port is not None: - mongo_args["port"] = int(port) + mongo_kwargs["port"] = int(port) try: - client = MongoClient(**mongo_args) + # Create mongo connection + client = MongoClient(**mongo_kwargs) + # Access settings collection + col = client["openpype"]["settings"] + # Query global settings + global_settings = col.find_one({"type": "global_settings"}) or {} + # Close Mongo connection + client.close() + except Exception: - return None + # TODO log traceback or message + return {} - db = client.pype - col = db.settings + return global_settings.get("data") or {} - global_settings = col.find_one({"type": "global_settings"}, {"data": 1}) - if not global_settings: - return None - global_settings.get("data", {}) - return global_settings.get("pype_path", {}).get(platform.system().lower()) + +def get_openpype_path_from_db(url: str) -> Union[str, None]: + """Get OpenPype path from global settings. + + Args: + url (str): mongodb url. + + Returns: + path to OpenPype or None if not found + """ + global_settings = get_openpype_global_settings(url) + paths = ( + global_settings + .get("openpype_path", {}) + .get(platform.system().lower()) + ) or [] + # For cases when `openpype_path` is a single path + if paths and isinstance(paths, str): + paths = [paths] + + # Loop over paths and return only existing + for path in paths: + if os.path.exists(path): + return path + return None diff --git a/igniter/user_settings.py b/igniter/user_settings.py index 00ce68cb0b..77fb8b5ae5 100644 --- a/igniter/user_settings.py +++ b/igniter/user_settings.py @@ -118,7 +118,7 @@ class ASettingRegistry(): """Delete item from settings. Note: - see :meth:`pype.lib.user_settings.ARegistrySettings.delete_item` + see :meth:`openpype.lib.user_settings.ARegistrySettings.delete_item` """ pass @@ -211,12 +211,12 @@ class IniSettingRegistry(ASettingRegistry): # type: (str, str) -> IniSettingRegistry super(IniSettingRegistry, self).__init__(name) # get registry file - version = os.getenv("PYPE_VERSION", "N/A") + version = os.getenv("OPENPYPE_VERSION", "N/A") self._registry_file = os.path.join(path, "{}.ini".format(name)) if not os.path.exists(self._registry_file): with open(self._registry_file, mode="w") as cfg: print("# Settings registry", cfg) - print("# Generated by Pype {}".format(version), cfg) + print("# Generated by OpenPype {}".format(version), cfg) now = datetime.now().strftime("%d/%m/%Y %H:%M:%S") print("# {}".format(now), cfg) @@ -350,7 +350,7 @@ class IniSettingRegistry(ASettingRegistry): """Delete item from default section. Note: - See :meth:`~pype.lib.IniSettingsRegistry.delete_item_from_section` + See :meth:`~openpype.lib.IniSettingsRegistry.delete_item_from_section` """ self.delete_item_from_section("MAIN", name) @@ -367,7 +367,7 @@ class JSONSettingRegistry(ASettingRegistry): now = datetime.now().strftime("%d/%m/%Y %H:%M:%S") header = { "__metadata__": { - "pype-version": os.getenv("PYPE_VERSION", "N/A"), + "openpype-version": os.getenv("OPENPYPE_VERSION", "N/A"), "generated": now }, "registry": {} @@ -385,7 +385,7 @@ class JSONSettingRegistry(ASettingRegistry): """Get item value from registry json. Note: - See :meth:`pype.lib.JSONSettingRegistry.get_item` + See :meth:`openpype.lib.JSONSettingRegistry.get_item` """ with open(self._registry_file, mode="r") as cfg: @@ -418,7 +418,7 @@ class JSONSettingRegistry(ASettingRegistry): """Set item value to registry json. Note: - See :meth:`pype.lib.JSONSettingRegistry.set_item` + See :meth:`openpype.lib.JSONSettingRegistry.set_item` """ with open(self._registry_file, "r+") as cfg: @@ -450,8 +450,8 @@ class JSONSettingRegistry(ASettingRegistry): json.dump(data, cfg, indent=4) -class PypeSettingsRegistry(JSONSettingRegistry): - """Class handling Pype general settings registry. +class OpenPypeSettingsRegistry(JSONSettingRegistry): + """Class handling OpenPype general settings registry. Attributes: vendor (str): Name used for path construction. @@ -461,6 +461,7 @@ class PypeSettingsRegistry(JSONSettingRegistry): def __init__(self): self.vendor = "pypeclub" - self.product = "pype" + self.product = "openpype" path = appdirs.user_data_dir(self.product, self.vendor) - super(PypeSettingsRegistry, self).__init__("pype_settings", path) + super(OpenPypeSettingsRegistry, self).__init__( + "openpype_settings", path) diff --git a/igniter/version.py b/igniter/version.py index 3c627aaa1a..8c8ffdccb7 100644 --- a/igniter/version.py +++ b/igniter/version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- """Definition of Igniter version.""" -__version__ = "1.0.0" +__version__ = "1.0.0-beta" diff --git a/pype/__init__.py b/openpype/__init__.py similarity index 100% rename from pype/__init__.py rename to openpype/__init__.py diff --git a/pype/__main__.py b/openpype/__main__.py similarity index 100% rename from pype/__main__.py rename to openpype/__main__.py diff --git a/pype/action.py b/openpype/action.py similarity index 100% rename from pype/action.py rename to openpype/action.py diff --git a/pype/api.py b/openpype/api.py similarity index 97% rename from pype/api.py rename to openpype/api.py index 37e878580a..ce18097eca 100644 --- a/pype/api.py +++ b/openpype/api.py @@ -24,7 +24,7 @@ from .lib import ( get_latest_version, get_global_environments, get_local_site_id, - change_pype_mongo_url + change_openpype_mongo_url ) from .lib.mongo import ( @@ -120,5 +120,5 @@ __all__ = [ "get_global_environments", "get_local_site_id", - "change_pype_mongo_url" + "change_openpype_mongo_url" ] diff --git a/pype/cli.py b/openpype/cli.py similarity index 97% rename from pype/cli.py rename to openpype/cli.py index f67cf10ea1..c6da88cbc1 100644 --- a/pype/cli.py +++ b/openpype/cli.py @@ -93,7 +93,7 @@ def eventserver(debug, provided credentials will be stored for later use. """ if debug: - os.environ['PYPE_DEBUG'] = "3" + os.environ['OPENPYPE_DEBUG'] = "3" PypeCommands().launch_eventservercli( ftrack_url, @@ -139,7 +139,7 @@ def publish(debug, paths): More than one path is allowed. """ if debug: - os.environ['PYPE_DEBUG'] = '3' + os.environ['OPENPYPE_DEBUG'] = '3' PypeCommands.publish(list(paths)) @@ -164,7 +164,7 @@ def texturecopy(debug, project, asset, path): Nothing is written to database. """ if debug: - os.environ['PYPE_DEBUG'] = '3' + os.environ['OPENPYPE_DEBUG'] = '3' PypeCommands().texture_copy(project, asset, path) @@ -178,7 +178,7 @@ def texturecopy(debug, project, asset, path): default=lambda: os.environ.get('AVALON_TASK', '')) @click.option("--tools", help="List of tools to add") @click.option("--user", help="Pype user name", - default=lambda: os.environ.get('PYPE_USERNAME', '')) + default=lambda: os.environ.get('OPENPYPE_USERNAME', '')) @click.option("-fs", "--ftrack-server", help="Registered application name", @@ -214,7 +214,7 @@ def launch(app, project, asset, task, os.environ["FTRACK_API_KEY"] = ftrack_key if user: - os.environ["PYPE_USERNAME"] = user + os.environ["OPENPYPE_USERNAME"] = user # test required if not project or not asset or not task: diff --git a/pype/hooks/pre_add_last_workfile_arg.py b/openpype/hooks/pre_add_last_workfile_arg.py similarity index 95% rename from pype/hooks/pre_add_last_workfile_arg.py rename to openpype/hooks/pre_add_last_workfile_arg.py index e19a884eff..377026da4a 100644 --- a/pype/hooks/pre_add_last_workfile_arg.py +++ b/openpype/hooks/pre_add_last_workfile_arg.py @@ -1,5 +1,5 @@ import os -from pype.lib import PreLaunchHook +from openpype.lib import PreLaunchHook class AddLastWorkfileToLaunchArgs(PreLaunchHook): diff --git a/pype/hooks/pre_global_host_data.py b/openpype/hooks/pre_global_host_data.py similarity index 94% rename from pype/hooks/pre_global_host_data.py rename to openpype/hooks/pre_global_host_data.py index 74be208367..c669d91ad5 100644 --- a/pype/hooks/pre_global_host_data.py +++ b/openpype/hooks/pre_global_host_data.py @@ -1,5 +1,5 @@ -from pype.api import Anatomy -from pype.lib import ( +from openpype.api import Anatomy +from openpype.lib import ( PreLaunchHook, EnvironmentPrepData, prepare_host_environments, @@ -32,7 +32,7 @@ class GlobalHostDataHook(PreLaunchHook): "project_name": self.data["project_name"], "asset_name": self.data["asset_name"], "task_name": self.data["task_name"], - "app_name": app.app_name, + "app": app, "dbcon": self.data["dbcon"], @@ -41,7 +41,6 @@ class GlobalHostDataHook(PreLaunchHook): "anatomy": self.data["anatomy"], - "settings_env": self.data.get("settings_env"), "env": self.launch_context.env, "log": self.log diff --git a/pype/hooks/pre_non_python_host_launch.py b/openpype/hooks/pre_non_python_host_launch.py similarity index 87% rename from pype/hooks/pre_non_python_host_launch.py rename to openpype/hooks/pre_non_python_host_launch.py index ad1a202d4e..c16a72c5e5 100644 --- a/pype/hooks/pre_non_python_host_launch.py +++ b/openpype/hooks/pre_non_python_host_launch.py @@ -1,11 +1,11 @@ import os -from pype.lib import ( +from openpype.lib import ( PreLaunchHook, get_pype_execute_args ) -from pype import PACKAGE_DIR as PYPE_DIR +from openpype import PACKAGE_DIR as OPENPYPE_DIR class NonPythonHostHook(PreLaunchHook): @@ -13,7 +13,7 @@ class NonPythonHostHook(PreLaunchHook): Non python host implementation do not launch host directly but use python script which launch the host. For these cases it is necessary to - prepend python (or pype) executable and script path before application's. + prepend python (or openpype) executable and script path before application's. """ app_groups = ["harmony", "photoshop", "aftereffects"] @@ -27,7 +27,7 @@ class NonPythonHostHook(PreLaunchHook): remainders.append(self.launch_context.launch_args.pop(0)) script_path = os.path.join( - PYPE_DIR, + OPENPYPE_DIR, "scripts", "non_python_host_launch.py" ) diff --git a/pype/hooks/pre_python2_vendor.py b/openpype/hooks/pre_python2_vendor.py similarity index 81% rename from pype/hooks/pre_python2_vendor.py rename to openpype/hooks/pre_python2_vendor.py index 6f34e44132..7aaf713dec 100644 --- a/pype/hooks/pre_python2_vendor.py +++ b/openpype/hooks/pre_python2_vendor.py @@ -1,20 +1,20 @@ import os -from pype.lib import PreLaunchHook +from openpype.lib import PreLaunchHook class PrePython2Vendor(PreLaunchHook): """Prepend python 2 dependencies for py2 hosts.""" - # WARNING This hook will probably be deprecated in Pype 3 - kept for test + # WARNING This hook will probably be deprecated in OpenPype 3 - kept for test order = 10 app_groups = ["hiero", "nuke", "nukex"] def execute(self): # Prepare vendor dir path self.log.info("adding global python 2 vendor") - pype_root = os.getenv("PYPE_ROOT") + pype_root = os.getenv("OPENPYPE_ROOT") python_2_vendor = os.path.join( pype_root, - "pype", + "openpype", "vendor", "python", "python_2" @@ -32,4 +32,3 @@ class PrePython2Vendor(PreLaunchHook): # Set new PYTHONPATH to launch context environments self.launch_context.env["PYTHONPATH"] = os.pathsep.join(python_paths) - \ No newline at end of file diff --git a/pype/hooks/pre_with_windows_shell.py b/openpype/hooks/pre_with_windows_shell.py similarity index 95% rename from pype/hooks/pre_with_windows_shell.py rename to openpype/hooks/pre_with_windows_shell.py index d675c9bf5b..5f0f03f13e 100644 --- a/pype/hooks/pre_with_windows_shell.py +++ b/openpype/hooks/pre_with_windows_shell.py @@ -1,5 +1,5 @@ import os -from pype.lib import PreLaunchHook +from openpype.lib import PreLaunchHook class LaunchWithWindowsShell(PreLaunchHook): diff --git a/pype/hosts/__init__.py b/openpype/hosts/__init__.py similarity index 100% rename from pype/hosts/__init__.py rename to openpype/hosts/__init__.py diff --git a/pype/hosts/aftereffects/__init__.py b/openpype/hosts/aftereffects/__init__.py similarity index 100% rename from pype/hosts/aftereffects/__init__.py rename to openpype/hosts/aftereffects/__init__.py diff --git a/pype/hosts/aftereffects/api/__init__.py b/openpype/hosts/aftereffects/api/__init__.py similarity index 93% rename from pype/hosts/aftereffects/api/__init__.py rename to openpype/hosts/aftereffects/api/__init__.py index cd9ce6a835..ee73a0f52b 100644 --- a/pype/hosts/aftereffects/api/__init__.py +++ b/openpype/hosts/aftereffects/api/__init__.py @@ -5,15 +5,15 @@ import logging from avalon import io from avalon import api as avalon from avalon.vendor import Qt -from pype import lib +from openpype import lib import pyblish.api as pyblish -import pype.hosts.aftereffects +import openpype.hosts.aftereffects log = logging.getLogger("pype.hosts.aftereffects") -HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.aftereffects.__file__)) +HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.aftereffects.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "load") diff --git a/pype/hosts/aftereffects/plugins/__init__.py b/openpype/hosts/aftereffects/plugins/__init__.py similarity index 100% rename from pype/hosts/aftereffects/plugins/__init__.py rename to openpype/hosts/aftereffects/plugins/__init__.py diff --git a/pype/hosts/aftereffects/plugins/create/create_render.py b/openpype/hosts/aftereffects/plugins/create/create_render.py similarity index 92% rename from pype/hosts/aftereffects/plugins/create/create_render.py rename to openpype/hosts/aftereffects/plugins/create/create_render.py index 70abd36406..bb78e89a89 100644 --- a/pype/hosts/aftereffects/plugins/create/create_render.py +++ b/openpype/hosts/aftereffects/plugins/create/create_render.py @@ -1,4 +1,4 @@ -import pype.api +import openpype.api from avalon.vendor import Qt from avalon import aftereffects @@ -7,7 +7,7 @@ import logging log = logging.getLogger(__name__) -class CreateRender(pype.api.Creator): +class CreateRender(openpype.api.Creator): """Render folder for publish. Creates subsets in format 'familyTaskSubsetname', @@ -49,7 +49,7 @@ class CreateRender(pype.api.Creator): self.data["uuid"] = item.id # for SubsetManager stub.imprint(item, self.data) stub.set_label_color(item.id, 14) # Cyan options 0 - 16 - stub.rename_item(item, stub.PUBLISH_ICON + self.data["subset"]) + stub.rename_item(item.id, stub.PUBLISH_ICON + self.data["subset"]) def _show_msg(self, txt): msg = Qt.QtWidgets.QMessageBox() diff --git a/pype/hosts/aftereffects/plugins/load/load_background.py b/openpype/hosts/aftereffects/plugins/load/load_background.py similarity index 97% rename from pype/hosts/aftereffects/plugins/load/load_background.py rename to openpype/hosts/aftereffects/plugins/load/load_background.py index e6f8b6a032..9856abe3fe 100644 --- a/pype/hosts/aftereffects/plugins/load/load_background.py +++ b/openpype/hosts/aftereffects/plugins/load/load_background.py @@ -2,7 +2,7 @@ import re from avalon import api, aftereffects -from pype.lib import get_background_layers, get_unique_layer_name +from openpype.lib import get_background_layers, get_unique_layer_name stub = aftereffects.stub() diff --git a/pype/hosts/aftereffects/plugins/load/load_file.py b/openpype/hosts/aftereffects/plugins/load/load_file.py similarity index 97% rename from pype/hosts/aftereffects/plugins/load/load_file.py rename to openpype/hosts/aftereffects/plugins/load/load_file.py index 500a53a69b..e63a538e7b 100644 --- a/pype/hosts/aftereffects/plugins/load/load_file.py +++ b/openpype/hosts/aftereffects/plugins/load/load_file.py @@ -1,5 +1,5 @@ from avalon import api, aftereffects -from pype import lib +from openpype import lib import re stub = aftereffects.stub() @@ -88,7 +88,7 @@ class FileLoader(api.Loader): layer_name = container["namespace"] path = api.get_representation_path(representation) # with aftereffects.maintained_selection(): # TODO - stub.replace_item(layer, path, stub.LOADED_ICON + layer_name) + stub.replace_item(layer.id, path, stub.LOADED_ICON + layer_name) stub.imprint( layer, {"representation": str(representation["_id"]), "name": context["subset"], diff --git a/openpype/hosts/aftereffects/plugins/publish/add_publish_highlight.py b/openpype/hosts/aftereffects/plugins/publish/add_publish_highlight.py new file mode 100644 index 0000000000..2425f72e3e --- /dev/null +++ b/openpype/hosts/aftereffects/plugins/publish/add_publish_highlight.py @@ -0,0 +1,21 @@ +import pyblish.api + +from avalon import aftereffects + + +class AddPublishHighlight(pyblish.api.InstancePlugin): + """ + Revert back rendered comp name and add publish highlight + """ + + label = "Add render highlight" + order = pyblish.api.IntegratorOrder + 8.0 + hosts = ["aftereffects"] + families = ["render.farm"] + optional = True + + def process(self, instance): + stub = aftereffects.stub() + item = instance.data + # comp name contains highlight icon + stub.rename_item(item["comp_id"], item["comp_name"]) diff --git a/pype/hosts/aftereffects/plugins/publish/collect_audio.py b/openpype/hosts/aftereffects/plugins/publish/collect_audio.py similarity index 100% rename from pype/hosts/aftereffects/plugins/publish/collect_audio.py rename to openpype/hosts/aftereffects/plugins/publish/collect_audio.py diff --git a/pype/hosts/aftereffects/plugins/publish/collect_current_file.py b/openpype/hosts/aftereffects/plugins/publish/collect_current_file.py similarity index 100% rename from pype/hosts/aftereffects/plugins/publish/collect_current_file.py rename to openpype/hosts/aftereffects/plugins/publish/collect_current_file.py diff --git a/pype/hosts/aftereffects/plugins/publish/collect_render.py b/openpype/hosts/aftereffects/plugins/publish/collect_render.py similarity index 93% rename from pype/hosts/aftereffects/plugins/publish/collect_render.py rename to openpype/hosts/aftereffects/plugins/publish/collect_render.py index 7f7d5a52bc..4a124991fd 100644 --- a/pype/hosts/aftereffects/plugins/publish/collect_render.py +++ b/openpype/hosts/aftereffects/plugins/publish/collect_render.py @@ -1,5 +1,5 @@ -from pype.lib import abstract_collect_render -from pype.lib.abstract_collect_render import RenderInstance +from openpype.lib import abstract_collect_render +from openpype.lib.abstract_collect_render import RenderInstance import pyblish.api import attr import os @@ -23,6 +23,8 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): padding_width = 6 rendered_extension = 'png' + stub = aftereffects.stub() + def get_instances(self, context): instances = [] @@ -31,9 +33,9 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): asset_entity = context.data["assetEntity"] project_entity = context.data["projectEntity"] - compositions = aftereffects.stub().get_items(True) + compositions = self.stub.get_items(True) compositions_by_id = {item.id: item for item in compositions} - for inst in aftereffects.stub().get_metadata(): + for inst in self.stub.get_metadata(): schema = inst.get('schema') # loaded asset container skip it if schema and 'container' in schema: @@ -43,7 +45,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): raise ValueError("Couldn't find id, unable to publish. " + "Please recreate instance.") item_id = inst["members"][0] - work_area_info = aftereffects.stub().get_work_area(int(item_id)) + work_area_info = self.stub.get_work_area(int(item_id)) frameStart = work_area_info.workAreaStart frameEnd = round(work_area_info.workAreaStart + @@ -94,6 +96,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): instances.append(instance) + self.log.debug("instances::{}".format(instances)) return instances def get_expected_files(self, render_instance): @@ -113,7 +116,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): end = render_instance.frameEnd # pull file name from Render Queue Output module - render_q = aftereffects.stub().get_render_info() + render_q = self.stub.get_render_info() if not render_q: raise ValueError("No file extension set in Render Queue") _, ext = os.path.splitext(os.path.basename(render_q.file_name)) diff --git a/pype/hosts/aftereffects/plugins/publish/collect_workfile.py b/openpype/hosts/aftereffects/plugins/publish/collect_workfile.py similarity index 100% rename from pype/hosts/aftereffects/plugins/publish/collect_workfile.py rename to openpype/hosts/aftereffects/plugins/publish/collect_workfile.py diff --git a/pype/hosts/aftereffects/plugins/publish/extract_save_scene.py b/openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py similarity index 53% rename from pype/hosts/aftereffects/plugins/publish/extract_save_scene.py rename to openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py index e19065d086..5418ea6299 100644 --- a/pype/hosts/aftereffects/plugins/publish/extract_save_scene.py +++ b/openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py @@ -1,14 +1,15 @@ -import pype.api +import openpype.api from avalon import aftereffects -class ExtractSaveScene(pype.api.Extractor): +class ExtractSaveScene(openpype.api.Extractor): """Save scene before extraction.""" - order = pype.api.Extractor.order - 0.49 + order = openpype.api.Extractor.order - 0.48 label = "Extract Save Scene" hosts = ["aftereffects"] families = ["workfile"] def process(self, instance): - aftereffects.stub().save() + stub = aftereffects.stub() + stub.save() diff --git a/pype/hosts/aftereffects/plugins/publish/increment_workfile.py b/openpype/hosts/aftereffects/plugins/publish/increment_workfile.py similarity index 89% rename from pype/hosts/aftereffects/plugins/publish/increment_workfile.py rename to openpype/hosts/aftereffects/plugins/publish/increment_workfile.py index ef49d01280..18ddf41366 100644 --- a/pype/hosts/aftereffects/plugins/publish/increment_workfile.py +++ b/openpype/hosts/aftereffects/plugins/publish/increment_workfile.py @@ -1,6 +1,6 @@ import pyblish.api -from pype.action import get_errored_plugins_from_data -from pype.lib import version_up +from openpype.action import get_errored_plugins_from_data +from openpype.lib import version_up from avalon import aftereffects diff --git a/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py b/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py new file mode 100644 index 0000000000..291f22e3b8 --- /dev/null +++ b/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py @@ -0,0 +1,23 @@ +import openpype.api +from avalon import aftereffects + + +class RemovePublishHighlight(openpype.api.Extractor): + """Clean utf characters which are not working in DL + + Published compositions are marked with unicode icon which causes + problems on specific render environments. Clean it first, sent to + rendering, add it later back to avoid confusion. + """ + + order = openpype.api.Extractor.order - 0.49 # just before save + label = "Clean render comp" + hosts = ["aftereffects"] + families = ["render.farm"] + + def process(self, instance): + stub = aftereffects.stub() + self.log.debug("instance::{}".format(instance.data)) + item = instance.data + comp_name = item["comp_name"].replace(stub.PUBLISH_ICON, '') + stub.rename_item(item["comp_id"], comp_name) diff --git a/pype/hosts/aftereffects/resources/template.aep b/openpype/hosts/aftereffects/resources/template.aep similarity index 100% rename from pype/hosts/aftereffects/resources/template.aep rename to openpype/hosts/aftereffects/resources/template.aep diff --git a/pype/hosts/blender/__init__.py b/openpype/hosts/blender/__init__.py similarity index 100% rename from pype/hosts/blender/__init__.py rename to openpype/hosts/blender/__init__.py diff --git a/pype/hosts/blender/api/__init__.py b/openpype/hosts/blender/api/__init__.py similarity index 93% rename from pype/hosts/blender/api/__init__.py rename to openpype/hosts/blender/api/__init__.py index 7fcd09201a..55c5b63f60 100644 --- a/pype/hosts/blender/api/__init__.py +++ b/openpype/hosts/blender/api/__init__.py @@ -7,9 +7,9 @@ import bpy from avalon import api as avalon from pyblish import api as pyblish -import pype.hosts.blender +import openpype.hosts.blender -HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.blender.__file__)) +HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.blender.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "load") diff --git a/pype/hosts/blender/api/action.py b/openpype/hosts/blender/api/action.py similarity index 96% rename from pype/hosts/blender/api/action.py rename to openpype/hosts/blender/api/action.py index b140688670..f3426ac3cf 100644 --- a/pype/hosts/blender/api/action.py +++ b/openpype/hosts/blender/api/action.py @@ -2,7 +2,7 @@ import bpy import pyblish.api -from pype.api import get_errored_instances_from_context +from openpype.api import get_errored_instances_from_context class SelectInvalidAction(pyblish.api.Action): diff --git a/pype/hosts/blender/api/plugin.py b/openpype/hosts/blender/api/plugin.py similarity index 99% rename from pype/hosts/blender/api/plugin.py rename to openpype/hosts/blender/api/plugin.py index f216eb28be..eb88e7af63 100644 --- a/pype/hosts/blender/api/plugin.py +++ b/openpype/hosts/blender/api/plugin.py @@ -7,7 +7,7 @@ import bpy from avalon import api import avalon.blender -from pype.api import PypeCreatorMixin +from openpype.api import PypeCreatorMixin VALID_EXTENSIONS = [".blend", ".json"] diff --git a/openpype/hosts/blender/hooks/pre_pyside_install.py b/openpype/hosts/blender/hooks/pre_pyside_install.py new file mode 100644 index 0000000000..088a27566d --- /dev/null +++ b/openpype/hosts/blender/hooks/pre_pyside_install.py @@ -0,0 +1,148 @@ +import os +import subprocess +from openpype.lib import PreLaunchHook + + +class InstallPySideToBlender(PreLaunchHook): + """Install Qt binding to blender's python packages. + + Prelaunch hook does 2 things: + 1.) Blender's python packages are pushed to the beginning of PYTHONPATH. + 2.) Check if blender has installed PySide2 and will try to install if not. + + For pipeline implementation is required to have Qt binding installed in + blender's python packages. + + Prelaunch hook can work only on Windows right now. + """ + + app_groups = ["blender"] + platforms = ["windows"] + + def execute(self): + # Prelaunch hook is not crutial + try: + self.inner_execute() + except Exception: + self.log.warning( + "Processing of {} crashed.".format(self.__class__.__name__), + exc_info=True + ) + + def inner_execute(self): + # Get blender's python directory + executable = self.launch_context.executable.executable_path + # Blender installation contain subfolder named with it's version where + # python binaries are stored. + version_subfolder = self.launch_context.app_name.split("_")[1] + pythond_dir = os.path.join( + os.path.dirname(executable), + version_subfolder, + "python" + ) + + # Change PYTHONPATH to contain blender's packages as first + python_paths = [ + os.path.join(pythond_dir, "lib"), + os.path.join(pythond_dir, "lib", "site-packages"), + ] + python_path = self.launch_context.env.get("PYTHONPATH") or "" + for path in python_path.split(os.pathsep): + if path: + python_paths.append(path) + + self.launch_context.env["PYTHONPATH"] = os.pathsep.join(python_paths) + + # Get blender's python executable + python_executable = os.path.join(pythond_dir, "bin", "python.exe") + if not os.path.exists(python_executable): + self.log.warning( + "Couldn't find python executable for blender. {}".format( + executable + ) + ) + return + + # Check if PySide2 is installed and skip if yes + if self.is_pyside_installed(python_executable): + return + + # Install PySide2 in blender's python + self.install_pyside_windows(python_executable) + + def install_pyside_windows(self, python_executable): + """Install PySide2 python module to blender's python. + + Installation requires administration rights that's why it is required + to use "pywin32" module which can execute command's and ask for + administration rights. + """ + try: + import win32api + import win32con + import win32process + import win32event + import pywintypes + from win32comext.shell.shell import ShellExecuteEx + from win32comext.shell import shellcon + except Exception: + self.log.warning("Couldn't import \"pywin32\" modules") + return + + try: + # Parameters + # - use "-m pip" as module pip to install PySide2 and argument + # "--ignore-installed" is to force install module to blender's + # site-packages and make sure it is binary compatible + parameters = "-m pip install --ignore-installed PySide2" + + # Execute command and ask for administrator's rights + process_info = ShellExecuteEx( + nShow=win32con.SW_SHOWNORMAL, + fMask=shellcon.SEE_MASK_NOCLOSEPROCESS, + lpVerb="runas", + lpFile=python_executable, + lpParameters=parameters, + lpDirectory=os.path.dirname(python_executable) + ) + process_handle = process_info["hProcess"] + obj = win32event.WaitForSingleObject( + process_handle, win32event.INFINITE + ) + returncode = win32process.GetExitCodeProcess(process_handle) + if returncode == 0: + self.log.info( + "Successfully installed PySide2 module to blender." + ) + return + except pywintypes.error: + pass + + self.log.warning("Failed to instal PySide2 module to blender.") + + def is_pyside_installed(self, python_executable): + """Check if PySide2 module is in blender's pip list. + + Check that PySide2 is installed directly in blender's site-packages. + It is possible that it is installed in user's site-packages but that + may be incompatible with blender's python. + """ + # Get pip list from blender's python executable + args = [python_executable, "-m", "pip", "list"] + process = subprocess.Popen(args, stdout=subprocess.PIPE) + stdout, _ = process.communicate() + lines = stdout.decode().split("\r\n") + # Second line contain dashes that define maximum length of module name. + # Second column of dashes define maximum length of module version. + package_dashes, *_ = lines[1].split(" ") + package_len = len(package_dashes) + + # Got through printed lines starting at line 3 + for idx in range(2, len(lines)): + line = lines[idx] + if not line: + continue + package_name = line[0:package_len].strip() + if package_name.lower() == "pyside2": + return True + return False diff --git a/pype/hosts/blender/plugins/__init__.py b/openpype/hosts/blender/plugins/__init__.py similarity index 100% rename from pype/hosts/blender/plugins/__init__.py rename to openpype/hosts/blender/plugins/__init__.py diff --git a/pype/hosts/blender/plugins/create/__init__.py b/openpype/hosts/blender/plugins/create/__init__.py similarity index 100% rename from pype/hosts/blender/plugins/create/__init__.py rename to openpype/hosts/blender/plugins/create/__init__.py diff --git a/pype/hosts/blender/plugins/create/create_action.py b/openpype/hosts/blender/plugins/create/create_action.py similarity index 86% rename from pype/hosts/blender/plugins/create/create_action.py rename to openpype/hosts/blender/plugins/create/create_action.py index b8ad24e711..f7bb2bfc26 100644 --- a/pype/hosts/blender/plugins/create/create_action.py +++ b/openpype/hosts/blender/plugins/create/create_action.py @@ -3,11 +3,11 @@ import bpy from avalon import api -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin from avalon.blender import lib -class CreateAction(pype.hosts.blender.api.plugin.Creator): +class CreateAction(openpype.hosts.blender.api.plugin.Creator): """Action output for character rigs""" name = "actionMain" @@ -19,7 +19,7 @@ class CreateAction(pype.hosts.blender.api.plugin.Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/create/create_animation.py b/openpype/hosts/blender/plugins/create/create_animation.py similarity index 79% rename from pype/hosts/blender/plugins/create/create_animation.py rename to openpype/hosts/blender/plugins/create/create_animation.py index 79744ad7e9..9aebf7e9b7 100644 --- a/pype/hosts/blender/plugins/create/create_animation.py +++ b/openpype/hosts/blender/plugins/create/create_animation.py @@ -3,10 +3,10 @@ import bpy from avalon import api, blender -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -class CreateAnimation(pype.hosts.blender.api.plugin.Creator): +class CreateAnimation(openpype.hosts.blender.api.plugin.Creator): """Animation output for character rigs""" name = "animationMain" @@ -17,7 +17,7 @@ class CreateAnimation(pype.hosts.blender.api.plugin.Creator): def process(self): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/create/create_camera.py b/openpype/hosts/blender/plugins/create/create_camera.py similarity index 80% rename from pype/hosts/blender/plugins/create/create_camera.py rename to openpype/hosts/blender/plugins/create/create_camera.py index 177d26e08b..c7fea30787 100644 --- a/pype/hosts/blender/plugins/create/create_camera.py +++ b/openpype/hosts/blender/plugins/create/create_camera.py @@ -4,10 +4,10 @@ import bpy from avalon import api from avalon.blender import lib -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -class CreateCamera(pype.hosts.blender.api.plugin.Creator): +class CreateCamera(openpype.hosts.blender.api.plugin.Creator): """Polygonal static geometry""" name = "cameraMain" @@ -19,7 +19,7 @@ class CreateCamera(pype.hosts.blender.api.plugin.Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/create/create_layout.py b/openpype/hosts/blender/plugins/create/create_layout.py similarity index 86% rename from pype/hosts/blender/plugins/create/create_layout.py rename to openpype/hosts/blender/plugins/create/create_layout.py index f45b58d137..f72e364f50 100644 --- a/pype/hosts/blender/plugins/create/create_layout.py +++ b/openpype/hosts/blender/plugins/create/create_layout.py @@ -4,10 +4,10 @@ import bpy from avalon import api from avalon.blender import lib -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -class CreateLayout(pype.hosts.blender.api.plugin.Creator): +class CreateLayout(openpype.hosts.blender.api.plugin.Creator): """Layout output for character rigs""" name = "layoutMain" @@ -19,7 +19,7 @@ class CreateLayout(pype.hosts.blender.api.plugin.Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/create/create_model.py b/openpype/hosts/blender/plugins/create/create_model.py similarity index 79% rename from pype/hosts/blender/plugins/create/create_model.py rename to openpype/hosts/blender/plugins/create/create_model.py index 7404b3a157..921d86513b 100644 --- a/pype/hosts/blender/plugins/create/create_model.py +++ b/openpype/hosts/blender/plugins/create/create_model.py @@ -4,10 +4,10 @@ import bpy from avalon import api from avalon.blender import lib -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -class CreateModel(pype.hosts.blender.api.plugin.Creator): +class CreateModel(openpype.hosts.blender.api.plugin.Creator): """Polygonal static geometry""" name = "modelMain" @@ -19,7 +19,7 @@ class CreateModel(pype.hosts.blender.api.plugin.Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/create/create_rig.py b/openpype/hosts/blender/plugins/create/create_rig.py similarity index 87% rename from pype/hosts/blender/plugins/create/create_rig.py rename to openpype/hosts/blender/plugins/create/create_rig.py index d96a88f71d..116fb9f742 100644 --- a/pype/hosts/blender/plugins/create/create_rig.py +++ b/openpype/hosts/blender/plugins/create/create_rig.py @@ -4,10 +4,10 @@ import bpy from avalon import api from avalon.blender import lib -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -class CreateRig(pype.hosts.blender.api.plugin.Creator): +class CreateRig(openpype.hosts.blender.api.plugin.Creator): """Artist-friendly rig with controls to direct motion""" name = "rigMain" @@ -19,7 +19,7 @@ class CreateRig(pype.hosts.blender.api.plugin.Creator): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/create/create_setdress.py b/openpype/hosts/blender/plugins/create/create_setdress.py similarity index 75% rename from pype/hosts/blender/plugins/create/create_setdress.py rename to openpype/hosts/blender/plugins/create/create_setdress.py index 201893b3df..97c737c235 100644 --- a/pype/hosts/blender/plugins/create/create_setdress.py +++ b/openpype/hosts/blender/plugins/create/create_setdress.py @@ -1,10 +1,10 @@ import bpy from avalon import api, blender -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -class CreateSetDress(pype.hosts.blender.api.plugin.Creator): +class CreateSetDress(openpype.hosts.blender.api.plugin.Creator): """A grouped package of loaded content""" name = "setdressMain" @@ -16,7 +16,7 @@ class CreateSetDress(pype.hosts.blender.api.plugin.Creator): def process(self): asset = self.data["asset"] subset = self.data["subset"] - name = pype.hosts.blender.api.plugin.asset_name(asset, subset) + name = openpype.hosts.blender.api.plugin.asset_name(asset, subset) collection = bpy.data.collections.new(name=name) bpy.context.scene.collection.children.link(collection) self.data['task'] = api.Session.get('AVALON_TASK') diff --git a/pype/hosts/blender/plugins/load/__init__.py b/openpype/hosts/blender/plugins/load/__init__.py similarity index 100% rename from pype/hosts/blender/plugins/load/__init__.py rename to openpype/hosts/blender/plugins/load/__init__.py diff --git a/pype/hosts/blender/plugins/load/load_action.py b/openpype/hosts/blender/plugins/load/load_action.py similarity index 94% rename from pype/hosts/blender/plugins/load/load_action.py rename to openpype/hosts/blender/plugins/load/load_action.py index 79e42995b3..a9d8522220 100644 --- a/pype/hosts/blender/plugins/load/load_action.py +++ b/openpype/hosts/blender/plugins/load/load_action.py @@ -7,12 +7,12 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -logger = logging.getLogger("pype").getChild("blender").getChild("load_action") +logger = logging.getLogger("openpype").getChild("blender").getChild("load_action") -class BlendActionLoader(pype.hosts.blender.api.plugin.AssetLoader): +class BlendActionLoader(openpype.hosts.blender.api.plugin.AssetLoader): """Load action from a .blend file. Warning: @@ -42,8 +42,8 @@ class BlendActionLoader(pype.hosts.blender.api.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.hosts.blender.api.plugin.asset_name(asset, subset) - container_name = pype.hosts.blender.api.plugin.asset_name( + lib_container = openpype.hosts.blender.api.plugin.asset_name(asset, subset) + container_name = openpype.hosts.blender.api.plugin.asset_name( asset, subset, namespace ) @@ -149,7 +149,7 @@ class BlendActionLoader(pype.hosts.blender.api.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.hosts.blender.api.plugin.VALID_EXTENSIONS, ( + assert extension in openpype.hosts.blender.api.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) @@ -247,7 +247,7 @@ class BlendActionLoader(pype.hosts.blender.api.plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: diff --git a/pype/hosts/blender/plugins/load/load_animation.py b/openpype/hosts/blender/plugins/load/load_animation.py similarity index 93% rename from pype/hosts/blender/plugins/load/load_animation.py rename to openpype/hosts/blender/plugins/load/load_animation.py index a1be6e99ed..4025fdfa74 100644 --- a/pype/hosts/blender/plugins/load/load_animation.py +++ b/openpype/hosts/blender/plugins/load/load_animation.py @@ -7,14 +7,14 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -logger = logging.getLogger("pype").getChild( +logger = logging.getLogger("openpype").getChild( "blender").getChild("load_animation") -class BlendAnimationLoader(pype.hosts.blender.api.plugin.AssetLoader): +class BlendAnimationLoader(openpype.hosts.blender.api.plugin.AssetLoader): """Load animations from a .blend file. Warning: @@ -105,8 +105,8 @@ class BlendAnimationLoader(pype.hosts.blender.api.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.hosts.blender.api.plugin.asset_name(asset, subset) - container_name = pype.hosts.blender.api.plugin.asset_name( + lib_container = openpype.hosts.blender.api.plugin.asset_name(asset, subset) + container_name = openpype.hosts.blender.api.plugin.asset_name( asset, subset, namespace ) @@ -175,7 +175,7 @@ class BlendAnimationLoader(pype.hosts.blender.api.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.hosts.blender.api.plugin.VALID_EXTENSIONS, ( + assert extension in openpype.hosts.blender.api.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) @@ -217,7 +217,7 @@ class BlendAnimationLoader(pype.hosts.blender.api.plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: diff --git a/pype/hosts/blender/plugins/load/load_camera.py b/openpype/hosts/blender/plugins/load/load_camera.py similarity index 93% rename from pype/hosts/blender/plugins/load/load_camera.py rename to openpype/hosts/blender/plugins/load/load_camera.py index e6aa11af7e..30300100e0 100644 --- a/pype/hosts/blender/plugins/load/load_camera.py +++ b/openpype/hosts/blender/plugins/load/load_camera.py @@ -7,12 +7,12 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.hosts.blender.api.plugin +import openpype.hosts.blender.api.plugin -logger = logging.getLogger("pype").getChild("blender").getChild("load_camera") +logger = logging.getLogger("openpype").getChild("blender").getChild("load_camera") -class BlendCameraLoader(pype.hosts.blender.api.plugin.AssetLoader): +class BlendCameraLoader(openpype.hosts.blender.api.plugin.AssetLoader): """Load a camera from a .blend file. Warning: @@ -92,8 +92,8 @@ class BlendCameraLoader(pype.hosts.blender.api.plugin.AssetLoader): libpath = self.fname asset = context["asset"]["name"] subset = context["subset"]["name"] - lib_container = pype.hosts.blender.api.plugin.asset_name(asset, subset) - container_name = pype.hosts.blender.api.plugin.asset_name( + lib_container = openpype.hosts.blender.api.plugin.asset_name(asset, subset) + container_name = openpype.hosts.blender.api.plugin.asset_name( asset, subset, namespace ) @@ -162,7 +162,7 @@ class BlendCameraLoader(pype.hosts.blender.api.plugin.AssetLoader): assert libpath.is_file(), ( f"The file doesn't exist: {libpath}" ) - assert extension in pype.hosts.blender.api.plugin.VALID_EXTENSIONS, ( + assert extension in openpype.hosts.blender.api.plugin.VALID_EXTENSIONS, ( f"Unsupported file: {libpath}" ) @@ -216,7 +216,7 @@ class BlendCameraLoader(pype.hosts.blender.api.plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: diff --git a/pype/hosts/blender/plugins/load/load_layout.py b/openpype/hosts/blender/plugins/load/load_layout.py similarity index 98% rename from pype/hosts/blender/plugins/load/load_layout.py rename to openpype/hosts/blender/plugins/load/load_layout.py index 8d4c9fb75c..73b12d8c25 100644 --- a/pype/hosts/blender/plugins/load/load_layout.py +++ b/openpype/hosts/blender/plugins/load/load_layout.py @@ -11,8 +11,8 @@ from typing import Dict, List, Optional from avalon import api, blender, pipeline import bpy -import pype.hosts.blender.api.plugin as plugin -from pype.lib import get_creator_by_name +import openpype.hosts.blender.api.plugin as plugin +from openpype.lib import get_creator_by_name class BlendLayoutLoader(plugin.AssetLoader): @@ -251,7 +251,7 @@ class BlendLayoutLoader(plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: @@ -648,7 +648,7 @@ class UnrealLayoutLoader(plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: diff --git a/pype/hosts/blender/plugins/load/load_model.py b/openpype/hosts/blender/plugins/load/load_model.py similarity index 98% rename from pype/hosts/blender/plugins/load/load_model.py rename to openpype/hosts/blender/plugins/load/load_model.py index f48c0f8f94..7297e459a6 100644 --- a/pype/hosts/blender/plugins/load/load_model.py +++ b/openpype/hosts/blender/plugins/load/load_model.py @@ -7,7 +7,7 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.hosts.blender.api.plugin as plugin +import openpype.hosts.blender.api.plugin as plugin class BlendModelLoader(plugin.AssetLoader): @@ -211,7 +211,7 @@ class BlendModelLoader(plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: diff --git a/pype/hosts/blender/plugins/load/load_rig.py b/openpype/hosts/blender/plugins/load/load_rig.py similarity index 98% rename from pype/hosts/blender/plugins/load/load_rig.py rename to openpype/hosts/blender/plugins/load/load_rig.py index 1cc722045c..c5690a6ab8 100644 --- a/pype/hosts/blender/plugins/load/load_rig.py +++ b/openpype/hosts/blender/plugins/load/load_rig.py @@ -7,7 +7,7 @@ from typing import Dict, List, Optional from avalon import api, blender import bpy -import pype.hosts.blender.api.plugin as plugin +import openpype.hosts.blender.api.plugin as plugin class BlendRigLoader(plugin.AssetLoader): @@ -267,7 +267,7 @@ class BlendRigLoader(plugin.AssetLoader): """Remove an existing container from a Blender scene. Arguments: - container (avalon-core:container-1.0): Container to remove, + container (openpype:container-1.0): Container to remove, from `host.ls()`. Returns: diff --git a/pype/hosts/blender/plugins/publish/__init__.py b/openpype/hosts/blender/plugins/publish/__init__.py similarity index 100% rename from pype/hosts/blender/plugins/publish/__init__.py rename to openpype/hosts/blender/plugins/publish/__init__.py diff --git a/pype/hosts/blender/plugins/publish/collect_current_file.py b/openpype/hosts/blender/plugins/publish/collect_current_file.py similarity index 100% rename from pype/hosts/blender/plugins/publish/collect_current_file.py rename to openpype/hosts/blender/plugins/publish/collect_current_file.py diff --git a/pype/hosts/blender/plugins/publish/collect_instances.py b/openpype/hosts/blender/plugins/publish/collect_instances.py similarity index 100% rename from pype/hosts/blender/plugins/publish/collect_instances.py rename to openpype/hosts/blender/plugins/publish/collect_instances.py diff --git a/pype/hosts/blender/plugins/publish/extract_abc.py b/openpype/hosts/blender/plugins/publish/extract_abc.py similarity index 93% rename from pype/hosts/blender/plugins/publish/extract_abc.py rename to openpype/hosts/blender/plugins/publish/extract_abc.py index 949b28df51..6a89c6019b 100644 --- a/pype/hosts/blender/plugins/publish/extract_abc.py +++ b/openpype/hosts/blender/plugins/publish/extract_abc.py @@ -1,12 +1,12 @@ import os -import pype.api -import pype.hosts.blender.api.plugin +import openpype.api +import openpype.hosts.blender.api.plugin import bpy -class ExtractABC(pype.api.Extractor): +class ExtractABC(openpype.api.Extractor): """Extract as ABC.""" label = "Extract ABC" @@ -61,7 +61,7 @@ class ExtractABC(pype.api.Extractor): except: continue - new_context = pype.hosts.blender.api.plugin.create_blender_context( + new_context = openpype.hosts.blender.api.plugin.create_blender_context( active=selected[0], selected=selected) # We set the scale of the scene for the export diff --git a/pype/hosts/blender/plugins/publish/extract_animation_collection.py b/openpype/hosts/blender/plugins/publish/extract_animation_collection.py similarity index 96% rename from pype/hosts/blender/plugins/publish/extract_animation_collection.py rename to openpype/hosts/blender/plugins/publish/extract_animation_collection.py index 0cdd17cf1f..19dc59c5cd 100644 --- a/pype/hosts/blender/plugins/publish/extract_animation_collection.py +++ b/openpype/hosts/blender/plugins/publish/extract_animation_collection.py @@ -1,13 +1,13 @@ import os import json -import pype.api +import openpype.api import pyblish.api import bpy -class ExtractSetDress(pype.api.Extractor): +class ExtractSetDress(openpype.api.Extractor): """Extract setdress.""" label = "Extract SetDress" diff --git a/pype/hosts/blender/plugins/publish/extract_blend.py b/openpype/hosts/blender/plugins/publish/extract_blend.py similarity index 95% rename from pype/hosts/blender/plugins/publish/extract_blend.py rename to openpype/hosts/blender/plugins/publish/extract_blend.py index 6ba28d039a..890c8b5ffd 100644 --- a/pype/hosts/blender/plugins/publish/extract_blend.py +++ b/openpype/hosts/blender/plugins/publish/extract_blend.py @@ -1,10 +1,10 @@ import os import avalon.blender.workio -import pype.api +import openpype.api -class ExtractBlend(pype.api.Extractor): +class ExtractBlend(openpype.api.Extractor): """Extract a blend file.""" label = "Extract Blend" diff --git a/pype/hosts/blender/plugins/publish/extract_fbx.py b/openpype/hosts/blender/plugins/publish/extract_fbx.py similarity index 97% rename from pype/hosts/blender/plugins/publish/extract_fbx.py rename to openpype/hosts/blender/plugins/publish/extract_fbx.py index 231bfdde24..dc74348949 100644 --- a/pype/hosts/blender/plugins/publish/extract_fbx.py +++ b/openpype/hosts/blender/plugins/publish/extract_fbx.py @@ -1,11 +1,11 @@ import os -import pype.api +import openpype.api import bpy -class ExtractFBX(pype.api.Extractor): +class ExtractFBX(openpype.api.Extractor): """Extract as FBX.""" label = "Extract FBX" diff --git a/pype/hosts/blender/plugins/publish/extract_fbx_animation.py b/openpype/hosts/blender/plugins/publish/extract_fbx_animation.py similarity index 98% rename from pype/hosts/blender/plugins/publish/extract_fbx_animation.py rename to openpype/hosts/blender/plugins/publish/extract_fbx_animation.py index 9c421560f0..1036800705 100644 --- a/pype/hosts/blender/plugins/publish/extract_fbx_animation.py +++ b/openpype/hosts/blender/plugins/publish/extract_fbx_animation.py @@ -1,13 +1,13 @@ import os -import pype.api +import openpype.api import bpy import bpy_extras import bpy_extras.anim_utils -class ExtractAnimationFBX(pype.api.Extractor): +class ExtractAnimationFBX(openpype.api.Extractor): """Extract as animation.""" label = "Extract FBX" diff --git a/pype/hosts/blender/plugins/publish/increment_workfile_version.py b/openpype/hosts/blender/plugins/publish/increment_workfile_version.py similarity index 94% rename from pype/hosts/blender/plugins/publish/increment_workfile_version.py rename to openpype/hosts/blender/plugins/publish/increment_workfile_version.py index 5addca6392..db73842323 100644 --- a/pype/hosts/blender/plugins/publish/increment_workfile_version.py +++ b/openpype/hosts/blender/plugins/publish/increment_workfile_version.py @@ -16,7 +16,7 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin): assert all(result["success"] for result in context.data["results"]), ( "Publishing not succesfull so version is not increased.") - from pype.lib import version_up + from openpype.lib import version_up path = context.data["currentFile"] filepath = version_up(path) diff --git a/pype/hosts/blender/plugins/publish/integrate_animation.py b/openpype/hosts/blender/plugins/publish/integrate_animation.py similarity index 100% rename from pype/hosts/blender/plugins/publish/integrate_animation.py rename to openpype/hosts/blender/plugins/publish/integrate_animation.py diff --git a/pype/hosts/blender/plugins/publish/validate_mesh_has_uv.py b/openpype/hosts/blender/plugins/publish/validate_mesh_has_uv.py similarity index 93% rename from pype/hosts/blender/plugins/publish/validate_mesh_has_uv.py rename to openpype/hosts/blender/plugins/publish/validate_mesh_has_uv.py index c415ea0e0d..1c73476fc8 100644 --- a/pype/hosts/blender/plugins/publish/validate_mesh_has_uv.py +++ b/openpype/hosts/blender/plugins/publish/validate_mesh_has_uv.py @@ -3,7 +3,7 @@ from typing import List import bpy import pyblish.api -import pype.hosts.blender.api.action +import openpype.hosts.blender.api.action class ValidateMeshHasUvs(pyblish.api.InstancePlugin): @@ -14,7 +14,7 @@ class ValidateMeshHasUvs(pyblish.api.InstancePlugin): families = ["model"] category = "geometry" label = "Mesh Has UV's" - actions = [pype.hosts.blender.api.action.SelectInvalidAction] + actions = [openpype.hosts.blender.api.action.SelectInvalidAction] optional = True @staticmethod diff --git a/pype/hosts/blender/plugins/publish/validate_mesh_no_negative_scale.py b/openpype/hosts/blender/plugins/publish/validate_mesh_no_negative_scale.py similarity index 88% rename from pype/hosts/blender/plugins/publish/validate_mesh_no_negative_scale.py rename to openpype/hosts/blender/plugins/publish/validate_mesh_no_negative_scale.py index bbce37f3db..00159a2d36 100644 --- a/pype/hosts/blender/plugins/publish/validate_mesh_no_negative_scale.py +++ b/openpype/hosts/blender/plugins/publish/validate_mesh_no_negative_scale.py @@ -3,7 +3,7 @@ from typing import List import bpy import pyblish.api -import pype.hosts.blender.api.action +import openpype.hosts.blender.api.action class ValidateMeshNoNegativeScale(pyblish.api.Validator): @@ -13,7 +13,7 @@ class ValidateMeshNoNegativeScale(pyblish.api.Validator): hosts = ["blender"] families = ["model"] label = "Mesh No Negative Scale" - actions = [pype.hosts.blender.api.action.SelectInvalidAction] + actions = [openpype.hosts.blender.api.action.SelectInvalidAction] @staticmethod def get_invalid(instance) -> List: diff --git a/openpype/hosts/blender/startup/init.py b/openpype/hosts/blender/startup/init.py new file mode 100644 index 0000000000..4b4e48fedc --- /dev/null +++ b/openpype/hosts/blender/startup/init.py @@ -0,0 +1,3 @@ +from openpype.hosts.blender import api + +api.install() diff --git a/pype/hosts/celaction/__init__.py b/openpype/hosts/celaction/__init__.py similarity index 100% rename from pype/hosts/celaction/__init__.py rename to openpype/hosts/celaction/__init__.py diff --git a/pype/hosts/celaction/api/__init__.py b/openpype/hosts/celaction/api/__init__.py similarity index 100% rename from pype/hosts/celaction/api/__init__.py rename to openpype/hosts/celaction/api/__init__.py diff --git a/pype/hosts/celaction/api/cli.py b/openpype/hosts/celaction/api/cli.py similarity index 91% rename from pype/hosts/celaction/api/cli.py rename to openpype/hosts/celaction/api/cli.py index f77bdea451..0a70610acb 100644 --- a/pype/hosts/celaction/api/cli.py +++ b/openpype/hosts/celaction/api/cli.py @@ -9,16 +9,16 @@ from avalon.tools import publish import pyblish.api import pyblish.util -from pype.api import Logger -import pype -import pype.hosts.celaction -from pype.hosts.celaction import api as celaction +from openpype.api import Logger +import openpype +import openpype.hosts.celaction +from openpype.hosts.celaction import api as celaction log = Logger().get_logger("Celaction_cli_publisher") publish_host = "celaction" -HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.celaction.__file__)) +HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.celaction.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "load") @@ -89,7 +89,7 @@ def main(): _prepare_publish_environments() # Registers pype's Global pyblish plugins - pype.install() + openpype.install() if os.path.exists(PUBLISH_PATH): log.info(f"Registering path: {PUBLISH_PATH}") diff --git a/pype/hosts/celaction/hooks/__init__.py b/openpype/hosts/celaction/hooks/__init__.py similarity index 100% rename from pype/hosts/celaction/hooks/__init__.py rename to openpype/hosts/celaction/hooks/__init__.py diff --git a/pype/hosts/celaction/hooks/pre_celaction_registers.py b/openpype/hosts/celaction/hooks/pre_celaction_registers.py similarity index 96% rename from pype/hosts/celaction/hooks/pre_celaction_registers.py rename to openpype/hosts/celaction/hooks/pre_celaction_registers.py index 40e8eaa6ff..e49e66f163 100644 --- a/pype/hosts/celaction/hooks/pre_celaction_registers.py +++ b/openpype/hosts/celaction/hooks/pre_celaction_registers.py @@ -1,8 +1,8 @@ import os import shutil import winreg -from pype.lib import PreLaunchHook -from pype.hosts.celaction import api as celaction +from openpype.lib import PreLaunchHook +from openpype.hosts.celaction import api as celaction class CelactionPrelaunchHook(PreLaunchHook): @@ -35,7 +35,7 @@ class CelactionPrelaunchHook(PreLaunchHook): winreg.KEY_ALL_ACCESS) # TODO: this will need to be checked more thoroughly - pype_exe = os.getenv("PYPE_EXECUTABLE") + pype_exe = os.getenv("OPENPYPE_EXECUTABLE") winreg.SetValueEx(hKey, "SubmitAppTitle", 0, winreg.REG_SZ, pype_exe) diff --git a/pype/hosts/celaction/plugins/__init__.py b/openpype/hosts/celaction/plugins/__init__.py similarity index 100% rename from pype/hosts/celaction/plugins/__init__.py rename to openpype/hosts/celaction/plugins/__init__.py diff --git a/pype/hosts/celaction/plugins/publish/collect_audio.py b/openpype/hosts/celaction/plugins/publish/collect_audio.py similarity index 100% rename from pype/hosts/celaction/plugins/publish/collect_audio.py rename to openpype/hosts/celaction/plugins/publish/collect_audio.py diff --git a/pype/hosts/celaction/plugins/publish/collect_celaction_cli_kwargs.py b/openpype/hosts/celaction/plugins/publish/collect_celaction_cli_kwargs.py similarity index 93% rename from pype/hosts/celaction/plugins/publish/collect_celaction_cli_kwargs.py rename to openpype/hosts/celaction/plugins/publish/collect_celaction_cli_kwargs.py index 463805ce4b..15c5ddaf1c 100644 --- a/pype/hosts/celaction/plugins/publish/collect_celaction_cli_kwargs.py +++ b/openpype/hosts/celaction/plugins/publish/collect_celaction_cli_kwargs.py @@ -1,5 +1,5 @@ import pyblish.api -from pype.hosts.celaction import api as celaction +from openpype.hosts.celaction import api as celaction class CollectCelactionCliKwargs(pyblish.api.Collector): diff --git a/pype/hosts/celaction/plugins/publish/collect_celaction_instances.py b/openpype/hosts/celaction/plugins/publish/collect_celaction_instances.py similarity index 100% rename from pype/hosts/celaction/plugins/publish/collect_celaction_instances.py rename to openpype/hosts/celaction/plugins/publish/collect_celaction_instances.py diff --git a/pype/hosts/celaction/plugins/publish/collect_render_path.py b/openpype/hosts/celaction/plugins/publish/collect_render_path.py similarity index 100% rename from pype/hosts/celaction/plugins/publish/collect_render_path.py rename to openpype/hosts/celaction/plugins/publish/collect_render_path.py diff --git a/pype/hosts/celaction/plugins/publish/integrate_version_up.py b/openpype/hosts/celaction/plugins/publish/integrate_version_up.py similarity index 88% rename from pype/hosts/celaction/plugins/publish/integrate_version_up.py rename to openpype/hosts/celaction/plugins/publish/integrate_version_up.py index 140878e2b9..dc08127a8a 100644 --- a/pype/hosts/celaction/plugins/publish/integrate_version_up.py +++ b/openpype/hosts/celaction/plugins/publish/integrate_version_up.py @@ -1,5 +1,5 @@ import shutil -import pype +import openpype import pyblish.api @@ -12,7 +12,7 @@ class VersionUpScene(pyblish.api.ContextPlugin): def process(self, context): current_file = context.data.get('currentFile') - v_up = pype.lib.version_up(current_file) + v_up = openpype.lib.version_up(current_file) self.log.debug('Current file is: {}'.format(current_file)) self.log.debug('Version up: {}'.format(v_up)) diff --git a/pype/hosts/celaction/plugins/publish/submit_celaction_deadline.py b/openpype/hosts/celaction/plugins/publish/submit_celaction_deadline.py similarity index 100% rename from pype/hosts/celaction/plugins/publish/submit_celaction_deadline.py rename to openpype/hosts/celaction/plugins/publish/submit_celaction_deadline.py diff --git a/pype/hosts/celaction/resources/celaction_template_scene.scn b/openpype/hosts/celaction/resources/celaction_template_scene.scn similarity index 100% rename from pype/hosts/celaction/resources/celaction_template_scene.scn rename to openpype/hosts/celaction/resources/celaction_template_scene.scn diff --git a/pype/hosts/fusion/__init__.py b/openpype/hosts/fusion/__init__.py similarity index 100% rename from pype/hosts/fusion/__init__.py rename to openpype/hosts/fusion/__init__.py diff --git a/pype/hosts/fusion/api/__init__.py b/openpype/hosts/fusion/api/__init__.py similarity index 86% rename from pype/hosts/fusion/api/__init__.py rename to openpype/hosts/fusion/api/__init__.py index 61eaf44ddb..5581a0a9cb 100644 --- a/pype/hosts/fusion/api/__init__.py +++ b/openpype/hosts/fusion/api/__init__.py @@ -15,7 +15,7 @@ from .lib import ( update_frame_range ) -from .menu import launch_pype_menu +from .menu import launch_openpype_menu __all__ = [ @@ -34,5 +34,5 @@ __all__ = [ "update_frame_range", # menu - "launch_pype_menu", + "launch_openpype_menu", ] diff --git a/pype/hosts/fusion/api/lib.py b/openpype/hosts/fusion/api/lib.py similarity index 100% rename from pype/hosts/fusion/api/lib.py rename to openpype/hosts/fusion/api/lib.py diff --git a/pype/hosts/fusion/api/menu.py b/openpype/hosts/fusion/api/menu.py similarity index 86% rename from pype/hosts/fusion/api/menu.py rename to openpype/hosts/fusion/api/menu.py index c37f1daa49..3f04bf839b 100644 --- a/pype/hosts/fusion/api/menu.py +++ b/openpype/hosts/fusion/api/menu.py @@ -15,7 +15,7 @@ from avalon.tools import ( libraryloader ) -from pype.hosts.fusion.scripts import ( +from openpype.hosts.fusion.scripts import ( set_rendermode, duplicate_with_inputs ) @@ -49,11 +49,11 @@ class Spacer(QtWidgets.QWidget): self.setLayout(layout) -class PypeMenu(QtWidgets.QWidget): +class OpenPypeMenu(QtWidgets.QWidget): def __init__(self, *args, **kwargs): super(self.__class__, self).__init__(*args, **kwargs) - self.setObjectName("PypeMenu") + self.setObjectName("OpenPypeMenu") self.setWindowFlags( QtCore.Qt.Window @@ -63,14 +63,14 @@ class PypeMenu(QtWidgets.QWidget): | QtCore.Qt.WindowStaysOnTopHint ) self.render_mode_widget = None - self.setWindowTitle("Pype") - workfiles_btn = QtWidgets.QPushButton("Workfiles", self) - create_btn = QtWidgets.QPushButton("Create", self) - publish_btn = QtWidgets.QPushButton("Publish", self) - load_btn = QtWidgets.QPushButton("Load", self) - inventory_btn = QtWidgets.QPushButton("Inventory", self) - libload_btn = QtWidgets.QPushButton("Library", self) - rendermode_btn = QtWidgets.QPushButton("Set render mode", self) + self.setWindowTitle("OpenPype") + workfiles_btn = QtWidgets.QPushButton("Workfiles ...", self) + create_btn = QtWidgets.QPushButton("Create ...", self) + publish_btn = QtWidgets.QPushButton("Publish ...", self) + load_btn = QtWidgets.QPushButton("Load ...", self) + inventory_btn = QtWidgets.QPushButton("Inventory ...", self) + libload_btn = QtWidgets.QPushButton("Library ...", self) + rendermode_btn = QtWidgets.QPushButton("Set render mode ...", self) duplicate_with_inputs_btn = QtWidgets.QPushButton( "Duplicate with input connections", self ) @@ -156,11 +156,11 @@ class PypeMenu(QtWidgets.QWidget): print("Clicked Reset Resolution") -def launch_pype_menu(): +def launch_openpype_menu(): app = QtWidgets.QApplication(sys.argv) app.setQuitOnLastWindowClosed(False) - pype_menu = PypeMenu() + pype_menu = OpenPypeMenu() stylesheet = load_stylesheet() pype_menu.setStyleSheet(stylesheet) diff --git a/pype/hosts/fusion/api/menu_style.qss b/openpype/hosts/fusion/api/menu_style.qss similarity index 96% rename from pype/hosts/fusion/api/menu_style.qss rename to openpype/hosts/fusion/api/menu_style.qss index df4fd7e949..12c474b070 100644 --- a/pype/hosts/fusion/api/menu_style.qss +++ b/openpype/hosts/fusion/api/menu_style.qss @@ -20,7 +20,7 @@ QPushButton:hover { color: #e64b3d; } -#PypeMenu { +#OpenPypeMenu { border: 1px solid #fef9ef; } diff --git a/pype/hosts/fusion/api/pipeline.py b/openpype/hosts/fusion/api/pipeline.py similarity index 95% rename from pype/hosts/fusion/api/pipeline.py rename to openpype/hosts/fusion/api/pipeline.py index 36084dc734..4fec548993 100644 --- a/pype/hosts/fusion/api/pipeline.py +++ b/openpype/hosts/fusion/api/pipeline.py @@ -6,15 +6,12 @@ import os from avalon.tools import workfiles from avalon import api as avalon from pyblish import api as pyblish -from pype.api import Logger -import pype.hosts.fusion +from openpype.api import Logger +import openpype.hosts.fusion log = Logger().get_logger(__name__) - -AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype") - -HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.fusion.__file__)) +HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.fusion.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") diff --git a/pype/hosts/fusion/api/utils.py b/openpype/hosts/fusion/api/utils.py similarity index 94% rename from pype/hosts/fusion/api/utils.py rename to openpype/hosts/fusion/api/utils.py index 377c33d457..5605323b1e 100644 --- a/pype/hosts/fusion/api/utils.py +++ b/openpype/hosts/fusion/api/utils.py @@ -7,8 +7,8 @@ Fusion tools for setting environment import os import shutil -from pype.api import Logger -import pype.hosts.fusion +from openpype.api import Logger +import openpype.hosts.fusion log = Logger().get_logger(__name__) @@ -27,7 +27,7 @@ def _sync_utility_scripts(env=None): us_env = env.get("FUSION_UTILITY_SCRIPTS_SOURCE_DIR") us_dir = env.get("FUSION_UTILITY_SCRIPTS_DIR", "") us_paths = [os.path.join( - os.path.dirname(os.path.abspath(pype.hosts.fusion.__file__)), + os.path.dirname(os.path.abspath(openpype.hosts.fusion.__file__)), "utility_scripts" )] diff --git a/pype/hosts/fusion/hooks/pre_fusion_setup.py b/openpype/hosts/fusion/hooks/pre_fusion_setup.py similarity index 95% rename from pype/hosts/fusion/hooks/pre_fusion_setup.py rename to openpype/hosts/fusion/hooks/pre_fusion_setup.py index 0a6135419b..a0c16a6700 100644 --- a/pype/hosts/fusion/hooks/pre_fusion_setup.py +++ b/openpype/hosts/fusion/hooks/pre_fusion_setup.py @@ -1,7 +1,7 @@ import os import importlib -from pype.lib import PreLaunchHook -from pype.hosts.fusion.api import utils +from openpype.lib import PreLaunchHook +from openpype.hosts.fusion.api import utils class FusionPrelaunch(PreLaunchHook): diff --git a/pype/hosts/fusion/plugins/create/create_exr_saver.py b/openpype/hosts/fusion/plugins/create/create_exr_saver.py similarity index 95% rename from pype/hosts/fusion/plugins/create/create_exr_saver.py rename to openpype/hosts/fusion/plugins/create/create_exr_saver.py index 560f7deb7f..077e77c059 100644 --- a/pype/hosts/fusion/plugins/create/create_exr_saver.py +++ b/openpype/hosts/fusion/plugins/create/create_exr_saver.py @@ -1,10 +1,10 @@ import os -import pype.api +import openpype.api from avalon import fusion -class CreateOpenEXRSaver(pype.api.Creator): +class CreateOpenEXRSaver(openpype.api.Creator): name = "openexrDefault" label = "Create OpenEXR Saver" diff --git a/pype/hosts/fusion/plugins/inventory/select_containers.py b/openpype/hosts/fusion/plugins/inventory/select_containers.py similarity index 100% rename from pype/hosts/fusion/plugins/inventory/select_containers.py rename to openpype/hosts/fusion/plugins/inventory/select_containers.py diff --git a/pype/hosts/fusion/plugins/inventory/set_tool_color.py b/openpype/hosts/fusion/plugins/inventory/set_tool_color.py similarity index 100% rename from pype/hosts/fusion/plugins/inventory/set_tool_color.py rename to openpype/hosts/fusion/plugins/inventory/set_tool_color.py diff --git a/pype/hosts/fusion/plugins/load/actions.py b/openpype/hosts/fusion/plugins/load/actions.py similarity index 95% rename from pype/hosts/fusion/plugins/load/actions.py rename to openpype/hosts/fusion/plugins/load/actions.py index 51a32ee6e1..e1cdc6a41b 100644 --- a/pype/hosts/fusion/plugins/load/actions.py +++ b/openpype/hosts/fusion/plugins/load/actions.py @@ -22,7 +22,7 @@ class FusionSetFrameRangeLoader(api.Loader): def load(self, context, name, namespace, data): - from pype.hosts.fusion.api import lib + from openpype.hosts.fusion.api import lib version = context['version'] version_data = version.get("data", {}) @@ -55,7 +55,7 @@ class FusionSetFrameRangeWithHandlesLoader(api.Loader): def load(self, context, name, namespace, data): - from pype.hosts.fusion.api import lib + from openpype.hosts.fusion.api import lib version = context['version'] version_data = version.get("data", {}) diff --git a/pype/hosts/fusion/plugins/load/load_sequence.py b/openpype/hosts/fusion/plugins/load/load_sequence.py similarity index 100% rename from pype/hosts/fusion/plugins/load/load_sequence.py rename to openpype/hosts/fusion/plugins/load/load_sequence.py diff --git a/pype/hosts/fusion/plugins/publish/collect_comp.py b/openpype/hosts/fusion/plugins/publish/collect_comp.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/collect_comp.py rename to openpype/hosts/fusion/plugins/publish/collect_comp.py diff --git a/pype/hosts/fusion/plugins/publish/collect_fusion_version.py b/openpype/hosts/fusion/plugins/publish/collect_fusion_version.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/collect_fusion_version.py rename to openpype/hosts/fusion/plugins/publish/collect_fusion_version.py diff --git a/pype/hosts/fusion/plugins/publish/collect_instances.py b/openpype/hosts/fusion/plugins/publish/collect_instances.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/collect_instances.py rename to openpype/hosts/fusion/plugins/publish/collect_instances.py diff --git a/pype/hosts/fusion/plugins/publish/collect_render_target.py b/openpype/hosts/fusion/plugins/publish/collect_render_target.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/collect_render_target.py rename to openpype/hosts/fusion/plugins/publish/collect_render_target.py diff --git a/pype/hosts/fusion/plugins/publish/increment_current_file_deadline.py b/openpype/hosts/fusion/plugins/publish/increment_current_file_deadline.py similarity index 89% rename from pype/hosts/fusion/plugins/publish/increment_current_file_deadline.py rename to openpype/hosts/fusion/plugins/publish/increment_current_file_deadline.py index 9641ba7ef6..6483454d96 100644 --- a/pype/hosts/fusion/plugins/publish/increment_current_file_deadline.py +++ b/openpype/hosts/fusion/plugins/publish/increment_current_file_deadline.py @@ -16,8 +16,8 @@ class FusionIncrementCurrentFile(pyblish.api.ContextPlugin): def process(self, context): - from pype.lib import version_up - from pype.action import get_errored_plugins_from_data + from openpype.lib import version_up + from openpype.action import get_errored_plugins_from_data errored_plugins = get_errored_plugins_from_data(context) if any(plugin.__name__ == "FusionSubmitDeadline" diff --git a/pype/hosts/fusion/plugins/publish/render_local.py b/openpype/hosts/fusion/plugins/publish/render_local.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/render_local.py rename to openpype/hosts/fusion/plugins/publish/render_local.py diff --git a/pype/hosts/fusion/plugins/publish/save_scene.py b/openpype/hosts/fusion/plugins/publish/save_scene.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/save_scene.py rename to openpype/hosts/fusion/plugins/publish/save_scene.py diff --git a/pype/hosts/fusion/plugins/publish/submit_deadline.py b/openpype/hosts/fusion/plugins/publish/submit_deadline.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/submit_deadline.py rename to openpype/hosts/fusion/plugins/publish/submit_deadline.py diff --git a/pype/hosts/fusion/plugins/publish/validate_background_depth.py b/openpype/hosts/fusion/plugins/publish/validate_background_depth.py similarity index 97% rename from pype/hosts/fusion/plugins/publish/validate_background_depth.py rename to openpype/hosts/fusion/plugins/publish/validate_background_depth.py index de042ae315..a0734d8278 100644 --- a/pype/hosts/fusion/plugins/publish/validate_background_depth.py +++ b/openpype/hosts/fusion/plugins/publish/validate_background_depth.py @@ -1,6 +1,6 @@ import pyblish.api -from pype import action +from openpype import action class ValidateBackgroundDepth(pyblish.api.InstancePlugin): diff --git a/pype/hosts/fusion/plugins/publish/validate_comp_saved.py b/openpype/hosts/fusion/plugins/publish/validate_comp_saved.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/validate_comp_saved.py rename to openpype/hosts/fusion/plugins/publish/validate_comp_saved.py diff --git a/pype/hosts/fusion/plugins/publish/validate_create_folder_checked.py b/openpype/hosts/fusion/plugins/publish/validate_create_folder_checked.py similarity index 97% rename from pype/hosts/fusion/plugins/publish/validate_create_folder_checked.py rename to openpype/hosts/fusion/plugins/publish/validate_create_folder_checked.py index cce3695c31..45ed53f65c 100644 --- a/pype/hosts/fusion/plugins/publish/validate_create_folder_checked.py +++ b/openpype/hosts/fusion/plugins/publish/validate_create_folder_checked.py @@ -1,6 +1,6 @@ import pyblish.api -from pype import action +from openpype import action class ValidateCreateFolderChecked(pyblish.api.InstancePlugin): diff --git a/pype/hosts/fusion/plugins/publish/validate_filename_has_extension.py b/openpype/hosts/fusion/plugins/publish/validate_filename_has_extension.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/validate_filename_has_extension.py rename to openpype/hosts/fusion/plugins/publish/validate_filename_has_extension.py diff --git a/pype/hosts/fusion/plugins/publish/validate_saver_has_input.py b/openpype/hosts/fusion/plugins/publish/validate_saver_has_input.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/validate_saver_has_input.py rename to openpype/hosts/fusion/plugins/publish/validate_saver_has_input.py diff --git a/pype/hosts/fusion/plugins/publish/validate_saver_passthrough.py b/openpype/hosts/fusion/plugins/publish/validate_saver_passthrough.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/validate_saver_passthrough.py rename to openpype/hosts/fusion/plugins/publish/validate_saver_passthrough.py diff --git a/pype/hosts/fusion/plugins/publish/validate_unique_subsets.py b/openpype/hosts/fusion/plugins/publish/validate_unique_subsets.py similarity index 100% rename from pype/hosts/fusion/plugins/publish/validate_unique_subsets.py rename to openpype/hosts/fusion/plugins/publish/validate_unique_subsets.py diff --git a/pype/hosts/fusion/scripts/__init__.py b/openpype/hosts/fusion/scripts/__init__.py similarity index 100% rename from pype/hosts/fusion/scripts/__init__.py rename to openpype/hosts/fusion/scripts/__init__.py diff --git a/pype/hosts/fusion/scripts/duplicate_with_inputs.py b/openpype/hosts/fusion/scripts/duplicate_with_inputs.py similarity index 100% rename from pype/hosts/fusion/scripts/duplicate_with_inputs.py rename to openpype/hosts/fusion/scripts/duplicate_with_inputs.py diff --git a/pype/hosts/fusion/scripts/fusion_switch_shot.py b/openpype/hosts/fusion/scripts/fusion_switch_shot.py similarity index 99% rename from pype/hosts/fusion/scripts/fusion_switch_shot.py rename to openpype/hosts/fusion/scripts/fusion_switch_shot.py index 2eea68b007..05b577c8ba 100644 --- a/pype/hosts/fusion/scripts/fusion_switch_shot.py +++ b/openpype/hosts/fusion/scripts/fusion_switch_shot.py @@ -8,8 +8,8 @@ from avalon import api, io, pipeline import avalon.fusion # Config imports -import pype.lib as pype -import pype.hosts.fusion.api.lib as fusion_lib +import openpype.lib as pype +import openpype.hosts.fusion.api.lib as fusion_lib log = logging.getLogger("Update Slap Comp") diff --git a/pype/hosts/fusion/scripts/set_rendermode.py b/openpype/hosts/fusion/scripts/set_rendermode.py similarity index 100% rename from pype/hosts/fusion/scripts/set_rendermode.py rename to openpype/hosts/fusion/scripts/set_rendermode.py diff --git a/pype/hosts/fusion/utility_scripts/32bit/backgrounds_selected_to32bit.py b/openpype/hosts/fusion/utility_scripts/32bit/backgrounds_selected_to32bit.py similarity index 100% rename from pype/hosts/fusion/utility_scripts/32bit/backgrounds_selected_to32bit.py rename to openpype/hosts/fusion/utility_scripts/32bit/backgrounds_selected_to32bit.py diff --git a/pype/hosts/fusion/utility_scripts/32bit/backgrounds_to32bit.py b/openpype/hosts/fusion/utility_scripts/32bit/backgrounds_to32bit.py similarity index 100% rename from pype/hosts/fusion/utility_scripts/32bit/backgrounds_to32bit.py rename to openpype/hosts/fusion/utility_scripts/32bit/backgrounds_to32bit.py diff --git a/pype/hosts/fusion/utility_scripts/32bit/loaders_selected_to32bit.py b/openpype/hosts/fusion/utility_scripts/32bit/loaders_selected_to32bit.py similarity index 100% rename from pype/hosts/fusion/utility_scripts/32bit/loaders_selected_to32bit.py rename to openpype/hosts/fusion/utility_scripts/32bit/loaders_selected_to32bit.py diff --git a/pype/hosts/fusion/utility_scripts/32bit/loaders_to32bit.py b/openpype/hosts/fusion/utility_scripts/32bit/loaders_to32bit.py similarity index 100% rename from pype/hosts/fusion/utility_scripts/32bit/loaders_to32bit.py rename to openpype/hosts/fusion/utility_scripts/32bit/loaders_to32bit.py diff --git a/pype/hosts/fusion/utility_scripts/Pype_menu.py b/openpype/hosts/fusion/utility_scripts/__OpenPype_Menu__.py similarity index 71% rename from pype/hosts/fusion/utility_scripts/Pype_menu.py rename to openpype/hosts/fusion/utility_scripts/__OpenPype_Menu__.py index 0cd2b7502e..81df2bc31d 100644 --- a/pype/hosts/fusion/utility_scripts/Pype_menu.py +++ b/openpype/hosts/fusion/utility_scripts/__OpenPype_Menu__.py @@ -1,24 +1,24 @@ import os import sys -import pype +import openpype -from pype.api import Logger +from openpype.api import Logger log = Logger().get_logger(__name__) def main(env): - from pype.hosts.fusion.api import menu + from openpype.hosts.fusion.api import menu import avalon.fusion # Registers pype's Global pyblish plugins - pype.install() + openpype.install() # activate resolve from pype avalon.api.install(avalon.fusion) log.info(f"Avalon registred hosts: {avalon.api.registered_host()}") - menu.launch_pype_menu() + menu.launch_openpype_menu() if __name__ == "__main__": diff --git a/pype/hosts/fusion/utility_scripts/switch_ui.py b/openpype/hosts/fusion/utility_scripts/switch_ui.py similarity index 100% rename from pype/hosts/fusion/utility_scripts/switch_ui.py rename to openpype/hosts/fusion/utility_scripts/switch_ui.py diff --git a/pype/hosts/fusion/utility_scripts/update_loader_ranges.py b/openpype/hosts/fusion/utility_scripts/update_loader_ranges.py similarity index 100% rename from pype/hosts/fusion/utility_scripts/update_loader_ranges.py rename to openpype/hosts/fusion/utility_scripts/update_loader_ranges.py diff --git a/pype/hosts/harmony/__init__.py b/openpype/hosts/harmony/__init__.py similarity index 100% rename from pype/hosts/harmony/__init__.py rename to openpype/hosts/harmony/__init__.py diff --git a/pype/hosts/harmony/api/__init__.py b/openpype/hosts/harmony/api/__init__.py similarity index 95% rename from pype/hosts/harmony/api/__init__.py rename to openpype/hosts/harmony/api/__init__.py index 1a0255d045..705ccef892 100644 --- a/pype/hosts/harmony/api/__init__.py +++ b/openpype/hosts/harmony/api/__init__.py @@ -4,9 +4,9 @@ import os from pathlib import Path import logging -from pype import lib -from pype.api import (get_current_project_settings) -import pype.hosts.harmony +from openpype import lib +from openpype.api import (get_current_project_settings) +import openpype.hosts.harmony import pyblish.api @@ -15,9 +15,9 @@ import avalon.api import avalon.tools.sceneinventory -log = logging.getLogger("pype.hosts.harmony") +log = logging.getLogger("openpype.hosts.harmony") -HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.harmony.__file__)) +HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.harmony.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "load") @@ -154,7 +154,7 @@ def application_launch(): # It is now moved so it it manually called. # ensure_scene_settings() # check_inventory() - # fills PYPE_HARMONY_JS + # fills OPENPYPE_HARMONY_JS pype_harmony_path = Path(__file__).parent.parent / "js" / "PypeHarmony.js" pype_harmony_js = pype_harmony_path.read_text() diff --git a/pype/hosts/harmony/api/plugin.py b/openpype/hosts/harmony/api/plugin.py similarity index 67% rename from pype/hosts/harmony/api/plugin.py rename to openpype/hosts/harmony/api/plugin.py index 3525ad686d..7ac7fe510c 100644 --- a/pype/hosts/harmony/api/plugin.py +++ b/openpype/hosts/harmony/api/plugin.py @@ -1,5 +1,5 @@ from avalon import harmony -from pype.api import PypeCreatorMixin +from openpype.api import PypeCreatorMixin class Creator(PypeCreatorMixin, harmony.Creator): diff --git a/pype/hosts/harmony/js/.eslintrc.json b/openpype/hosts/harmony/js/.eslintrc.json similarity index 100% rename from pype/hosts/harmony/js/.eslintrc.json rename to openpype/hosts/harmony/js/.eslintrc.json diff --git a/pype/hosts/harmony/js/PypeHarmony.js b/openpype/hosts/harmony/js/PypeHarmony.js similarity index 100% rename from pype/hosts/harmony/js/PypeHarmony.js rename to openpype/hosts/harmony/js/PypeHarmony.js diff --git a/pype/hosts/harmony/js/README.md b/openpype/hosts/harmony/js/README.md similarity index 100% rename from pype/hosts/harmony/js/README.md rename to openpype/hosts/harmony/js/README.md diff --git a/pype/hosts/harmony/js/creators/CreateRender.js b/openpype/hosts/harmony/js/creators/CreateRender.js similarity index 86% rename from pype/hosts/harmony/js/creators/CreateRender.js rename to openpype/hosts/harmony/js/creators/CreateRender.js index cfb0701df4..92ec6dfd2f 100644 --- a/pype/hosts/harmony/js/creators/CreateRender.js +++ b/openpype/hosts/harmony/js/creators/CreateRender.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/loaders/ImageSequenceLoader.js b/openpype/hosts/harmony/js/loaders/ImageSequenceLoader.js similarity index 98% rename from pype/hosts/harmony/js/loaders/ImageSequenceLoader.js rename to openpype/hosts/harmony/js/loaders/ImageSequenceLoader.js index cfa71e2834..d809c350ab 100644 --- a/pype/hosts/harmony/js/loaders/ImageSequenceLoader.js +++ b/openpype/hosts/harmony/js/loaders/ImageSequenceLoader.js @@ -5,8 +5,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } if (typeof $ === 'undefined'){ diff --git a/pype/hosts/harmony/js/loaders/TemplateLoader.js b/openpype/hosts/harmony/js/loaders/TemplateLoader.js similarity index 97% rename from pype/hosts/harmony/js/loaders/TemplateLoader.js rename to openpype/hosts/harmony/js/loaders/TemplateLoader.js index 160979f943..1df04c8282 100644 --- a/pype/hosts/harmony/js/loaders/TemplateLoader.js +++ b/openpype/hosts/harmony/js/loaders/TemplateLoader.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } if (typeof $ === 'undefined'){ diff --git a/pype/hosts/harmony/js/package.json b/openpype/hosts/harmony/js/package.json similarity index 100% rename from pype/hosts/harmony/js/package.json rename to openpype/hosts/harmony/js/package.json diff --git a/pype/hosts/harmony/js/publish/CollectCurrentFile.js b/openpype/hosts/harmony/js/publish/CollectCurrentFile.js similarity index 84% rename from pype/hosts/harmony/js/publish/CollectCurrentFile.js rename to openpype/hosts/harmony/js/publish/CollectCurrentFile.js index d39f23712d..2eeb7fb764 100644 --- a/pype/hosts/harmony/js/publish/CollectCurrentFile.js +++ b/openpype/hosts/harmony/js/publish/CollectCurrentFile.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/publish/CollectFarmRender.js b/openpype/hosts/harmony/js/publish/CollectFarmRender.js similarity index 90% rename from pype/hosts/harmony/js/publish/CollectFarmRender.js rename to openpype/hosts/harmony/js/publish/CollectFarmRender.js index 7c0cda5165..759dc5ce5d 100644 --- a/pype/hosts/harmony/js/publish/CollectFarmRender.js +++ b/openpype/hosts/harmony/js/publish/CollectFarmRender.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/publish/CollectPalettes.js b/openpype/hosts/harmony/js/publish/CollectPalettes.js similarity index 86% rename from pype/hosts/harmony/js/publish/CollectPalettes.js rename to openpype/hosts/harmony/js/publish/CollectPalettes.js index 8fda55ff75..afb0ad854a 100644 --- a/pype/hosts/harmony/js/publish/CollectPalettes.js +++ b/openpype/hosts/harmony/js/publish/CollectPalettes.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/publish/ExtractPalette.js b/openpype/hosts/harmony/js/publish/ExtractPalette.js similarity index 88% rename from pype/hosts/harmony/js/publish/ExtractPalette.js rename to openpype/hosts/harmony/js/publish/ExtractPalette.js index 794c6fdbb1..c4765354c4 100644 --- a/pype/hosts/harmony/js/publish/ExtractPalette.js +++ b/openpype/hosts/harmony/js/publish/ExtractPalette.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } /** diff --git a/pype/hosts/harmony/js/publish/ExtractTemplate.js b/openpype/hosts/harmony/js/publish/ExtractTemplate.js similarity index 91% rename from pype/hosts/harmony/js/publish/ExtractTemplate.js rename to openpype/hosts/harmony/js/publish/ExtractTemplate.js index d36a8947f8..4676e1ff68 100644 --- a/pype/hosts/harmony/js/publish/ExtractTemplate.js +++ b/openpype/hosts/harmony/js/publish/ExtractTemplate.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/plugins/__init__.py b/openpype/hosts/harmony/plugins/__init__.py similarity index 100% rename from pype/hosts/harmony/plugins/__init__.py rename to openpype/hosts/harmony/plugins/__init__.py diff --git a/pype/hosts/harmony/plugins/create/create_farm_render.py b/openpype/hosts/harmony/plugins/create/create_farm_render.py similarity index 95% rename from pype/hosts/harmony/plugins/create/create_farm_render.py rename to openpype/hosts/harmony/plugins/create/create_farm_render.py index a1b198b672..26dab92034 100644 --- a/pype/hosts/harmony/plugins/create/create_farm_render.py +++ b/openpype/hosts/harmony/plugins/create/create_farm_render.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Create Composite node for render on farm.""" from avalon import harmony -from pype.hosts.harmony.api import plugin +from openpype.hosts.harmony.api import plugin class CreateFarmRender(plugin.Creator): diff --git a/pype/hosts/harmony/plugins/create/create_render.py b/openpype/hosts/harmony/plugins/create/create_render.py similarity index 93% rename from pype/hosts/harmony/plugins/create/create_render.py rename to openpype/hosts/harmony/plugins/create/create_render.py index b9a0987b37..b7fd6e6ef9 100644 --- a/pype/hosts/harmony/plugins/create/create_render.py +++ b/openpype/hosts/harmony/plugins/create/create_render.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Create render node.""" from avalon import harmony -from pype.hosts.harmony.api import plugin +from openpype.hosts.harmony.api import plugin class CreateRender(plugin.Creator): diff --git a/pype/hosts/harmony/plugins/create/create_template.py b/openpype/hosts/harmony/plugins/create/create_template.py similarity index 86% rename from pype/hosts/harmony/plugins/create/create_template.py rename to openpype/hosts/harmony/plugins/create/create_template.py index 628606c9f4..534179b190 100644 --- a/pype/hosts/harmony/plugins/create/create_template.py +++ b/openpype/hosts/harmony/plugins/create/create_template.py @@ -1,4 +1,4 @@ -from pype.hosts.harmony.api import plugin +from openpype.hosts.harmony.api import plugin class CreateTemplate(plugin.Creator): diff --git a/pype/hosts/harmony/plugins/load/load_audio.py b/openpype/hosts/harmony/plugins/load/load_audio.py similarity index 100% rename from pype/hosts/harmony/plugins/load/load_audio.py rename to openpype/hosts/harmony/plugins/load/load_audio.py diff --git a/pype/hosts/harmony/plugins/load/load_background.py b/openpype/hosts/harmony/plugins/load/load_background.py similarity index 99% rename from pype/hosts/harmony/plugins/load/load_background.py rename to openpype/hosts/harmony/plugins/load/load_background.py index 5ef4535576..946090f6e6 100644 --- a/pype/hosts/harmony/plugins/load/load_background.py +++ b/openpype/hosts/harmony/plugins/load/load_background.py @@ -2,7 +2,7 @@ import os import json from avalon import api, harmony -import pype.lib +import openpype.lib copy_files = """function copyFile(srcFilename, dstFilename) @@ -343,7 +343,7 @@ class BackgroundLoader(api.Loader): } %s """ % (sig, sig) - if pype.lib.is_latest(representation): + if openpype.lib.is_latest(representation): harmony.send({"function": func, "args": [node, "green"]}) else: harmony.send({"function": func, "args": [node, "red"]}) diff --git a/pype/hosts/harmony/plugins/load/load_imagesequence.py b/openpype/hosts/harmony/plugins/load/load_imagesequence.py similarity index 98% rename from pype/hosts/harmony/plugins/load/load_imagesequence.py rename to openpype/hosts/harmony/plugins/load/load_imagesequence.py index db7af90b14..80f63a8049 100644 --- a/pype/hosts/harmony/plugins/load/load_imagesequence.py +++ b/openpype/hosts/harmony/plugins/load/load_imagesequence.py @@ -7,7 +7,7 @@ from pathlib import Path import clique from avalon import api, harmony -import pype.lib +import openpype.lib class ImageSequenceLoader(api.Loader): @@ -105,7 +105,7 @@ class ImageSequenceLoader(api.Loader): ) # Colour node. - if pype.lib.is_latest(representation): + if openpype.lib.is_latest(representation): harmony.send( { "function": "PypeHarmony.setColor", diff --git a/pype/hosts/harmony/plugins/load/load_palette.py b/openpype/hosts/harmony/plugins/load/load_palette.py similarity index 100% rename from pype/hosts/harmony/plugins/load/load_palette.py rename to openpype/hosts/harmony/plugins/load/load_palette.py diff --git a/pype/hosts/harmony/plugins/load/load_template.py b/openpype/hosts/harmony/plugins/load/load_template.py similarity index 98% rename from pype/hosts/harmony/plugins/load/load_template.py rename to openpype/hosts/harmony/plugins/load/load_template.py index 59135c7931..34161daf81 100644 --- a/pype/hosts/harmony/plugins/load/load_template.py +++ b/openpype/hosts/harmony/plugins/load/load_template.py @@ -7,7 +7,7 @@ import shutil import uuid from avalon import api, harmony -import pype.lib +import openpype.lib class TemplateLoader(api.Loader): @@ -79,7 +79,7 @@ class TemplateLoader(api.Loader): self_name = self.__class__.__name__ update_and_replace = False - if pype.lib.is_latest(representation): + if openpype.lib.is_latest(representation): self._set_green(node) else: self._set_red(node) diff --git a/pype/hosts/harmony/plugins/load/load_template_workfile.py b/openpype/hosts/harmony/plugins/load/load_template_workfile.py similarity index 100% rename from pype/hosts/harmony/plugins/load/load_template_workfile.py rename to openpype/hosts/harmony/plugins/load/load_template_workfile.py diff --git a/pype/hosts/harmony/plugins/publish/collect_audio.py b/openpype/hosts/harmony/plugins/publish/collect_audio.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/collect_audio.py rename to openpype/hosts/harmony/plugins/publish/collect_audio.py diff --git a/pype/hosts/harmony/plugins/publish/collect_current_file.py b/openpype/hosts/harmony/plugins/publish/collect_current_file.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/collect_current_file.py rename to openpype/hosts/harmony/plugins/publish/collect_current_file.py diff --git a/pype/hosts/harmony/plugins/publish/collect_farm_render.py b/openpype/hosts/harmony/plugins/publish/collect_farm_render.py similarity index 90% rename from pype/hosts/harmony/plugins/publish/collect_farm_render.py rename to openpype/hosts/harmony/plugins/publish/collect_farm_render.py index 98706ad951..fc80e7c029 100644 --- a/pype/hosts/harmony/plugins/publish/collect_farm_render.py +++ b/openpype/hosts/harmony/plugins/publish/collect_farm_render.py @@ -5,9 +5,9 @@ from pathlib import Path import attr from avalon import harmony, api -import pype.lib.abstract_collect_render -from pype.lib.abstract_collect_render import RenderInstance -import pype.lib +import openpype.lib.abstract_collect_render +from openpype.lib.abstract_collect_render import RenderInstance +import openpype.lib @attr.s @@ -18,7 +18,7 @@ class HarmonyRenderInstance(RenderInstance): leadingZeros = attr.ib(default=3) -class CollectFarmRender(pype.lib.abstract_collect_render. +class CollectFarmRender(openpype.lib.abstract_collect_render. AbstractCollectRender): """Gather all publishable renders.""" @@ -124,10 +124,16 @@ class CollectFarmRender(pype.lib.abstract_collect_render. # TODO: handle pixel aspect and frame step # TODO: set Deadline stuff (pools, priority, etc. by presets) # because of using 'renderFarm' as a family, replace 'Farm' with - # capitalized task name - subset_name = node.split("/")[1].replace( + # capitalized task name - issue of avalon-core Creator app + subset_name = node.split("/")[1] + task_name = context.data["anatomyData"]["task"].capitalize() + replace_str = "" + if task_name.lower() not in subset_name.lower(): + replace_str = task_name + subset_name = subset_name.replace( 'Farm', - context.data["anatomyData"]["task"].capitalize()) + replace_str) + render_instance = HarmonyRenderInstance( version=version, time=api.time(), diff --git a/pype/hosts/harmony/plugins/publish/collect_instances.py b/openpype/hosts/harmony/plugins/publish/collect_instances.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/collect_instances.py rename to openpype/hosts/harmony/plugins/publish/collect_instances.py diff --git a/pype/hosts/harmony/plugins/publish/collect_palettes.py b/openpype/hosts/harmony/plugins/publish/collect_palettes.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/collect_palettes.py rename to openpype/hosts/harmony/plugins/publish/collect_palettes.py diff --git a/pype/hosts/harmony/plugins/publish/collect_scene.py b/openpype/hosts/harmony/plugins/publish/collect_scene.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/collect_scene.py rename to openpype/hosts/harmony/plugins/publish/collect_scene.py diff --git a/pype/hosts/harmony/plugins/publish/collect_workfile.py b/openpype/hosts/harmony/plugins/publish/collect_workfile.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/collect_workfile.py rename to openpype/hosts/harmony/plugins/publish/collect_workfile.py diff --git a/pype/hosts/harmony/plugins/publish/extract_palette.py b/openpype/hosts/harmony/plugins/publish/extract_palette.py similarity index 99% rename from pype/hosts/harmony/plugins/publish/extract_palette.py rename to openpype/hosts/harmony/plugins/publish/extract_palette.py index 39a822153c..d334883e9c 100644 --- a/pype/hosts/harmony/plugins/publish/extract_palette.py +++ b/openpype/hosts/harmony/plugins/publish/extract_palette.py @@ -6,10 +6,10 @@ import csv from PIL import Image, ImageDraw, ImageFont from avalon import harmony -import pype.api +import openpype.api -class ExtractPalette(pype.api.Extractor): +class ExtractPalette(openpype.api.Extractor): """Extract palette.""" label = "Extract Palette" diff --git a/pype/hosts/harmony/plugins/publish/extract_render.py b/openpype/hosts/harmony/plugins/publish/extract_render.py similarity index 98% rename from pype/hosts/harmony/plugins/publish/extract_render.py rename to openpype/hosts/harmony/plugins/publish/extract_render.py index 551d7afee1..8374a9427a 100644 --- a/pype/hosts/harmony/plugins/publish/extract_render.py +++ b/openpype/hosts/harmony/plugins/publish/extract_render.py @@ -4,7 +4,7 @@ import subprocess import pyblish.api from avalon import harmony -import pype.lib +import openpype.lib import clique @@ -89,7 +89,7 @@ class ExtractRender(pyblish.api.InstancePlugin): # Generate thumbnail. thumbnail_path = os.path.join(path, "thumbnail.png") - ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg") + ffmpeg_path = openpype.lib.get_ffmpeg_tool_path("ffmpeg") args = [ "{}".format(ffmpeg_path), "-y", "-i", os.path.join(path, list(collections[0])[0]), diff --git a/pype/hosts/harmony/plugins/publish/extract_save_scene.py b/openpype/hosts/harmony/plugins/publish/extract_save_scene.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/extract_save_scene.py rename to openpype/hosts/harmony/plugins/publish/extract_save_scene.py diff --git a/pype/hosts/harmony/plugins/publish/extract_template.py b/openpype/hosts/harmony/plugins/publish/extract_template.py similarity index 96% rename from pype/hosts/harmony/plugins/publish/extract_template.py rename to openpype/hosts/harmony/plugins/publish/extract_template.py index 842bc77202..687fa19c22 100644 --- a/pype/hosts/harmony/plugins/publish/extract_template.py +++ b/openpype/hosts/harmony/plugins/publish/extract_template.py @@ -3,12 +3,12 @@ import os import shutil -import pype.api +import openpype.api from avalon import harmony -import pype.hosts.harmony +import openpype.hosts.harmony -class ExtractTemplate(pype.api.Extractor): +class ExtractTemplate(openpype.api.Extractor): """Extract the connected nodes to the composite instance.""" label = "Extract Template" @@ -50,7 +50,7 @@ class ExtractTemplate(pype.api.Extractor): dependencies.remove(instance.data["setMembers"][0]) # Export template. - pype.hosts.harmony.api.export_template( + openpype.hosts.harmony.api.export_template( unique_backdrops, dependencies, filepath ) diff --git a/pype/hosts/harmony/plugins/publish/extract_workfile.py b/openpype/hosts/harmony/plugins/publish/extract_workfile.py similarity index 94% rename from pype/hosts/harmony/plugins/publish/extract_workfile.py rename to openpype/hosts/harmony/plugins/publish/extract_workfile.py index 842d0aa8d3..7f25ec8150 100644 --- a/pype/hosts/harmony/plugins/publish/extract_workfile.py +++ b/openpype/hosts/harmony/plugins/publish/extract_workfile.py @@ -4,10 +4,10 @@ import os import shutil from zipfile import ZipFile -import pype.api +import openpype.api -class ExtractWorkfile(pype.api.Extractor): +class ExtractWorkfile(openpype.api.Extractor): """Extract and zip complete workfile folder into zip.""" label = "Extract Workfile" diff --git a/pype/hosts/harmony/plugins/publish/increment_workfile.py b/openpype/hosts/harmony/plugins/publish/increment_workfile.py similarity index 91% rename from pype/hosts/harmony/plugins/publish/increment_workfile.py rename to openpype/hosts/harmony/plugins/publish/increment_workfile.py index 858e5fab0e..fcbe299d15 100644 --- a/pype/hosts/harmony/plugins/publish/increment_workfile.py +++ b/openpype/hosts/harmony/plugins/publish/increment_workfile.py @@ -1,8 +1,8 @@ import os import pyblish.api -from pype.action import get_errored_plugins_from_data -from pype.lib import version_up +from openpype.action import get_errored_plugins_from_data +from openpype.lib import version_up from avalon import harmony diff --git a/pype/hosts/harmony/plugins/publish/validate_audio.py b/openpype/hosts/harmony/plugins/publish/validate_audio.py similarity index 100% rename from pype/hosts/harmony/plugins/publish/validate_audio.py rename to openpype/hosts/harmony/plugins/publish/validate_audio.py diff --git a/pype/hosts/harmony/plugins/publish/validate_instances.py b/openpype/hosts/harmony/plugins/publish/validate_instances.py similarity index 95% rename from pype/hosts/harmony/plugins/publish/validate_instances.py rename to openpype/hosts/harmony/plugins/publish/validate_instances.py index 238f8d1038..78073a1978 100644 --- a/pype/hosts/harmony/plugins/publish/validate_instances.py +++ b/openpype/hosts/harmony/plugins/publish/validate_instances.py @@ -1,7 +1,7 @@ import os import pyblish.api -import pype.api +import openpype.api from avalon import harmony @@ -36,7 +36,7 @@ class ValidateInstance(pyblish.api.InstancePlugin): label = "Validate Instance" hosts = ["harmony"] actions = [ValidateInstanceRepair] - order = pype.api.ValidateContentsOrder + order = openpype.api.ValidateContentsOrder def process(self, instance): instance_asset = instance.data["asset"] diff --git a/pype/hosts/harmony/plugins/publish/validate_scene_settings.py b/openpype/hosts/harmony/plugins/publish/validate_scene_settings.py similarity index 95% rename from pype/hosts/harmony/plugins/publish/validate_scene_settings.py rename to openpype/hosts/harmony/plugins/publish/validate_scene_settings.py index 9b8a6183df..b3e7f49268 100644 --- a/pype/hosts/harmony/plugins/publish/validate_scene_settings.py +++ b/openpype/hosts/harmony/plugins/publish/validate_scene_settings.py @@ -6,7 +6,7 @@ import json import pyblish.api from avalon import harmony -import pype.hosts.harmony +import openpype.hosts.harmony class ValidateSceneSettingsRepair(pyblish.api.Action): @@ -18,12 +18,12 @@ class ValidateSceneSettingsRepair(pyblish.api.Action): def process(self, context, plugin): """Repair action entry point.""" - expected = pype.hosts.harmony.api.get_asset_settings() + expected = openpype.hosts.harmony.api.get_asset_settings() asset_settings = _update_frames(dict.copy(expected)) asset_settings["frameStart"] = 1 asset_settings["frameEnd"] = asset_settings["frameEnd"] + \ asset_settings["handleEnd"] - pype.hosts.harmony.api.set_scene_settings(asset_settings) + openpype.hosts.harmony.api.set_scene_settings(asset_settings) if not os.path.exists(context.data["scenePath"]): self.log.info("correcting scene name") scene_dir = os.path.dirname(context.data["currentFile"]) @@ -48,7 +48,7 @@ class ValidateSceneSettings(pyblish.api.InstancePlugin): def process(self, instance): """Plugin entry point.""" - expected_settings = pype.hosts.harmony.api.get_asset_settings() + expected_settings = openpype.hosts.harmony.api.get_asset_settings() self.log.info(expected_settings) expected_settings = _update_frames(dict.copy(expected_settings)) diff --git a/pype/hosts/hiero/__init__.py b/openpype/hosts/hiero/__init__.py similarity index 100% rename from pype/hosts/hiero/__init__.py rename to openpype/hosts/hiero/__init__.py diff --git a/pype/hosts/hiero/api/__init__.py b/openpype/hosts/hiero/api/__init__.py similarity index 100% rename from pype/hosts/hiero/api/__init__.py rename to openpype/hosts/hiero/api/__init__.py diff --git a/pype/hosts/hiero/api/events.py b/openpype/hosts/hiero/api/events.py similarity index 99% rename from pype/hosts/hiero/api/events.py rename to openpype/hosts/hiero/api/events.py index 918912ce2e..c02e3e2ac4 100644 --- a/pype/hosts/hiero/api/events.py +++ b/openpype/hosts/hiero/api/events.py @@ -1,7 +1,7 @@ import os import hiero.core.events import avalon.api as avalon -from pype.api import Logger +from openpype.api import Logger from .lib import sync_avalon_data_to_workfile, launch_workfiles_app from .tags import add_tags_to_workfile from .menu import update_menu_task_label diff --git a/pype/hosts/hiero/api/lib.py b/openpype/hosts/hiero/api/lib.py similarity index 99% rename from pype/hosts/hiero/api/lib.py rename to openpype/hosts/hiero/api/lib.py index 14760a3137..b74e70cae3 100644 --- a/pype/hosts/hiero/api/lib.py +++ b/openpype/hosts/hiero/api/lib.py @@ -9,7 +9,7 @@ import hiero import avalon.api as avalon import avalon.io from avalon.vendor.Qt import QtWidgets -from pype.api import (Logger, Anatomy, config) +from openpype.api import (Logger, Anatomy, config) from . import tags import shutil from compiler.ast import flatten @@ -241,7 +241,7 @@ def set_track_item_pype_tag(track_item, data=None): tag_data = { "editable": "0", "note": "Pype data holder", - "icon": "pype_icon.png", + "icon": "openpype_icon.png", "metadata": {k: v for k, v in data.items()} } # get available pype tag if any diff --git a/pype/hosts/hiero/api/menu.py b/openpype/hosts/hiero/api/menu.py similarity index 99% rename from pype/hosts/hiero/api/menu.py rename to openpype/hosts/hiero/api/menu.py index f32bea07e1..9ccf5e39d1 100644 --- a/pype/hosts/hiero/api/menu.py +++ b/openpype/hosts/hiero/api/menu.py @@ -1,7 +1,7 @@ import os import sys import hiero.core -from pype.api import Logger +from openpype.api import Logger from avalon.api import Session from hiero.ui import findMenuAction diff --git a/pype/hosts/hiero/api/pipeline.py b/openpype/hosts/hiero/api/pipeline.py similarity index 98% rename from pype/hosts/hiero/api/pipeline.py rename to openpype/hosts/hiero/api/pipeline.py index 26777fa252..ab7e2bdabf 100644 --- a/pype/hosts/hiero/api/pipeline.py +++ b/openpype/hosts/hiero/api/pipeline.py @@ -12,7 +12,7 @@ from avalon.pipeline import AVALON_CONTAINER_ID from avalon import api as avalon from avalon import schema from pyblish import api as pyblish -from pype.api import Logger +from openpype.api import Logger from . import lib, menu, events log = Logger().get_logger(__name__) @@ -110,7 +110,7 @@ def containerise(track_item, """ data_imprint = OrderedDict({ - "schema": "avalon-core:container-2.0", + "schema": "openpype:container-2.0", "id": AVALON_CONTAINER_ID, "name": str(name), "namespace": str(namespace), @@ -289,7 +289,7 @@ def on_pyblish_instance_toggled(instance, old_value, new_value): log.info("instance toggle: {}, old_value: {}, new_value:{} ".format( instance, old_value, new_value)) - from pype.hosts.hiero.api import ( + from openpype.hosts.hiero.api import ( get_track_item_pype_tag, set_publish_attribute ) diff --git a/pype/hosts/hiero/api/style.css b/openpype/hosts/hiero/api/style.css similarity index 100% rename from pype/hosts/hiero/api/style.css rename to openpype/hosts/hiero/api/style.css diff --git a/pype/hosts/hiero/api/tags.py b/openpype/hosts/hiero/api/tags.py similarity index 99% rename from pype/hosts/hiero/api/tags.py rename to openpype/hosts/hiero/api/tags.py index 63c60a3039..06fa655a2e 100644 --- a/pype/hosts/hiero/api/tags.py +++ b/openpype/hosts/hiero/api/tags.py @@ -2,7 +2,7 @@ import re import os import hiero -from pype.api import Logger +from openpype.api import Logger from avalon import io log = Logger().get_logger(__name__) diff --git a/pype/hosts/hiero/api/workio.py b/openpype/hosts/hiero/api/workio.py similarity index 98% rename from pype/hosts/hiero/api/workio.py rename to openpype/hosts/hiero/api/workio.py index c3505ef1bc..15ffbf84d8 100644 --- a/pype/hosts/hiero/api/workio.py +++ b/openpype/hosts/hiero/api/workio.py @@ -1,7 +1,7 @@ import os import hiero from avalon import api -from pype.api import Logger +from openpype.api import Logger log = Logger().get_logger(__name__) diff --git a/pype/hosts/hiero/plugins/_publish/collect_calculate_retime.py b/openpype/hosts/hiero/plugins/_publish/collect_calculate_retime.py similarity index 100% rename from pype/hosts/hiero/plugins/_publish/collect_calculate_retime.py rename to openpype/hosts/hiero/plugins/_publish/collect_calculate_retime.py diff --git a/pype/hosts/hiero/plugins/_publish/collect_framerate.py b/openpype/hosts/hiero/plugins/_publish/collect_framerate.py similarity index 100% rename from pype/hosts/hiero/plugins/_publish/collect_framerate.py rename to openpype/hosts/hiero/plugins/_publish/collect_framerate.py diff --git a/pype/hosts/hiero/plugins/_publish/collect_metadata.py b/openpype/hosts/hiero/plugins/_publish/collect_metadata.py similarity index 100% rename from pype/hosts/hiero/plugins/_publish/collect_metadata.py rename to openpype/hosts/hiero/plugins/_publish/collect_metadata.py diff --git a/pype/hosts/hiero/plugins/_publish/collect_tag_comments.py b/openpype/hosts/hiero/plugins/_publish/collect_tag_comments.py similarity index 100% rename from pype/hosts/hiero/plugins/_publish/collect_tag_comments.py rename to openpype/hosts/hiero/plugins/_publish/collect_tag_comments.py diff --git a/pype/hosts/hiero/plugins/_publish/collect_tag_retime.py b/openpype/hosts/hiero/plugins/_publish/collect_tag_retime.py similarity index 100% rename from pype/hosts/hiero/plugins/_publish/collect_tag_retime.py rename to openpype/hosts/hiero/plugins/_publish/collect_tag_retime.py diff --git a/pype/hosts/hiero/plugins/_publish/collect_timecodes.py b/openpype/hosts/hiero/plugins/_publish/collect_timecodes.py similarity index 100% rename from pype/hosts/hiero/plugins/_publish/collect_timecodes.py rename to openpype/hosts/hiero/plugins/_publish/collect_timecodes.py diff --git a/pype/hosts/hiero/plugins/create/create_shot_clip.py b/openpype/hosts/hiero/plugins/create/create_shot_clip.py similarity index 98% rename from pype/hosts/hiero/plugins/create/create_shot_clip.py rename to openpype/hosts/hiero/plugins/create/create_shot_clip.py index 268f84b127..07b7a62b2a 100644 --- a/pype/hosts/hiero/plugins/create/create_shot_clip.py +++ b/openpype/hosts/hiero/plugins/create/create_shot_clip.py @@ -1,5 +1,5 @@ -import pype.hosts.hiero.api as phiero -# from pype.hosts.hiero.api import plugin, lib +import openpype.hosts.hiero.api as phiero +# from openpype.hosts.hiero.api import plugin, lib # reload(lib) # reload(plugin) # reload(phiero) @@ -120,9 +120,9 @@ class CreateShotClip(phiero.Creator): "vSyncTrack": { "value": gui_tracks, # noqa "type": "QComboBox", - "label": "Hero track", + "label": "Master track", "target": "ui", - "toolTip": "Select driving track name which should be hero for all others", # noqa + "toolTip": "Select driving track name which should be mastering all others", # noqa "order": 1} } }, diff --git a/pype/hosts/hiero/plugins/load/load_clip.py b/openpype/hosts/hiero/plugins/load/load_clip.py similarity index 98% rename from pype/hosts/hiero/plugins/load/load_clip.py rename to openpype/hosts/hiero/plugins/load/load_clip.py index d9f6bbf3c8..4eadf28956 100644 --- a/pype/hosts/hiero/plugins/load/load_clip.py +++ b/openpype/hosts/hiero/plugins/load/load_clip.py @@ -1,6 +1,6 @@ from avalon import io, api -import pype.hosts.hiero.api as phiero -# from pype.hosts.hiero.api import plugin, lib +import openpype.hosts.hiero.api as phiero +# from openpype.hosts.hiero.api import plugin, lib # reload(lib) # reload(plugin) # reload(phiero) diff --git a/pype/hosts/hiero/plugins/publish/collect_assetbuilds.py b/openpype/hosts/hiero/plugins/publish/collect_assetbuilds.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_assetbuilds.py rename to openpype/hosts/hiero/plugins/publish/collect_assetbuilds.py diff --git a/pype/hosts/hiero/plugins/publish/collect_clip_resolution.py b/openpype/hosts/hiero/plugins/publish/collect_clip_resolution.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_clip_resolution.py rename to openpype/hosts/hiero/plugins/publish/collect_clip_resolution.py diff --git a/pype/hosts/hiero/plugins/publish/collect_frame_ranges.py b/openpype/hosts/hiero/plugins/publish/collect_frame_ranges.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_frame_ranges.py rename to openpype/hosts/hiero/plugins/publish/collect_frame_ranges.py diff --git a/pype/hosts/hiero/plugins/publish/collect_hierarchy_context.py b/openpype/hosts/hiero/plugins/publish/collect_hierarchy_context.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_hierarchy_context.py rename to openpype/hosts/hiero/plugins/publish/collect_hierarchy_context.py diff --git a/pype/hosts/hiero/plugins/publish/collect_host_version.py b/openpype/hosts/hiero/plugins/publish/collect_host_version.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_host_version.py rename to openpype/hosts/hiero/plugins/publish/collect_host_version.py diff --git a/pype/hosts/hiero/plugins/publish/collect_plates.py b/openpype/hosts/hiero/plugins/publish/collect_plates.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_plates.py rename to openpype/hosts/hiero/plugins/publish/collect_plates.py diff --git a/openpype/hosts/hiero/plugins/publish/collect_review.py b/openpype/hosts/hiero/plugins/publish/collect_review.py new file mode 100644 index 0000000000..a0ab00b355 --- /dev/null +++ b/openpype/hosts/hiero/plugins/publish/collect_review.py @@ -0,0 +1,261 @@ +from pyblish import api +import os +import clique +from openpype.hosts.hiero.api import ( + is_overlapping, get_sequence_pattern_and_padding) + + +class CollectReview(api.InstancePlugin): + """Collect review representation. + """ + + # Run just before CollectSubsets + order = api.CollectorOrder + 0.1022 + label = "Collect Review" + hosts = ["hiero"] + families = ["review"] + + def get_review_item(self, instance): + """ + Get review clip track item from review track name + + Args: + instance (obj): publishing instance + + Returns: + hiero.core.TrackItem: corresponding track item + + Raises: + Exception: description + + """ + review_track = instance.data.get("review") + video_tracks = instance.context.data["videoTracks"] + for track in video_tracks: + if review_track not in track.name(): + continue + for item in track.items(): + self.log.debug(item) + if is_overlapping(item, self.main_clip): + self.log.debug("Winner is: {}".format(item)) + break + + # validate the clip is fully converted with review clip + assert is_overlapping( + item, self.main_clip, strict=True), ( + "Review clip not cowering fully " + "the clip `{}`").format(self.main_clip.name()) + + return item + + def process(self, instance): + tags = ["review", "ftrackreview"] + + # get reviewable item from `review` instance.data attribute + self.main_clip = instance.data.get("item") + self.rw_clip = self.get_review_item(instance) + + # let user know there is missing review clip and convert instance + # back as not reviewable + assert self.rw_clip, "Missing reviewable clip for '{}'".format( + self.main_clip.name() + ) + + # add to representations + if not instance.data.get("representations"): + instance.data["representations"] = list() + + # get review media main info + rw_source = self.rw_clip.source().mediaSource() + rw_source_duration = int(rw_source.duration()) + self.rw_source_path = rw_source.firstpath() + rw_source_file_info = rw_source.fileinfos().pop() + + # define if review media is sequence + is_sequence = bool(not rw_source.singleFile()) + self.log.debug("is_sequence: {}".format(is_sequence)) + + # get handles + handle_start = instance.data["handleStart"] + handle_end = instance.data["handleEnd"] + + # review timeline and source frame ranges + rw_clip_in = int(self.rw_clip.timelineIn()) + rw_clip_out = int(self.rw_clip.timelineOut()) + self.rw_clip_source_in = int(self.rw_clip.sourceIn()) + self.rw_clip_source_out = int(self.rw_clip.sourceOut()) + rw_source_first = int(rw_source_file_info.startFrame()) + + # calculate delivery source_in and source_out + # main_clip_timeline_in - review_item_timeline_in + 1 + main_clip_in = self.main_clip.timelineIn() + main_clip_out = self.main_clip.timelineOut() + + source_in_diff = main_clip_in - rw_clip_in + source_out_diff = main_clip_out - rw_clip_out + + if source_in_diff: + self.rw_clip_source_in += source_in_diff + if source_out_diff: + self.rw_clip_source_out += source_out_diff + + # review clip durations + rw_clip_duration = ( + self.rw_clip_source_out - self.rw_clip_source_in) + 1 + rw_clip_duration_h = rw_clip_duration + ( + handle_start + handle_end) + + # add created data to review item data + instance.data["reviewItemData"] = { + "mediaDuration": rw_source_duration + } + + file_dir = os.path.dirname(self.rw_source_path) + file = os.path.basename(self.rw_source_path) + ext = os.path.splitext(file)[-1] + + # detect if sequence + if not is_sequence: + # is video file + files = file + else: + files = list() + spliter, padding = get_sequence_pattern_and_padding(file) + self.log.debug("_ spliter, padding: {}, {}".format( + spliter, padding)) + base_name = file.split(spliter)[0] + + # define collection and calculate frame range + collection = clique.Collection(base_name, ext, padding, set(range( + int(rw_source_first + int( + self.rw_clip_source_in - handle_start)), + int(rw_source_first + int( + self.rw_clip_source_out + handle_end) + 1)))) + self.log.debug("_ collection: {}".format(collection)) + + real_files = os.listdir(file_dir) + self.log.debug("_ real_files: {}".format(real_files)) + + # collect frames to repre files list + for item in collection: + if item not in real_files: + self.log.debug("_ item: {}".format(item)) + continue + files.append(item) + + # add prep tag + tags.extend(["prep", "delete"]) + + # change label + instance.data["label"] = "{0} - ({1})".format( + instance.data["label"], ext + ) + + self.log.debug("Instance review: {}".format(instance.data["name"])) + + # adding representation for review mov + representation = { + "files": files, + "stagingDir": file_dir, + "frameStart": rw_source_first + self.rw_clip_source_in, + "frameEnd": rw_source_first + self.rw_clip_source_out, + "frameStartFtrack": int( + self.rw_clip_source_in - handle_start), + "frameEndFtrack": int(self.rw_clip_source_out + handle_end), + "step": 1, + "fps": instance.data["fps"], + "name": "review", + "tags": tags, + "ext": ext[1:] + } + + if rw_source_duration > rw_clip_duration_h: + self.log.debug("Media duration higher: {}".format( + (rw_source_duration - rw_clip_duration_h))) + representation.update({ + "frameStart": rw_source_first + int( + self.rw_clip_source_in - handle_start), + "frameEnd": rw_source_first + int( + self.rw_clip_source_out + handle_end), + "tags": ["_cut-bigger", "prep", "delete"] + }) + elif rw_source_duration < rw_clip_duration_h: + self.log.debug("Media duration higher: {}".format( + (rw_source_duration - rw_clip_duration_h))) + representation.update({ + "frameStart": rw_source_first + int( + self.rw_clip_source_in - handle_start), + "frameEnd": rw_source_first + int( + self.rw_clip_source_out + handle_end), + "tags": ["prep", "delete"] + }) + + instance.data["representations"].append(representation) + + self.create_thumbnail(instance) + + self.log.debug( + "Added representations: {}".format( + instance.data["representations"])) + + def create_thumbnail(self, instance): + source_file = os.path.basename(self.rw_source_path) + spliter, padding = get_sequence_pattern_and_padding(source_file) + + if spliter: + head, ext = source_file.split(spliter) + else: + head, ext = os.path.splitext(source_file) + + # staging dir creation + staging_dir = os.path.dirname( + self.rw_source_path) + + # get thumbnail frame from the middle + thumb_frame = int(self.rw_clip_source_in + ( + (self.rw_clip_source_out - self.rw_clip_source_in) / 2)) + + thumb_file = "{}thumbnail{}{}".format(head, thumb_frame, ".png") + thumb_path = os.path.join(staging_dir, thumb_file) + + thumbnail = self.rw_clip.thumbnail(thumb_frame).save( + thumb_path, + format='png' + ) + self.log.debug( + "__ thumbnail: `{}`, frame: `{}`".format(thumbnail, thumb_frame)) + + self.log.debug("__ thumbnail: {}".format(thumbnail)) + thumb_representation = { + 'files': thumb_file, + 'stagingDir': staging_dir, + 'name': "thumbnail", + 'thumbnail': True, + 'ext': "png" + } + instance.data["representations"].append( + thumb_representation) + + def version_data(self, instance): + transfer_data = [ + "handleStart", "handleEnd", "sourceIn", "sourceOut", + "frameStart", "frameEnd", "sourceInH", "sourceOutH", + "clipIn", "clipOut", "clipInH", "clipOutH", "asset", + "track" + ] + + version_data = dict() + # pass data to version + version_data.update({k: instance.data[k] for k in transfer_data}) + + if 'version' in instance.data: + version_data["version"] = instance.data["version"] + + # add to data of representation + version_data.update({ + "colorspace": self.rw_clip.sourceMediaColourTransform(), + "families": instance.data["families"], + "subset": instance.data["subset"], + "fps": instance.data["fps"] + }) + instance.data["versionData"] = version_data diff --git a/pype/hosts/hiero/plugins/publish/collect_tag_tasks.py b/openpype/hosts/hiero/plugins/publish/collect_tag_tasks.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/collect_tag_tasks.py rename to openpype/hosts/hiero/plugins/publish/collect_tag_tasks.py diff --git a/pype/hosts/hiero/plugins/publish/extract_audio.py b/openpype/hosts/hiero/plugins/publish/extract_audio.py similarity index 96% rename from pype/hosts/hiero/plugins/publish/extract_audio.py rename to openpype/hosts/hiero/plugins/publish/extract_audio.py index 690e9c5b1e..6d9abb58e2 100644 --- a/pype/hosts/hiero/plugins/publish/extract_audio.py +++ b/openpype/hosts/hiero/plugins/publish/extract_audio.py @@ -1,10 +1,10 @@ import os from hiero.exporters.FnExportUtil import writeSequenceAudioWithHandles import pyblish -import pype +import openpype -class ExtractAudioFile(pype.api.Extractor): +class ExtractAudioFile(openpype.api.Extractor): """Extracts audio subset file from all active timeline audio tracks""" order = pyblish.api.ExtractorOrder diff --git a/pype/hosts/hiero/plugins/publish/extract_clip_effects.py b/openpype/hosts/hiero/plugins/publish/extract_clip_effects.py similarity index 96% rename from pype/hosts/hiero/plugins/publish/extract_clip_effects.py rename to openpype/hosts/hiero/plugins/publish/extract_clip_effects.py index 308b33ff3a..d2ac7f4786 100644 --- a/pype/hosts/hiero/plugins/publish/extract_clip_effects.py +++ b/openpype/hosts/hiero/plugins/publish/extract_clip_effects.py @@ -1,11 +1,11 @@ -# from pype import plugins +# from openpype import plugins import os import json import pyblish.api -import pype +import openpype -class ExtractClipEffects(pype.api.Extractor): +class ExtractClipEffects(openpype.api.Extractor): """Extract clip effects instances.""" order = pyblish.api.ExtractorOrder diff --git a/openpype/hosts/hiero/plugins/publish/extract_review_preparation.py b/openpype/hosts/hiero/plugins/publish/extract_review_preparation.py new file mode 100644 index 0000000000..5456ddc3c4 --- /dev/null +++ b/openpype/hosts/hiero/plugins/publish/extract_review_preparation.py @@ -0,0 +1,334 @@ +import os +import sys +import six +import errno +from pyblish import api +import openpype +import clique +from avalon.vendor import filelink + + +class ExtractReviewPreparation(openpype.api.Extractor): + """Cut up clips from long video file""" + + order = api.ExtractorOrder + label = "Extract Review Preparation" + hosts = ["hiero"] + families = ["review"] + + # presets + tags_addition = [] + + def process(self, instance): + inst_data = instance.data + asset = inst_data["asset"] + review_item_data = instance.data.get("reviewItemData") + + # get representation and loop them + representations = inst_data["representations"] + + # get resolution default + resolution_width = inst_data["resolutionWidth"] + resolution_height = inst_data["resolutionHeight"] + + # frame range data + media_duration = review_item_data["mediaDuration"] + + ffmpeg_path = openpype.lib.get_ffmpeg_tool_path("ffmpeg") + ffprobe_path = openpype.lib.get_ffmpeg_tool_path("ffprobe") + + # filter out mov and img sequences + representations_new = representations[:] + for repre in representations: + input_args = list() + output_args = list() + + tags = repre.get("tags", []) + + # check if supported tags are in representation for activation + filter_tag = False + for tag in ["_cut-bigger", "prep"]: + if tag in tags: + filter_tag = True + break + if not filter_tag: + continue + + self.log.debug("__ repre: {}".format(repre)) + + files = repre.get("files") + staging_dir = repre.get("stagingDir") + fps = repre.get("fps") + ext = repre.get("ext") + + # make paths + full_output_dir = os.path.join( + staging_dir, "cuts") + + if isinstance(files, list): + new_files = list() + + # frame range delivery included handles + frame_start = ( + inst_data["frameStart"] - inst_data["handleStart"]) + frame_end = ( + inst_data["frameEnd"] + inst_data["handleEnd"]) + self.log.debug("_ frame_start: {}".format(frame_start)) + self.log.debug("_ frame_end: {}".format(frame_end)) + + # make collection from input files list + collections, remainder = clique.assemble(files) + collection = collections.pop() + self.log.debug("_ collection: {}".format(collection)) + + # name components + head = collection.format("{head}") + padding = collection.format("{padding}") + tail = collection.format("{tail}") + self.log.debug("_ head: {}".format(head)) + self.log.debug("_ padding: {}".format(padding)) + self.log.debug("_ tail: {}".format(tail)) + + # make destination file with instance data + # frame start and end range + index = 0 + for image in collection: + dst_file_num = frame_start + index + dst_file_name = head + str(padding % dst_file_num) + tail + src = os.path.join(staging_dir, image) + dst = os.path.join(full_output_dir, dst_file_name) + self.log.info("Creating temp hardlinks: {}".format(dst)) + self.hardlink_file(src, dst) + new_files.append(dst_file_name) + index += 1 + + self.log.debug("_ new_files: {}".format(new_files)) + + else: + # ffmpeg when single file + new_files = "{}_{}".format(asset, files) + + # frame range + frame_start = repre.get("frameStart") + frame_end = repre.get("frameEnd") + + full_input_path = os.path.join( + staging_dir, files) + + os.path.isdir(full_output_dir) or os.makedirs(full_output_dir) + + full_output_path = os.path.join( + full_output_dir, new_files) + + self.log.debug( + "__ full_input_path: {}".format(full_input_path)) + self.log.debug( + "__ full_output_path: {}".format(full_output_path)) + + # check if audio stream is in input video file + ffprob_cmd = ( + "\"{ffprobe_path}\" -i \"{full_input_path}\" -show_streams" + " -select_streams a -loglevel error" + ).format(**locals()) + + self.log.debug("ffprob_cmd: {}".format(ffprob_cmd)) + audio_check_output = openpype.api.subprocess(ffprob_cmd) + self.log.debug( + "audio_check_output: {}".format(audio_check_output)) + + # Fix one frame difference + """ TODO: this is just work-around for issue: + https://github.com/pypeclub/pype/issues/659 + """ + frame_duration_extend = 1 + if audio_check_output and ("audio" in inst_data["families"]): + frame_duration_extend = 0 + + # translate frame to sec + start_sec = float(frame_start) / fps + duration_sec = float( + (frame_end - frame_start) + frame_duration_extend) / fps + + empty_add = None + + # check if not missing frames at start + if (start_sec < 0) or (media_duration < frame_end): + # for later swithing off `-c:v copy` output arg + empty_add = True + + # init empty variables + video_empty_start = video_layer_start = "" + audio_empty_start = audio_layer_start = "" + video_empty_end = video_layer_end = "" + audio_empty_end = audio_layer_end = "" + audio_input = audio_output = "" + v_inp_idx = 0 + concat_n = 1 + + # try to get video native resolution data + try: + resolution_output = openpype.api.subprocess(( + "\"{ffprobe_path}\" -i \"{full_input_path}\"" + " -v error " + "-select_streams v:0 -show_entries " + "stream=width,height -of csv=s=x:p=0" + ).format(**locals())) + + x, y = resolution_output.split("x") + resolution_width = int(x) + resolution_height = int(y) + except Exception as _ex: + self.log.warning( + "Video native resolution is untracable: {}".format( + _ex)) + + if audio_check_output: + # adding input for empty audio + input_args.append("-f lavfi -i anullsrc") + + # define audio empty concat variables + audio_input = "[1:a]" + audio_output = ":a=1" + v_inp_idx = 1 + + # adding input for video black frame + input_args.append(( + "-f lavfi -i \"color=c=black:" + "s={resolution_width}x{resolution_height}:r={fps}\"" + ).format(**locals())) + + if (start_sec < 0): + # recalculate input video timing + empty_start_dur = abs(start_sec) + start_sec = 0 + duration_sec = float(frame_end - ( + frame_start + (empty_start_dur * fps)) + 1) / fps + + # define starting empty video concat variables + video_empty_start = ( + "[{v_inp_idx}]trim=duration={empty_start_dur}[gv0];" # noqa + ).format(**locals()) + video_layer_start = "[gv0]" + + if audio_check_output: + # define starting empty audio concat variables + audio_empty_start = ( + "[0]atrim=duration={empty_start_dur}[ga0];" + ).format(**locals()) + audio_layer_start = "[ga0]" + + # alter concat number of clips + concat_n += 1 + + # check if not missing frames at the end + if (media_duration < frame_end): + # recalculate timing + empty_end_dur = float( + frame_end - media_duration + 1) / fps + duration_sec = float( + media_duration - frame_start) / fps + + # define ending empty video concat variables + video_empty_end = ( + "[{v_inp_idx}]trim=duration={empty_end_dur}[gv1];" + ).format(**locals()) + video_layer_end = "[gv1]" + + if audio_check_output: + # define ending empty audio concat variables + audio_empty_end = ( + "[0]atrim=duration={empty_end_dur}[ga1];" + ).format(**locals()) + audio_layer_end = "[ga0]" + + # alter concat number of clips + concat_n += 1 + + # concatting black frame togather + output_args.append(( + "-filter_complex \"" + "{audio_empty_start}" + "{video_empty_start}" + "{audio_empty_end}" + "{video_empty_end}" + "{video_layer_start}{audio_layer_start}[1:v]{audio_input}" # noqa + "{video_layer_end}{audio_layer_end}" + "concat=n={concat_n}:v=1{audio_output}\"" + ).format(**locals())) + + # append ffmpeg input video clip + input_args.append("-ss {}".format(start_sec)) + input_args.append("-t {}".format(duration_sec)) + input_args.append("-i \"{}\"".format(full_input_path)) + + # add copy audio video codec if only shortening clip + if ("_cut-bigger" in tags) and (not empty_add): + output_args.append("-c:v copy") + + # make sure it is having no frame to frame comprassion + output_args.append("-intra") + + # output filename + output_args.append("-y \"{}\"".format(full_output_path)) + + mov_args = [ + "\"{}\"".format(ffmpeg_path), + " ".join(input_args), + " ".join(output_args) + ] + subprcs_cmd = " ".join(mov_args) + + # run subprocess + self.log.debug("Executing: {}".format(subprcs_cmd)) + output = openpype.api.subprocess(subprcs_cmd) + self.log.debug("Output: {}".format(output)) + + repre_new = { + "files": new_files, + "stagingDir": full_output_dir, + "frameStart": frame_start, + "frameEnd": frame_end, + "frameStartFtrack": frame_start, + "frameEndFtrack": frame_end, + "step": 1, + "fps": fps, + "name": "cut_up_preview", + "tags": [ + "review", "ftrackreview", "delete"] + self.tags_addition, + "ext": ext, + "anatomy_template": "publish" + } + + representations_new.append(repre_new) + + for repre in representations_new: + if ("delete" in repre.get("tags", [])) and ( + "cut_up_preview" not in repre["name"]): + representations_new.remove(repre) + + self.log.debug( + "Representations: {}".format(representations_new)) + instance.data["representations"] = representations_new + + def hardlink_file(self, src, dst): + dirname = os.path.dirname(dst) + + # make sure the destination folder exist + try: + os.makedirs(dirname) + except OSError as e: + if e.errno == errno.EEXIST: + pass + else: + self.log.critical("An unexpected error occurred.") + six.reraise(*sys.exc_info()) + + # create hardlined file + try: + filelink.create(src, dst, filelink.HARDLINK) + except OSError as e: + if e.errno == errno.EEXIST: + pass + else: + self.log.critical("An unexpected error occurred.") + six.reraise(*sys.exc_info()) diff --git a/pype/hosts/hiero/plugins/publish/precollect_clip_effects.py b/openpype/hosts/hiero/plugins/publish/precollect_clip_effects.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/precollect_clip_effects.py rename to openpype/hosts/hiero/plugins/publish/precollect_clip_effects.py diff --git a/openpype/hosts/hiero/plugins/publish/precollect_instances.py b/openpype/hosts/hiero/plugins/publish/precollect_instances.py new file mode 100644 index 0000000000..bdf007de06 --- /dev/null +++ b/openpype/hosts/hiero/plugins/publish/precollect_instances.py @@ -0,0 +1,221 @@ +from compiler.ast import flatten +from pyblish import api +from openpype.hosts.hiero import api as phiero +import hiero +# from openpype.hosts.hiero.api import lib +# reload(lib) +# reload(phiero) + + +class PreCollectInstances(api.ContextPlugin): + """Collect all Track items selection.""" + + order = api.CollectorOrder - 0.509 + label = "Pre-collect Instances" + hosts = ["hiero"] + + def process(self, context): + track_items = phiero.get_track_items( + selected=True, check_tagged=True, check_enabled=True) + # only return enabled track items + if not track_items: + track_items = phiero.get_track_items( + check_enabled=True, check_tagged=True) + # get sequence and video tracks + sequence = context.data["activeSequence"] + tracks = sequence.videoTracks() + + # add collection to context + tracks_effect_items = self.collect_sub_track_items(tracks) + + context.data["tracksEffectItems"] = tracks_effect_items + + self.log.info( + "Processing enabled track items: {}".format(len(track_items))) + + for _ti in track_items: + data = dict() + clip = _ti.source() + + # get clips subtracks and anotations + annotations = self.clip_annotations(clip) + subtracks = self.clip_subtrack(_ti) + self.log.debug("Annotations: {}".format(annotations)) + self.log.debug(">> Subtracks: {}".format(subtracks)) + + # get pype tag data + tag_parsed_data = phiero.get_track_item_pype_data(_ti) + # self.log.debug(pformat(tag_parsed_data)) + + if not tag_parsed_data: + continue + + if tag_parsed_data.get("id") != "pyblish.avalon.instance": + continue + # add tag data to instance data + data.update({ + k: v for k, v in tag_parsed_data.items() + if k not in ("id", "applieswhole", "label") + }) + + asset = tag_parsed_data["asset"] + subset = tag_parsed_data["subset"] + review = tag_parsed_data.get("review") + audio = tag_parsed_data.get("audio") + + # remove audio attribute from data + data.pop("audio") + + # insert family into families + family = tag_parsed_data["family"] + families = [str(f) for f in tag_parsed_data["families"]] + families.insert(0, str(family)) + + track = _ti.parent() + media_source = _ti.source().mediaSource() + source_path = media_source.firstpath() + file_head = media_source.filenameHead() + file_info = media_source.fileinfos().pop() + source_first_frame = int(file_info.startFrame()) + + # apply only for feview and master track instance + if review: + families += ["review", "ftrack"] + + data.update({ + "name": "{} {} {}".format(asset, subset, families), + "asset": asset, + "item": _ti, + "families": families, + + # tags + "tags": _ti.tags(), + + # track item attributes + "track": track.name(), + "trackItem": track, + + # version data + "versionData": { + "colorspace": _ti.sourceMediaColourTransform() + }, + + # source attribute + "source": source_path, + "sourceMedia": media_source, + "sourcePath": source_path, + "sourceFileHead": file_head, + "sourceFirst": source_first_frame, + + # clip's effect + "clipEffectItems": subtracks + }) + + instance = context.create_instance(**data) + + self.log.info("Creating instance: {}".format(instance)) + + if audio: + a_data = dict() + + # add tag data to instance data + a_data.update({ + k: v for k, v in tag_parsed_data.items() + if k not in ("id", "applieswhole", "label") + }) + + # create main attributes + subset = "audioMain" + family = "audio" + families = ["clip", "ftrack"] + families.insert(0, str(family)) + + name = "{} {} {}".format(asset, subset, families) + + a_data.update({ + "name": name, + "subset": subset, + "asset": asset, + "family": family, + "families": families, + "item": _ti, + + # tags + "tags": _ti.tags(), + }) + + a_instance = context.create_instance(**a_data) + self.log.info("Creating audio instance: {}".format(a_instance)) + + @staticmethod + def clip_annotations(clip): + """ + Returns list of Clip's hiero.core.Annotation + """ + annotations = [] + subTrackItems = flatten(clip.subTrackItems()) + annotations += [item for item in subTrackItems if isinstance( + item, hiero.core.Annotation)] + return annotations + + @staticmethod + def clip_subtrack(clip): + """ + Returns list of Clip's hiero.core.SubTrackItem + """ + subtracks = [] + subTrackItems = flatten(clip.parent().subTrackItems()) + for item in subTrackItems: + # avoid all anotation + if isinstance(item, hiero.core.Annotation): + continue + # # avoid all not anaibled + if not item.isEnabled(): + continue + subtracks.append(item) + return subtracks + + @staticmethod + def collect_sub_track_items(tracks): + """ + Returns dictionary with track index as key and list of subtracks + """ + # collect all subtrack items + sub_track_items = dict() + for track in tracks: + items = track.items() + + # skip if no clips on track > need track with effect only + if items: + continue + + # skip all disabled tracks + if not track.isEnabled(): + continue + + track_index = track.trackIndex() + _sub_track_items = flatten(track.subTrackItems()) + + # continue only if any subtrack items are collected + if len(_sub_track_items) < 1: + continue + + enabled_sti = list() + # loop all found subtrack items and check if they are enabled + for _sti in _sub_track_items: + # checking if not enabled + if not _sti.isEnabled(): + continue + if isinstance(_sti, hiero.core.Annotation): + continue + # collect the subtrack item + enabled_sti.append(_sti) + + # continue only if any subtrack items are collected + if len(enabled_sti) < 1: + continue + + # add collection of subtrackitems to dict + sub_track_items[track_index] = enabled_sti + + return sub_track_items diff --git a/pype/hosts/hiero/plugins/publish/precollect_workfile.py b/openpype/hosts/hiero/plugins/publish/precollect_workfile.py similarity index 98% rename from pype/hosts/hiero/plugins/publish/precollect_workfile.py rename to openpype/hosts/hiero/plugins/publish/precollect_workfile.py index 1b22371943..ef7d07421b 100644 --- a/pype/hosts/hiero/plugins/publish/precollect_workfile.py +++ b/openpype/hosts/hiero/plugins/publish/precollect_workfile.py @@ -1,6 +1,6 @@ import os import pyblish.api -from pype.hosts.hiero import api as phiero +from openpype.hosts.hiero import api as phiero from avalon import api as avalon diff --git a/pype/hosts/hiero/plugins/publish/validate_audio.py b/openpype/hosts/hiero/plugins/publish/validate_audio.py similarity index 92% rename from pype/hosts/hiero/plugins/publish/validate_audio.py rename to openpype/hosts/hiero/plugins/publish/validate_audio.py index 5decc86304..0b2a94dc68 100644 --- a/pype/hosts/hiero/plugins/publish/validate_audio.py +++ b/openpype/hosts/hiero/plugins/publish/validate_audio.py @@ -1,5 +1,5 @@ import pyblish -from pype.hosts.hiero.api import is_overlapping +from openpype.hosts.hiero.api import is_overlapping class ValidateAudioFile(pyblish.api.InstancePlugin): diff --git a/pype/hosts/hiero/plugins/publish/validate_hierarchy.py b/openpype/hosts/hiero/plugins/publish/validate_hierarchy.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/validate_hierarchy.py rename to openpype/hosts/hiero/plugins/publish/validate_hierarchy.py diff --git a/pype/hosts/hiero/plugins/publish/validate_names.py b/openpype/hosts/hiero/plugins/publish/validate_names.py similarity index 100% rename from pype/hosts/hiero/plugins/publish/validate_names.py rename to openpype/hosts/hiero/plugins/publish/validate_names.py diff --git a/pype/hosts/hiero/plugins/publish/version_up_workfile.py b/openpype/hosts/hiero/plugins/publish/version_up_workfile.py similarity index 94% rename from pype/hosts/hiero/plugins/publish/version_up_workfile.py rename to openpype/hosts/hiero/plugins/publish/version_up_workfile.py index 893d3789eb..ae03513d78 100644 --- a/pype/hosts/hiero/plugins/publish/version_up_workfile.py +++ b/openpype/hosts/hiero/plugins/publish/version_up_workfile.py @@ -1,5 +1,5 @@ from pyblish import api -import pype.api as pype +import openpype.api as pype class VersionUpWorkfile(api.ContextPlugin): diff --git a/pype/hosts/hiero/startup/HieroPlayer/PlayerPresets.hrox b/openpype/hosts/hiero/startup/HieroPlayer/PlayerPresets.hrox similarity index 100% rename from pype/hosts/hiero/startup/HieroPlayer/PlayerPresets.hrox rename to openpype/hosts/hiero/startup/HieroPlayer/PlayerPresets.hrox diff --git a/pype/hosts/hiero/startup/Icons/1_add_handles_end.png b/openpype/hosts/hiero/startup/Icons/1_add_handles_end.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/1_add_handles_end.png rename to openpype/hosts/hiero/startup/Icons/1_add_handles_end.png diff --git a/pype/hosts/hiero/startup/Icons/2_add_handles.png b/openpype/hosts/hiero/startup/Icons/2_add_handles.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/2_add_handles.png rename to openpype/hosts/hiero/startup/Icons/2_add_handles.png diff --git a/pype/hosts/hiero/startup/Icons/3D.png b/openpype/hosts/hiero/startup/Icons/3D.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/3D.png rename to openpype/hosts/hiero/startup/Icons/3D.png diff --git a/pype/hosts/hiero/startup/Icons/3_add_handles_start.png b/openpype/hosts/hiero/startup/Icons/3_add_handles_start.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/3_add_handles_start.png rename to openpype/hosts/hiero/startup/Icons/3_add_handles_start.png diff --git a/pype/hosts/hiero/startup/Icons/4_2D.png b/openpype/hosts/hiero/startup/Icons/4_2D.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/4_2D.png rename to openpype/hosts/hiero/startup/Icons/4_2D.png diff --git a/pype/hosts/hiero/startup/Icons/edit.png b/openpype/hosts/hiero/startup/Icons/edit.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/edit.png rename to openpype/hosts/hiero/startup/Icons/edit.png diff --git a/pype/hosts/hiero/startup/Icons/fusion.png b/openpype/hosts/hiero/startup/Icons/fusion.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/fusion.png rename to openpype/hosts/hiero/startup/Icons/fusion.png diff --git a/pype/hosts/hiero/startup/Icons/hierarchy.png b/openpype/hosts/hiero/startup/Icons/hierarchy.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/hierarchy.png rename to openpype/hosts/hiero/startup/Icons/hierarchy.png diff --git a/pype/hosts/hiero/startup/Icons/houdini.png b/openpype/hosts/hiero/startup/Icons/houdini.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/houdini.png rename to openpype/hosts/hiero/startup/Icons/houdini.png diff --git a/pype/hosts/hiero/startup/Icons/layers.psd b/openpype/hosts/hiero/startup/Icons/layers.psd similarity index 100% rename from pype/hosts/hiero/startup/Icons/layers.psd rename to openpype/hosts/hiero/startup/Icons/layers.psd diff --git a/pype/hosts/hiero/startup/Icons/lense.png b/openpype/hosts/hiero/startup/Icons/lense.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/lense.png rename to openpype/hosts/hiero/startup/Icons/lense.png diff --git a/pype/hosts/hiero/startup/Icons/lense1.png b/openpype/hosts/hiero/startup/Icons/lense1.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/lense1.png rename to openpype/hosts/hiero/startup/Icons/lense1.png diff --git a/pype/hosts/hiero/startup/Icons/maya.png b/openpype/hosts/hiero/startup/Icons/maya.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/maya.png rename to openpype/hosts/hiero/startup/Icons/maya.png diff --git a/pype/hosts/hiero/startup/Icons/nuke.png b/openpype/hosts/hiero/startup/Icons/nuke.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/nuke.png rename to openpype/hosts/hiero/startup/Icons/nuke.png diff --git a/pype/hosts/hiero/startup/Icons/pype_icon.png b/openpype/hosts/hiero/startup/Icons/pype_icon.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/pype_icon.png rename to openpype/hosts/hiero/startup/Icons/pype_icon.png diff --git a/pype/hosts/hiero/startup/Icons/resolution.png b/openpype/hosts/hiero/startup/Icons/resolution.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/resolution.png rename to openpype/hosts/hiero/startup/Icons/resolution.png diff --git a/pype/hosts/hiero/startup/Icons/resolution.psd b/openpype/hosts/hiero/startup/Icons/resolution.psd similarity index 100% rename from pype/hosts/hiero/startup/Icons/resolution.psd rename to openpype/hosts/hiero/startup/Icons/resolution.psd diff --git a/pype/hosts/hiero/startup/Icons/retiming.png b/openpype/hosts/hiero/startup/Icons/retiming.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/retiming.png rename to openpype/hosts/hiero/startup/Icons/retiming.png diff --git a/pype/hosts/hiero/startup/Icons/retiming.psd b/openpype/hosts/hiero/startup/Icons/retiming.psd similarity index 100% rename from pype/hosts/hiero/startup/Icons/retiming.psd rename to openpype/hosts/hiero/startup/Icons/retiming.psd diff --git a/pype/hosts/hiero/startup/Icons/review.png b/openpype/hosts/hiero/startup/Icons/review.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/review.png rename to openpype/hosts/hiero/startup/Icons/review.png diff --git a/pype/hosts/hiero/startup/Icons/review.psd b/openpype/hosts/hiero/startup/Icons/review.psd similarity index 100% rename from pype/hosts/hiero/startup/Icons/review.psd rename to openpype/hosts/hiero/startup/Icons/review.psd diff --git a/pype/hosts/hiero/startup/Icons/volume.png b/openpype/hosts/hiero/startup/Icons/volume.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/volume.png rename to openpype/hosts/hiero/startup/Icons/volume.png diff --git a/pype/hosts/hiero/startup/Icons/z_layer_bg.png b/openpype/hosts/hiero/startup/Icons/z_layer_bg.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/z_layer_bg.png rename to openpype/hosts/hiero/startup/Icons/z_layer_bg.png diff --git a/pype/hosts/hiero/startup/Icons/z_layer_fg.png b/openpype/hosts/hiero/startup/Icons/z_layer_fg.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/z_layer_fg.png rename to openpype/hosts/hiero/startup/Icons/z_layer_fg.png diff --git a/pype/hosts/hiero/startup/Icons/z_layer_main.png b/openpype/hosts/hiero/startup/Icons/z_layer_main.png similarity index 100% rename from pype/hosts/hiero/startup/Icons/z_layer_main.png rename to openpype/hosts/hiero/startup/Icons/z_layer_main.png diff --git a/pype/hosts/hiero/startup/Python/Startup/SpreadsheetExport.py b/openpype/hosts/hiero/startup/Python/Startup/SpreadsheetExport.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/SpreadsheetExport.py rename to openpype/hosts/hiero/startup/Python/Startup/SpreadsheetExport.py diff --git a/pype/hosts/hiero/startup/Python/Startup/Startup.py b/openpype/hosts/hiero/startup/Python/Startup/Startup.py similarity index 79% rename from pype/hosts/hiero/startup/Python/Startup/Startup.py rename to openpype/hosts/hiero/startup/Python/Startup/Startup.py index 94b2d53f9f..8de2dc2d11 100644 --- a/pype/hosts/hiero/startup/Python/Startup/Startup.py +++ b/openpype/hosts/hiero/startup/Python/Startup/Startup.py @@ -2,7 +2,7 @@ import traceback # activate hiero from pype import avalon.api -import pype.hosts.hiero.api as phiero +import openpype.hosts.hiero.api as phiero avalon.api.install(phiero) try: @@ -15,5 +15,5 @@ except ImportError as e: else: # Setup integration - import pype.hosts.hiero.api as phiero + import openpype.hosts.hiero.api as phiero phiero.lib.setup() diff --git a/pype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportTask.py b/openpype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportTask.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportTask.py rename to openpype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportTask.py diff --git a/pype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportUI.py b/openpype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportUI.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportUI.py rename to openpype/hosts/hiero/startup/Python/Startup/otioexporter/OTIOExportUI.py diff --git a/pype/hosts/hiero/startup/Python/Startup/otioexporter/__init__.py b/openpype/hosts/hiero/startup/Python/Startup/otioexporter/__init__.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/otioexporter/__init__.py rename to openpype/hosts/hiero/startup/Python/Startup/otioexporter/__init__.py diff --git a/pype/hosts/hiero/startup/Python/Startup/project_helpers.py b/openpype/hosts/hiero/startup/Python/Startup/project_helpers.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/project_helpers.py rename to openpype/hosts/hiero/startup/Python/Startup/project_helpers.py diff --git a/pype/hosts/hiero/startup/Python/Startup/selection_tracker.py b/openpype/hosts/hiero/startup/Python/Startup/selection_tracker.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/selection_tracker.py rename to openpype/hosts/hiero/startup/Python/Startup/selection_tracker.py diff --git a/pype/hosts/hiero/startup/Python/Startup/setFrameRate.py b/openpype/hosts/hiero/startup/Python/Startup/setFrameRate.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/setFrameRate.py rename to openpype/hosts/hiero/startup/Python/Startup/setFrameRate.py diff --git a/pype/hosts/hiero/startup/Python/Startup/version_everywhere.py b/openpype/hosts/hiero/startup/Python/Startup/version_everywhere.py similarity index 100% rename from pype/hosts/hiero/startup/Python/Startup/version_everywhere.py rename to openpype/hosts/hiero/startup/Python/Startup/version_everywhere.py diff --git a/pype/hosts/hiero/startup/Python/StartupUI/PimpMySpreadsheet.py b/openpype/hosts/hiero/startup/Python/StartupUI/PimpMySpreadsheet.py similarity index 100% rename from pype/hosts/hiero/startup/Python/StartupUI/PimpMySpreadsheet.py rename to openpype/hosts/hiero/startup/Python/StartupUI/PimpMySpreadsheet.py diff --git a/pype/hosts/hiero/startup/Python/StartupUI/Purge.py b/openpype/hosts/hiero/startup/Python/StartupUI/Purge.py similarity index 100% rename from pype/hosts/hiero/startup/Python/StartupUI/Purge.py rename to openpype/hosts/hiero/startup/Python/StartupUI/Purge.py diff --git a/pype/hosts/hiero/startup/Python/StartupUI/nukeStyleKeyboardShortcuts.py b/openpype/hosts/hiero/startup/Python/StartupUI/nukeStyleKeyboardShortcuts.py similarity index 100% rename from pype/hosts/hiero/startup/Python/StartupUI/nukeStyleKeyboardShortcuts.py rename to openpype/hosts/hiero/startup/Python/StartupUI/nukeStyleKeyboardShortcuts.py diff --git a/pype/hosts/hiero/startup/Python/StartupUI/otioimporter/OTIOImport.py b/openpype/hosts/hiero/startup/Python/StartupUI/otioimporter/OTIOImport.py similarity index 100% rename from pype/hosts/hiero/startup/Python/StartupUI/otioimporter/OTIOImport.py rename to openpype/hosts/hiero/startup/Python/StartupUI/otioimporter/OTIOImport.py diff --git a/pype/hosts/hiero/startup/Python/StartupUI/otioimporter/__init__.py b/openpype/hosts/hiero/startup/Python/StartupUI/otioimporter/__init__.py similarity index 100% rename from pype/hosts/hiero/startup/Python/StartupUI/otioimporter/__init__.py rename to openpype/hosts/hiero/startup/Python/StartupUI/otioimporter/__init__.py diff --git a/pype/hosts/hiero/startup/Python/StartupUI/setPosterFrame.py b/openpype/hosts/hiero/startup/Python/StartupUI/setPosterFrame.py similarity index 100% rename from pype/hosts/hiero/startup/Python/StartupUI/setPosterFrame.py rename to openpype/hosts/hiero/startup/Python/StartupUI/setPosterFrame.py diff --git a/pype/hosts/hiero/startup/TaskPresets/10.5/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml b/openpype/hosts/hiero/startup/TaskPresets/10.5/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml similarity index 100% rename from pype/hosts/hiero/startup/TaskPresets/10.5/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml rename to openpype/hosts/hiero/startup/TaskPresets/10.5/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml diff --git a/pype/hosts/hiero/startup/TaskPresets/11.1/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml b/openpype/hosts/hiero/startup/TaskPresets/11.1/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml similarity index 100% rename from pype/hosts/hiero/startup/TaskPresets/11.1/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml rename to openpype/hosts/hiero/startup/TaskPresets/11.1/Processors/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml diff --git a/pype/hosts/hiero/startup/TaskPresets/11.2/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml b/openpype/hosts/hiero/startup/TaskPresets/11.2/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml similarity index 100% rename from pype/hosts/hiero/startup/TaskPresets/11.2/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml rename to openpype/hosts/hiero/startup/TaskPresets/11.2/hiero.exporters.FnShotProcessor.ShotProcessor/pipeline.xml diff --git a/pype/hosts/houdini/__init__.py b/openpype/hosts/houdini/__init__.py similarity index 100% rename from pype/hosts/houdini/__init__.py rename to openpype/hosts/houdini/__init__.py diff --git a/pype/hosts/houdini/api/__init__.py b/openpype/hosts/houdini/api/__init__.py similarity index 91% rename from pype/hosts/houdini/api/__init__.py rename to openpype/hosts/houdini/api/__init__.py index c6012d1133..21f4ae41c3 100644 --- a/pype/hosts/houdini/api/__init__.py +++ b/openpype/hosts/houdini/api/__init__.py @@ -8,14 +8,14 @@ from pyblish import api as pyblish from avalon import api as avalon from avalon.houdini import pipeline as houdini -import pype.hosts.houdini -from pype.hosts.houdini.api import lib +import openpype.hosts.houdini +from openpype.hosts.houdini.api import lib -from pype.lib import any_outdated +from openpype.lib import any_outdated -log = logging.getLogger("pype.hosts.houdini") +log = logging.getLogger("openpype.hosts.houdini") -HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.houdini.__file__)) +HOST_DIR = os.path.dirname(os.path.abspath(openpype.hosts.houdini.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "load") diff --git a/pype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py similarity index 99% rename from pype/hosts/houdini/api/lib.py rename to openpype/hosts/houdini/api/lib.py index 5087fba934..dd586ca02d 100644 --- a/pype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -4,7 +4,7 @@ from contextlib import contextmanager import hou -from pype import lib +from openpype import lib from avalon import api, io from avalon.houdini import lib as houdini diff --git a/pype/hosts/houdini/api/plugin.py b/openpype/hosts/houdini/api/plugin.py similarity index 67% rename from pype/hosts/houdini/api/plugin.py rename to openpype/hosts/houdini/api/plugin.py index 864cc59f09..9820ed49c3 100644 --- a/pype/hosts/houdini/api/plugin.py +++ b/openpype/hosts/houdini/api/plugin.py @@ -1,5 +1,5 @@ from avalon import houdini -from pype.api import PypeCreatorMixin +from openpype.api import PypeCreatorMixin class Creator(PypeCreatorMixin, houdini.Creator): diff --git a/pype/hosts/houdini/plugins/create/create_alembic_camera.py b/openpype/hosts/houdini/plugins/create/create_alembic_camera.py similarity index 96% rename from pype/hosts/houdini/plugins/create/create_alembic_camera.py rename to openpype/hosts/houdini/plugins/create/create_alembic_camera.py index 2a849ddaa0..adcfb48539 100644 --- a/pype/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/openpype/hosts/houdini/plugins/create/create_alembic_camera.py @@ -1,4 +1,4 @@ -from pype.hosts.houdini.api import plugin +from openpype.hosts.houdini.api import plugin class CreateAlembicCamera(plugin.Creator): diff --git a/pype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py similarity index 96% rename from pype/hosts/houdini/plugins/create/create_pointcache.py rename to openpype/hosts/houdini/plugins/create/create_pointcache.py index a36ee1c965..6be854ac28 100644 --- a/pype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -1,4 +1,4 @@ -from pype.hosts.houdini.api import plugin +from openpype.hosts.houdini.api import plugin class CreatePointCache(plugin.Creator): diff --git a/pype/hosts/houdini/plugins/create/create_vbd_cache.py b/openpype/hosts/houdini/plugins/create/create_vbd_cache.py similarity index 94% rename from pype/hosts/houdini/plugins/create/create_vbd_cache.py rename to openpype/hosts/houdini/plugins/create/create_vbd_cache.py index 01401f0ce4..f8f3bbf9c3 100644 --- a/pype/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/openpype/hosts/houdini/plugins/create/create_vbd_cache.py @@ -1,4 +1,4 @@ -from pype.hosts.houdini.api import plugin +from openpype.hosts.houdini.api import plugin class CreateVDBCache(plugin.Creator): diff --git a/pype/hosts/houdini/plugins/load/load_alembic.py b/openpype/hosts/houdini/plugins/load/load_alembic.py similarity index 100% rename from pype/hosts/houdini/plugins/load/load_alembic.py rename to openpype/hosts/houdini/plugins/load/load_alembic.py diff --git a/pype/hosts/houdini/plugins/load/load_camera.py b/openpype/hosts/houdini/plugins/load/load_camera.py similarity index 100% rename from pype/hosts/houdini/plugins/load/load_camera.py rename to openpype/hosts/houdini/plugins/load/load_camera.py diff --git a/pype/hosts/houdini/plugins/publish/collect_current_file.py b/openpype/hosts/houdini/plugins/publish/collect_current_file.py similarity index 100% rename from pype/hosts/houdini/plugins/publish/collect_current_file.py rename to openpype/hosts/houdini/plugins/publish/collect_current_file.py diff --git a/pype/hosts/houdini/plugins/publish/collect_frames.py b/openpype/hosts/houdini/plugins/publish/collect_frames.py similarity index 97% rename from pype/hosts/houdini/plugins/publish/collect_frames.py rename to openpype/hosts/houdini/plugins/publish/collect_frames.py index 47037f94d4..1d664aeaeb 100644 --- a/pype/hosts/houdini/plugins/publish/collect_frames.py +++ b/openpype/hosts/houdini/plugins/publish/collect_frames.py @@ -2,7 +2,7 @@ import os import re import pyblish.api -from pype.hosts.houdini.api import lib +from openpype.hosts.houdini.api import lib class CollectFrames(pyblish.api.InstancePlugin): diff --git a/pype/hosts/houdini/plugins/publish/collect_instances.py b/openpype/hosts/houdini/plugins/publish/collect_instances.py similarity index 100% rename from pype/hosts/houdini/plugins/publish/collect_instances.py rename to openpype/hosts/houdini/plugins/publish/collect_instances.py diff --git a/pype/hosts/houdini/plugins/publish/collect_output_node.py b/openpype/hosts/houdini/plugins/publish/collect_output_node.py similarity index 100% rename from pype/hosts/houdini/plugins/publish/collect_output_node.py rename to openpype/hosts/houdini/plugins/publish/collect_output_node.py diff --git a/pype/hosts/houdini/plugins/publish/collect_workscene_fps.py b/openpype/hosts/houdini/plugins/publish/collect_workscene_fps.py similarity index 100% rename from pype/hosts/houdini/plugins/publish/collect_workscene_fps.py rename to openpype/hosts/houdini/plugins/publish/collect_workscene_fps.py diff --git a/pype/hosts/houdini/plugins/publish/extract_alembic.py b/openpype/hosts/houdini/plugins/publish/extract_alembic.py similarity index 95% rename from pype/hosts/houdini/plugins/publish/extract_alembic.py rename to openpype/hosts/houdini/plugins/publish/extract_alembic.py index a71b85c529..b251ebdc90 100644 --- a/pype/hosts/houdini/plugins/publish/extract_alembic.py +++ b/openpype/hosts/houdini/plugins/publish/extract_alembic.py @@ -1,10 +1,10 @@ import os import pyblish.api -import pype.api +import openpype.api -class ExtractAlembic(pype.api.Extractor): +class ExtractAlembic(openpype.api.Extractor): order = pyblish.api.ExtractorOrder label = "Extract Alembic" diff --git a/pype/hosts/houdini/plugins/publish/extract_vdb_cache.py b/openpype/hosts/houdini/plugins/publish/extract_vdb_cache.py similarity index 95% rename from pype/hosts/houdini/plugins/publish/extract_vdb_cache.py rename to openpype/hosts/houdini/plugins/publish/extract_vdb_cache.py index c56a4dd73a..f480fe6236 100644 --- a/pype/hosts/houdini/plugins/publish/extract_vdb_cache.py +++ b/openpype/hosts/houdini/plugins/publish/extract_vdb_cache.py @@ -1,10 +1,10 @@ import os import pyblish.api -import pype.api +import openpype.api -class ExtractVDBCache(pype.api.Extractor): +class ExtractVDBCache(openpype.api.Extractor): order = pyblish.api.ExtractorOrder + 0.1 label = "Extract VDB Cache" diff --git a/pype/hosts/houdini/plugins/publish/valiate_vdb_input_node.py b/openpype/hosts/houdini/plugins/publish/valiate_vdb_input_node.py similarity index 94% rename from pype/hosts/houdini/plugins/publish/valiate_vdb_input_node.py rename to openpype/hosts/houdini/plugins/publish/valiate_vdb_input_node.py index e5bc118306..7b23d73ac7 100644 --- a/pype/hosts/houdini/plugins/publish/valiate_vdb_input_node.py +++ b/openpype/hosts/houdini/plugins/publish/valiate_vdb_input_node.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.api +import openpype.api class ValidateVDBInputNode(pyblish.api.InstancePlugin): @@ -16,7 +16,7 @@ class ValidateVDBInputNode(pyblish.api.InstancePlugin): """ - order = pype.api.ValidateContentsOrder + 0.1 + order = openpype.api.ValidateContentsOrder + 0.1 families = ["vdbcache"] hosts = ["houdini"] label = "Validate Input Node (VDB)" diff --git a/pype/hosts/houdini/plugins/publish/validate_alembic_input_node.py b/openpype/hosts/houdini/plugins/publish/validate_alembic_input_node.py similarity index 93% rename from pype/hosts/houdini/plugins/publish/validate_alembic_input_node.py rename to openpype/hosts/houdini/plugins/publish/validate_alembic_input_node.py index c68e3cdf5c..e8596b739d 100644 --- a/pype/hosts/houdini/plugins/publish/validate_alembic_input_node.py +++ b/openpype/hosts/houdini/plugins/publish/validate_alembic_input_node.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.api +import openpype.api class ValidateAlembicInputNode(pyblish.api.InstancePlugin): @@ -11,7 +11,7 @@ class ValidateAlembicInputNode(pyblish.api.InstancePlugin): """ - order = pype.api.ValidateContentsOrder + 0.1 + order = openpype.api.ValidateContentsOrder + 0.1 families = ["pointcache"] hosts = ["houdini"] label = "Validate Input Node (Abc)" diff --git a/pype/hosts/houdini/plugins/publish/validate_animation_settings.py b/openpype/hosts/houdini/plugins/publish/validate_animation_settings.py similarity index 97% rename from pype/hosts/houdini/plugins/publish/validate_animation_settings.py rename to openpype/hosts/houdini/plugins/publish/validate_animation_settings.py index 633c13dfb6..a42c3696da 100644 --- a/pype/hosts/houdini/plugins/publish/validate_animation_settings.py +++ b/openpype/hosts/houdini/plugins/publish/validate_animation_settings.py @@ -1,6 +1,6 @@ import pyblish.api -from pype.hosts.houdini.api import lib +from openpype.hosts.houdini.api import lib class ValidateAnimationSettings(pyblish.api.InstancePlugin): diff --git a/pype/hosts/houdini/plugins/publish/validate_bypass.py b/openpype/hosts/houdini/plugins/publish/validate_bypass.py similarity index 92% rename from pype/hosts/houdini/plugins/publish/validate_bypass.py rename to openpype/hosts/houdini/plugins/publish/validate_bypass.py index 70505f0731..9118ae0e8c 100644 --- a/pype/hosts/houdini/plugins/publish/validate_bypass.py +++ b/openpype/hosts/houdini/plugins/publish/validate_bypass.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.api +import openpype.api class ValidateBypassed(pyblish.api.InstancePlugin): @@ -11,7 +11,7 @@ class ValidateBypassed(pyblish.api.InstancePlugin): """ - order = pype.api.ValidateContentsOrder - 0.1 + order = openpype.api.ValidateContentsOrder - 0.1 families = ["*"] hosts = ["houdini"] label = "Validate ROP Bypass" diff --git a/pype/hosts/houdini/plugins/publish/validate_camera_rop.py b/openpype/hosts/houdini/plugins/publish/validate_camera_rop.py similarity index 95% rename from pype/hosts/houdini/plugins/publish/validate_camera_rop.py rename to openpype/hosts/houdini/plugins/publish/validate_camera_rop.py index 48335cfb37..ca75579267 100644 --- a/pype/hosts/houdini/plugins/publish/validate_camera_rop.py +++ b/openpype/hosts/houdini/plugins/publish/validate_camera_rop.py @@ -1,11 +1,11 @@ import pyblish.api -import pype.api +import openpype.api class ValidateCameraROP(pyblish.api.InstancePlugin): """Validate Camera ROP settings.""" - order = pype.api.ValidateContentsOrder + order = openpype.api.ValidateContentsOrder families = ['camera'] hosts = ['houdini'] label = 'Camera ROP' diff --git a/pype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py b/openpype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py similarity index 92% rename from pype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py rename to openpype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py index c2b72b4e43..a735f4b64b 100644 --- a/pype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py +++ b/openpype/hosts/houdini/plugins/publish/validate_mkpaths_toggled.py @@ -1,11 +1,11 @@ import pyblish.api -import pype.api +import openpype.api class ValidateIntermediateDirectoriesChecked(pyblish.api.InstancePlugin): """Validate Create Intermediate Directories is enabled on ROP node.""" - order = pype.api.ValidateContentsOrder + order = openpype.api.ValidateContentsOrder families = ['pointcache', 'camera', 'vdbcache'] diff --git a/pype/hosts/houdini/plugins/publish/validate_outnode_exists.py b/openpype/hosts/houdini/plugins/publish/validate_outnode_exists.py similarity index 95% rename from pype/hosts/houdini/plugins/publish/validate_outnode_exists.py rename to openpype/hosts/houdini/plugins/publish/validate_outnode_exists.py index 0ba04b87d0..bfa2d38f1a 100644 --- a/pype/hosts/houdini/plugins/publish/validate_outnode_exists.py +++ b/openpype/hosts/houdini/plugins/publish/validate_outnode_exists.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.api +import openpype.api class ValidatOutputNodeExists(pyblish.api.InstancePlugin): @@ -11,7 +11,7 @@ class ValidatOutputNodeExists(pyblish.api.InstancePlugin): """ - order = pype.api.ValidateContentsOrder + order = openpype.api.ValidateContentsOrder families = ["*"] hosts = ['houdini'] label = "Output Node Exists" diff --git a/pype/hosts/houdini/plugins/publish/validate_output_node.py b/openpype/hosts/houdini/plugins/publish/validate_output_node.py similarity index 100% rename from pype/hosts/houdini/plugins/publish/validate_output_node.py rename to openpype/hosts/houdini/plugins/publish/validate_output_node.py diff --git a/pype/hosts/houdini/plugins/publish/validate_primitive_hierarchy_paths.py b/openpype/hosts/houdini/plugins/publish/validate_primitive_hierarchy_paths.py similarity index 97% rename from pype/hosts/houdini/plugins/publish/validate_primitive_hierarchy_paths.py rename to openpype/hosts/houdini/plugins/publish/validate_primitive_hierarchy_paths.py index 70e7873d3b..608e236198 100644 --- a/pype/hosts/houdini/plugins/publish/validate_primitive_hierarchy_paths.py +++ b/openpype/hosts/houdini/plugins/publish/validate_primitive_hierarchy_paths.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.api +import openpype.api class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin): @@ -11,7 +11,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin): """ - order = pype.api.ValidateContentsOrder + 0.1 + order = openpype.api.ValidateContentsOrder + 0.1 families = ["pointcache"] hosts = ["houdini"] label = "Validate Prims Hierarchy Path" diff --git a/pype/hosts/houdini/plugins/publish/validate_vdb_input_node.py b/openpype/hosts/houdini/plugins/publish/validate_vdb_input_node.py similarity index 94% rename from pype/hosts/houdini/plugins/publish/validate_vdb_input_node.py rename to openpype/hosts/houdini/plugins/publish/validate_vdb_input_node.py index e5bc118306..7b23d73ac7 100644 --- a/pype/hosts/houdini/plugins/publish/validate_vdb_input_node.py +++ b/openpype/hosts/houdini/plugins/publish/validate_vdb_input_node.py @@ -1,5 +1,5 @@ import pyblish.api -import pype.api +import openpype.api class ValidateVDBInputNode(pyblish.api.InstancePlugin): @@ -16,7 +16,7 @@ class ValidateVDBInputNode(pyblish.api.InstancePlugin): """ - order = pype.api.ValidateContentsOrder + 0.1 + order = openpype.api.ValidateContentsOrder + 0.1 families = ["vdbcache"] hosts = ["houdini"] label = "Validate Input Node (VDB)" diff --git a/pype/hosts/houdini/startup/MainMenuCommon.XML b/openpype/hosts/houdini/startup/MainMenuCommon.XML similarity index 73% rename from pype/hosts/houdini/startup/MainMenuCommon.XML rename to openpype/hosts/houdini/startup/MainMenuCommon.XML index ba639a71a1..77ee182e7c 100644 --- a/pype/hosts/houdini/startup/MainMenuCommon.XML +++ b/openpype/hosts/houdini/startup/MainMenuCommon.XML @@ -2,21 +2,7 @@`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Duplicate behavior to the data-* attribute for our tooltip plugin\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Remove the bottom border in Firefox 39-.\n// 5. Prevent the text-decoration to be skipped.\n\nabbr[title],\nabbr[data-original-title] { // 1\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 4\n text-decoration-skip-ink: none; // 5\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\nb,\nstrong {\n font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-monospace;\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg {\n // Workaround for the SVG overflow bug in IE10/11 is still required.\n // See https://github.com/twbs/bootstrap/issues/26878\n overflow: hidden;\n vertical-align: middle;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $table-caption-color;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `