mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch '3.0/bugfix/hiero-functionality-issues' into feature/1235-hiero-unify-otio-workflow-from-resolve
This commit is contained in:
commit
3c035a3def
1717 changed files with 5004 additions and 58388 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -32,6 +32,7 @@ Network Trash Folder
|
|||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
|
||||
# CX_Freeze
|
||||
###########
|
||||
/build
|
||||
|
|
@ -63,13 +64,12 @@ coverage.xml
|
|||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
|
||||
# Node JS packages
|
||||
##################
|
||||
node_modules/
|
||||
package-lock.json
|
||||
|
||||
pype/premiere/ppro/js/debug.log
|
||||
openpype/premiere/ppro/js/debug.log
|
||||
|
||||
|
||||
# IDEA
|
||||
|
|
@ -79,4 +79,5 @@ pype/premiere/ppro/js/debug.log
|
|||
# VScode files
|
||||
.vscode/
|
||||
.env
|
||||
dump.sql
|
||||
dump.sql
|
||||
test_localsystem.txt
|
||||
|
|
|
|||
8
.gitmodules
vendored
8
.gitmodules
vendored
|
|
@ -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
|
||||
117
README.md
117
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**.
|
||||
|
||||
|
||||
<details>
|
||||
|
|
@ -127,7 +138,7 @@ sudo apt install build-essential checkinstall
|
|||
sudo apt install git cmake curl
|
||||
```
|
||||
#### Note:
|
||||
In case you run in error about `xcb` when running Pype,
|
||||
In case you run in error about `xcb` when running OpenPype,
|
||||
you'll need also additional libraries for Qt5:
|
||||
|
||||
```sh
|
||||
|
|
@ -144,7 +155,7 @@ sudo yum install qit cmake
|
|||
```
|
||||
|
||||
#### Note:
|
||||
In case you run in error about `xcb` when running Pype,
|
||||
In case you run in error about `xcb` when running OpenPype,
|
||||
you'll need also additional libraries for Qt5:
|
||||
|
||||
```sh
|
||||
|
|
@ -153,7 +164,7 @@ sudo yum install qt5-qtbase-devel
|
|||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Use pyenv to install Python version for Pype build</summary>
|
||||
<summary>Use pyenv to install Python version for OpenPype build</summary>
|
||||
|
||||
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
|
|||
```
|
||||
</details>
|
||||
|
||||
#### 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\`
|
||||
|
||||
|
||||
Running Pype
|
||||
Running OpenPype
|
||||
------------
|
||||
|
||||
Pype can by executed either from live sources (this repository) or from
|
||||
OpenPype can by executed either from live sources (this repository) or from
|
||||
*"frozen code"* - executables that can be build using steps described above.
|
||||
|
||||
If Pype is executed from live sources, it will use Pype version included in them. If
|
||||
it is executed from frozen code it will try to find latest Pype version installed locally
|
||||
If OpenPype is executed from live sources, it will use OpenPype version included in them. If
|
||||
it is executed from frozen code it will try to find latest OpenPype version installed locally
|
||||
on current computer and if it is not found, it will ask for its location. On that location
|
||||
pype can be either in directories or zip files. Pype will try to find latest version and
|
||||
install it to user data directory (on Windows to `%LOCALAPPDATA%\pypeclub\pype`, on Linux
|
||||
`~/.local/share/pype` and on macOS in `~/Library/Application Support/pype`).
|
||||
OpenPype can be either in directories or zip files. OpenPype will try to find latest version and
|
||||
install it to user data directory (on Windows to `%LOCALAPPDATA%\pypeclub\openpype`, on Linux
|
||||
`~/.local/share/openpype` and on macOS in `~/Library/Application Support/openpype`).
|
||||
|
||||
### From sources
|
||||
Pype can be run directly from sources by activating virtual environment:
|
||||
OpenPype can be run directly from sources by activating virtual environment:
|
||||
|
||||
```sh
|
||||
poetry run python start.py tray
|
||||
```
|
||||
|
||||
This will use current Pype version with sources. You can override this with `--use-version=x.x.x` and
|
||||
then Pype will try to find locally installed specified version (present in user data directory).
|
||||
This will use current OpenPype version with sources. You can override this with `--use-version=x.x.x` and
|
||||
then OpenPype will try to find locally installed specified version (present in user data directory).
|
||||
|
||||
### From frozen code
|
||||
|
||||
You need to build Pype first. This will produce two executables - `pype_gui(.exe)` and `pype_console(.exe)`.
|
||||
You need to build OpenPype first. This will produce two executables - `openpype_gui(.exe)` and `openpype_console(.exe)`.
|
||||
First one will act as GUI application and will not create console (useful in production environments).
|
||||
The second one will create console and will write output there - useful for headless application and
|
||||
debugging purposes. If you need pype version installed, just run `./tools/create_zip(.ps1|.sh)` without
|
||||
arguments and it will create zip file that pype can use.
|
||||
debugging purposes. If you need OpenPype version installed, just run `./tools/create_zip(.ps1|.sh)` without
|
||||
arguments and it will create zip file that OpenPype can use.
|
||||
|
||||
|
||||
Building documentation
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Bootstrap Pype repositories."""
|
||||
"""Bootstrap OpenPype repositories."""
|
||||
import functools
|
||||
import logging as log
|
||||
import os
|
||||
|
|
@ -14,8 +14,8 @@ from zipfile import ZipFile, BadZipFile
|
|||
from appdirs import user_data_dir
|
||||
from speedcopy import copyfile
|
||||
|
||||
from .user_settings import PypeSettingsRegistry
|
||||
from .tools import get_pype_path_from_db
|
||||
from .user_settings import OpenPypeSettingsRegistry
|
||||
from .tools import get_openpype_path_from_db
|
||||
|
||||
|
||||
LOG_INFO = 0
|
||||
|
|
@ -24,8 +24,8 @@ LOG_ERROR = 3
|
|||
|
||||
|
||||
@functools.total_ordering
|
||||
class PypeVersion:
|
||||
"""Class for storing information about Pype version.
|
||||
class OpenPypeVersion:
|
||||
"""Class for storing information about OpenPype version.
|
||||
|
||||
Attributes:
|
||||
major (int): [1].2.3-client-variant
|
||||
|
|
@ -33,7 +33,7 @@ class PypeVersion:
|
|||
subversion (int): 1.2.[3]-client-variant
|
||||
client (str): 1.2.3-[client]-variant
|
||||
variant (str): 1.2.3-client-[variant]
|
||||
path (str): path to Pype
|
||||
path (str): path to OpenPype
|
||||
|
||||
"""
|
||||
major = 0
|
||||
|
|
@ -191,37 +191,37 @@ class PypeVersion:
|
|||
|
||||
@staticmethod
|
||||
def version_in_str(string: str) -> Tuple:
|
||||
"""Find Pype version in given string.
|
||||
"""Find OpenPype version in given string.
|
||||
|
||||
Args:
|
||||
string (str): string to search.
|
||||
|
||||
Returns:
|
||||
tuple: True/False and PypeVersion if found.
|
||||
tuple: True/False and OpenPypeVersion if found.
|
||||
|
||||
"""
|
||||
try:
|
||||
result = PypeVersion._decompose_version(string)
|
||||
result = OpenPypeVersion._decompose_version(string)
|
||||
except ValueError:
|
||||
return False, None
|
||||
return True, PypeVersion(major=result[0],
|
||||
minor=result[1],
|
||||
subversion=result[2],
|
||||
variant=result[3],
|
||||
client=result[4])
|
||||
return True, OpenPypeVersion(major=result[0],
|
||||
minor=result[1],
|
||||
subversion=result[2],
|
||||
variant=result[3],
|
||||
client=result[4])
|
||||
|
||||
|
||||
class BootstrapRepos:
|
||||
"""Class for bootstrapping local Pype installation.
|
||||
"""Class for bootstrapping local OpenPype installation.
|
||||
|
||||
Attributes:
|
||||
data_dir (Path): local Pype installation directory.
|
||||
data_dir (Path): local OpenPype installation directory.
|
||||
live_repo_dir (Path): path to repos directory if running live,
|
||||
otherwise `None`.
|
||||
registry (PypeSettingsRegistry): Pype registry object.
|
||||
registry (OpenPypeSettingsRegistry): OpenPype registry object.
|
||||
zip_filter (list): List of files to exclude from zip
|
||||
pype_filter (list): list of top level directories not to include in
|
||||
zip in Pype repository.
|
||||
openpype_filter (list): list of top level directories not to
|
||||
include in zip in OpenPype repository.
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -236,13 +236,13 @@ class BootstrapRepos:
|
|||
"""
|
||||
# vendor and app used to construct user data dir
|
||||
self._vendor = "pypeclub"
|
||||
self._app = "pype"
|
||||
self._app = "openpype"
|
||||
self._log = log.getLogger(str(__class__))
|
||||
self.data_dir = Path(user_data_dir(self._app, self._vendor))
|
||||
self.registry = PypeSettingsRegistry()
|
||||
self.registry = OpenPypeSettingsRegistry()
|
||||
self.zip_filter = [".pyc", "__pycache__"]
|
||||
self.pype_filter = [
|
||||
"build", "docs", "tests", "repos", "tools", "venv"
|
||||
self.openpype_filter = [
|
||||
"build", "docs", "tests", "tools", "venv", "coverage"
|
||||
]
|
||||
self._message = message
|
||||
|
||||
|
|
@ -262,11 +262,11 @@ class BootstrapRepos:
|
|||
|
||||
@staticmethod
|
||||
def get_version_path_from_list(version: str, version_list: list) -> Path:
|
||||
"""Get path for specific version in list of Pype versions.
|
||||
"""Get path for specific version in list of OpenPype versions.
|
||||
|
||||
Args:
|
||||
version (str): Version string to look for (1.2.4-staging)
|
||||
version_list (list of PypeVersion): list of version to search.
|
||||
version_list (list of OpenPypeVersion): list of version to search.
|
||||
|
||||
Returns:
|
||||
Path: Path to given version.
|
||||
|
|
@ -278,31 +278,32 @@ class BootstrapRepos:
|
|||
|
||||
@staticmethod
|
||||
def get_local_live_version() -> str:
|
||||
"""Get version of local Pype."""
|
||||
"""Get version of local OpenPype."""
|
||||
|
||||
version = {}
|
||||
path = Path(os.path.dirname(__file__)).parent / "pype" / "version.py"
|
||||
path = Path(os.path.dirname(__file__)).parent / "openpype" / "version.py"
|
||||
with open(path, "r") as fp:
|
||||
exec(fp.read(), version)
|
||||
return version["__version__"]
|
||||
|
||||
@staticmethod
|
||||
def get_version(repo_dir: Path) -> Union[str, None]:
|
||||
"""Get version of Pype in given directory.
|
||||
"""Get version of OpenPype in given directory.
|
||||
|
||||
Note: in frozen Pype installed in user data dir, this must point
|
||||
one level deeper as it is `pype-version-v3.0.0/pype/pype/version.py`
|
||||
Note: in frozen OpenPype installed in user data dir, this must point
|
||||
one level deeper as it is:
|
||||
`openpype-version-v3.0.0/openpype/version.py`
|
||||
|
||||
Args:
|
||||
repo_dir (Path): Path to Pype repo.
|
||||
repo_dir (Path): Path to OpenPype repo.
|
||||
|
||||
Returns:
|
||||
str: version string.
|
||||
None: if Pype is not found.
|
||||
None: if OpenPype is not found.
|
||||
|
||||
"""
|
||||
# try to find version
|
||||
version_file = Path(repo_dir) / "pype" / "version.py"
|
||||
version_file = Path(repo_dir) / "openpype" / "version.py"
|
||||
if not version_file.exists():
|
||||
return None
|
||||
|
||||
|
|
@ -313,22 +314,22 @@ class BootstrapRepos:
|
|||
return version['__version__']
|
||||
|
||||
def create_version_from_live_code(
|
||||
self, repo_dir: Path = None) -> Union[PypeVersion, None]:
|
||||
"""Copy zip created from Pype repositories to user data dir.
|
||||
self, repo_dir: Path = None) -> Union[OpenPypeVersion, None]:
|
||||
"""Copy zip created from OpenPype repositories to user data dir.
|
||||
|
||||
This detect Pype version either in local "live" Pype repository
|
||||
or in user provided path. Then it will zip it in temporary directory
|
||||
and finally it will move it to destination which is user data
|
||||
directory. Existing files will be replaced.
|
||||
This detect OpenPype version either in local "live" OpenPype
|
||||
repository or in user provided path. Then it will zip it in temporary
|
||||
directory and finally it will move it to destination which is user
|
||||
data directory. Existing files will be replaced.
|
||||
|
||||
Args:
|
||||
repo_dir (Path, optional): Path to Pype repository.
|
||||
repo_dir (Path, optional): Path to OpenPype repository.
|
||||
|
||||
Returns:
|
||||
Path: path of installed repository file.
|
||||
|
||||
"""
|
||||
# if repo dir is not set, we detect local "live" Pype repository
|
||||
# if repo dir is not set, we detect local "live" OpenPype repository
|
||||
# version and use it as a source. Otherwise repo_dir is user
|
||||
# entered location.
|
||||
if not repo_dir:
|
||||
|
|
@ -338,7 +339,7 @@ class BootstrapRepos:
|
|||
version = self.get_version(repo_dir)
|
||||
|
||||
if not version:
|
||||
self._print("Pype not found.", LOG_ERROR)
|
||||
self._print("OpenPype not found.", LOG_ERROR)
|
||||
return
|
||||
|
||||
# create destination directory
|
||||
|
|
@ -348,20 +349,20 @@ class BootstrapRepos:
|
|||
# create zip inside temporary directory.
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
temp_zip = \
|
||||
Path(temp_dir) / f"pype-v{version}.zip"
|
||||
Path(temp_dir) / f"openpype-v{version}.zip"
|
||||
self._print(f"creating zip: {temp_zip}")
|
||||
|
||||
self._create_pype_zip(temp_zip, repo_dir)
|
||||
self._create_openpype_zip(temp_zip, repo_dir.parent)
|
||||
if not os.path.exists(temp_zip):
|
||||
self._print("make archive failed.", LOG_ERROR)
|
||||
return None
|
||||
|
||||
destination = self._move_zip_to_data_dir(temp_zip)
|
||||
|
||||
return PypeVersion(version=version, path=destination)
|
||||
return OpenPypeVersion(version=version, path=destination)
|
||||
|
||||
def _move_zip_to_data_dir(self, zip_file) -> Union[None, Path]:
|
||||
"""Move zip with Pype version to user data directory.
|
||||
"""Move zip with OpenPype version to user data directory.
|
||||
|
||||
Args:
|
||||
zip_file (Path): Path to zip file.
|
||||
|
|
@ -404,148 +405,110 @@ class BootstrapRepos:
|
|||
result.append(item)
|
||||
return result
|
||||
|
||||
def create_version_from_frozen_code(self) -> Union[None, PypeVersion]:
|
||||
"""Create Pype version from *frozen* code distributed by installer.
|
||||
def create_version_from_frozen_code(self) -> Union[None, OpenPypeVersion]:
|
||||
"""Create OpenPype version from *frozen* code distributed by installer.
|
||||
|
||||
This should be real edge case for those wanting to try out Pype
|
||||
This should be real edge case for those wanting to try out OpenPype
|
||||
without setting up whole infrastructure but is strongly discouraged
|
||||
in studio setup as this use local version independent of others
|
||||
that can be out of date.
|
||||
|
||||
Returns:
|
||||
:class:`PypeVersion` zip file to be installed.
|
||||
:class:`OpenPypeVersion` zip file to be installed.
|
||||
|
||||
"""
|
||||
frozen_root = Path(sys.executable).parent
|
||||
repo_dir = frozen_root / "repos"
|
||||
repo_list = self._filter_dir(
|
||||
repo_dir, self.zip_filter)
|
||||
|
||||
# from frozen code we need igniter, pype, schema vendor
|
||||
pype_list = self._filter_dir(
|
||||
frozen_root / "pype", self.zip_filter)
|
||||
pype_list += self._filter_dir(
|
||||
# from frozen code we need igniter, openpype, schema vendor
|
||||
openpype_list = self._filter_dir(
|
||||
frozen_root / "openpype", self.zip_filter)
|
||||
openpype_list += self._filter_dir(
|
||||
frozen_root / "igniter", self.zip_filter)
|
||||
pype_list += self._filter_dir(
|
||||
openpype_list += self._filter_dir(
|
||||
frozen_root / "repos", self.zip_filter)
|
||||
openpype_list += self._filter_dir(
|
||||
frozen_root / "schema", self.zip_filter)
|
||||
pype_list += self._filter_dir(
|
||||
openpype_list += self._filter_dir(
|
||||
frozen_root / "vendor", self.zip_filter)
|
||||
pype_list.append(frozen_root / "README.md")
|
||||
pype_list.append(frozen_root / "LICENSE")
|
||||
openpype_list.append(frozen_root / "LICENSE")
|
||||
|
||||
version = self.get_version(frozen_root)
|
||||
|
||||
# create zip inside temporary directory.
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
temp_zip = \
|
||||
Path(temp_dir) / f"pype-v{version}.zip"
|
||||
Path(temp_dir) / f"openpype-v{version}.zip"
|
||||
self._print(f"creating zip: {temp_zip}")
|
||||
|
||||
with ZipFile(temp_zip, "w") as zip_file:
|
||||
progress = 0
|
||||
repo_inc = 48.0 / float(len(repo_list))
|
||||
openpype_inc = 98.0 / float(len(openpype_list))
|
||||
file: Path
|
||||
for file in repo_list:
|
||||
progress += repo_inc
|
||||
self._progress_callback(int(progress))
|
||||
|
||||
# archive name is relative to repos dir
|
||||
arc_name = file.relative_to(repo_dir)
|
||||
zip_file.write(file, arc_name)
|
||||
|
||||
pype_inc = 48.0 / float(len(pype_list))
|
||||
file: Path
|
||||
for file in pype_list:
|
||||
progress += pype_inc
|
||||
for file in openpype_list:
|
||||
progress += openpype_inc
|
||||
self._progress_callback(int(progress))
|
||||
|
||||
arc_name = file.relative_to(frozen_root.parent)
|
||||
# we need to replace first part of path which starts with
|
||||
# something like `exe.win/linux....` with `pype` as this
|
||||
# is expected by Pype in zip archive.
|
||||
arc_name = Path("pype").joinpath(*arc_name.parts[1:])
|
||||
# something like `exe.win/linux....` with `openpype` as
|
||||
# this is expected by OpenPype in zip archive.
|
||||
arc_name = Path().joinpath(*arc_name.parts[1:])
|
||||
zip_file.write(file, arc_name)
|
||||
|
||||
destination = self._move_zip_to_data_dir(temp_zip)
|
||||
|
||||
return PypeVersion(version=version, path=destination)
|
||||
return OpenPypeVersion(version=version, path=destination)
|
||||
|
||||
def _create_pype_zip(
|
||||
self,
|
||||
zip_path: Path, include_dir: Path,
|
||||
include_pype: bool = True) -> None:
|
||||
"""Pack repositories and Pype into zip.
|
||||
def _create_openpype_zip(self, zip_path: Path, openpype_path: Path) -> None:
|
||||
"""Pack repositories and OpenPype into zip.
|
||||
|
||||
We are using :mod:`zipfile` instead :meth:`shutil.make_archive`
|
||||
because we need to decide what file and directories to include in zip
|
||||
and what not. They are determined by :attr:`zip_filter` on file level
|
||||
and :attr:`pype_filter` on top level directory in Pype repository.
|
||||
and :attr:`openpype_filter` on top level directory in OpenPype
|
||||
repository.
|
||||
|
||||
Args:
|
||||
zip_path (str): path to zip file.
|
||||
include_dir (Path): repo directories to include.
|
||||
include_pype (bool): add Pype module itself.
|
||||
zip_path (Path): Path to zip file.
|
||||
openpype_path (Path): Path to OpenPype sources.
|
||||
|
||||
"""
|
||||
include_dir = include_dir.resolve()
|
||||
openpype_list = []
|
||||
openpype_inc = 0
|
||||
|
||||
pype_list = []
|
||||
# get filtered list of files in repositories (repos directory)
|
||||
repo_list = self._filter_dir(include_dir, self.zip_filter)
|
||||
# count them
|
||||
repo_files = len(repo_list)
|
||||
# get filtered list of file in Pype repository
|
||||
openpype_list = self._filter_dir(openpype_path, self.zip_filter)
|
||||
openpype_files = len(openpype_list)
|
||||
|
||||
# there must be some files, otherwise `include_dir` path is wrong
|
||||
assert repo_files != 0, f"No repositories to include in {include_dir}"
|
||||
pype_inc = 0
|
||||
if include_pype:
|
||||
# get filtered list of file in Pype repository
|
||||
pype_list = self._filter_dir(include_dir.parent, self.zip_filter)
|
||||
pype_files = len(pype_list)
|
||||
repo_inc = 48.0 / float(repo_files)
|
||||
pype_inc = 48.0 / float(pype_files)
|
||||
else:
|
||||
repo_inc = 98.0 / float(repo_files)
|
||||
openpype_inc = 98.0 / float(openpype_files)
|
||||
|
||||
with ZipFile(zip_path, "w") as zip_file:
|
||||
progress = 0
|
||||
openpype_root = openpype_path.resolve()
|
||||
# generate list of filtered paths
|
||||
dir_filter = [openpype_root / f for f in self.openpype_filter]
|
||||
|
||||
file: Path
|
||||
for file in repo_list:
|
||||
progress += repo_inc
|
||||
for file in openpype_list:
|
||||
progress += openpype_inc
|
||||
self._progress_callback(int(progress))
|
||||
|
||||
# archive name is relative to repos dir
|
||||
arc_name = file.relative_to(include_dir)
|
||||
zip_file.write(file, arc_name)
|
||||
# if file resides in filtered path, skip it
|
||||
is_inside = None
|
||||
df: Path
|
||||
for df in dir_filter:
|
||||
try:
|
||||
is_inside = file.resolve().relative_to(df)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
# add pype itself
|
||||
if include_pype:
|
||||
pype_root = include_dir.parent.resolve()
|
||||
# generate list of filtered paths
|
||||
dir_filter = [pype_root / f for f in self.pype_filter]
|
||||
if is_inside:
|
||||
continue
|
||||
|
||||
file: Path
|
||||
for file in pype_list:
|
||||
progress += pype_inc
|
||||
self._progress_callback(int(progress))
|
||||
processed_path = file
|
||||
self._print(f"- processing {processed_path}")
|
||||
|
||||
# if file resides in filtered path, skip it
|
||||
is_inside = None
|
||||
df: Path
|
||||
for df in dir_filter:
|
||||
try:
|
||||
is_inside = file.resolve().relative_to(df)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if is_inside:
|
||||
continue
|
||||
|
||||
processed_path = file
|
||||
self._print(f"- processing {processed_path}")
|
||||
|
||||
zip_file.write(file,
|
||||
"pype" / file.relative_to(pype_root))
|
||||
zip_file.write(file, file.relative_to(openpype_root))
|
||||
|
||||
# test if zip is ok
|
||||
zip_file.testzip()
|
||||
|
|
@ -553,10 +516,10 @@ class BootstrapRepos:
|
|||
|
||||
@staticmethod
|
||||
def add_paths_from_archive(archive: Path) -> None:
|
||||
"""Add first-level directories as paths to :mod:`sys.path`.
|
||||
"""Add first-level directory and 'repos' as paths to :mod:`sys.path`.
|
||||
|
||||
This will enable Python to import modules is second-level directories
|
||||
in zip file.
|
||||
This will enable Python to import OpenPype and modules in `repos`
|
||||
submodule directory in zip file.
|
||||
|
||||
Adding to both `sys.path` and `PYTHONPATH`, skipping duplicates.
|
||||
|
||||
|
|
@ -574,21 +537,29 @@ class BootstrapRepos:
|
|||
name_list = zip_file.namelist()
|
||||
|
||||
roots = []
|
||||
paths = []
|
||||
for item in name_list:
|
||||
root = item.split("/")[0]
|
||||
if not item.startswith("repos/"):
|
||||
continue
|
||||
|
||||
root = item.split("/")[1]
|
||||
|
||||
if root not in roots:
|
||||
roots.append(root)
|
||||
sys.path.insert(0, f"{archive}{os.path.sep}{root}")
|
||||
paths.append(
|
||||
f"{archive}{os.path.sep}repos{os.path.sep}{root}")
|
||||
sys.path.insert(0, paths[-1])
|
||||
|
||||
sys.path.insert(0, f"{archive}")
|
||||
pythonpath = os.getenv("PYTHONPATH", "")
|
||||
paths = pythonpath.split(os.pathsep)
|
||||
paths += roots
|
||||
python_paths = pythonpath.split(os.pathsep)
|
||||
python_paths += paths
|
||||
|
||||
os.environ["PYTHONPATH"] = os.pathsep.join(paths)
|
||||
os.environ["PYTHONPATH"] = os.pathsep.join(python_paths)
|
||||
|
||||
@staticmethod
|
||||
def add_paths_from_directory(directory: Path) -> None:
|
||||
"""Add first level directories as paths to :mod:`sys.path`.
|
||||
"""Add repos first level directories as paths to :mod:`sys.path`.
|
||||
|
||||
This works the same as :meth:`add_paths_from_archive` but in
|
||||
specified directory.
|
||||
|
|
@ -599,6 +570,8 @@ class BootstrapRepos:
|
|||
directory (Path): path to directory.
|
||||
|
||||
"""
|
||||
sys.path.insert(0, directory.as_posix())
|
||||
directory = directory / "repos"
|
||||
if not directory.exists() and not directory.is_dir():
|
||||
raise ValueError("directory is invalid")
|
||||
|
||||
|
|
@ -616,57 +589,57 @@ class BootstrapRepos:
|
|||
|
||||
os.environ["PYTHONPATH"] = os.pathsep.join(paths)
|
||||
|
||||
def find_pype(
|
||||
def find_openpype(
|
||||
self,
|
||||
pype_path: Union[Path, str] = None,
|
||||
openpype_path: Union[Path, str] = None,
|
||||
staging: bool = False,
|
||||
include_zips: bool = False) -> Union[List[PypeVersion], None]:
|
||||
"""Get ordered dict of detected Pype version.
|
||||
include_zips: bool = False) -> Union[List[OpenPypeVersion], None]:
|
||||
"""Get ordered dict of detected OpenPype version.
|
||||
|
||||
Resolution order for Pype is following:
|
||||
Resolution order for OpenPype is following:
|
||||
|
||||
1) First we test for ``PYPE_PATH`` environment variable
|
||||
2) We try to find ``pypePath`` in registry setting
|
||||
1) First we test for ``OPENPYPE_PATH`` environment variable
|
||||
2) We try to find ``openPypePath`` in registry setting
|
||||
3) We use user data directory
|
||||
|
||||
Args:
|
||||
pype_path (Path or str, optional): Try to find Pype on the given
|
||||
path or url.
|
||||
openpype_path (Path or str, optional): Try to find OpenPype on
|
||||
the given path or url.
|
||||
staging (bool, optional): Filter only staging version, skip them
|
||||
otherwise.
|
||||
include_zips (bool, optional): If set True it will try to find
|
||||
Pype in zip files in given directory.
|
||||
OpenPype in zip files in given directory.
|
||||
|
||||
Returns:
|
||||
dict of Path: Dictionary of detected Pype version.
|
||||
dict of Path: Dictionary of detected OpenPype version.
|
||||
Key is version, value is path to zip file.
|
||||
|
||||
None: if Pype is not found.
|
||||
None: if OpenPype is not found.
|
||||
|
||||
Todo:
|
||||
implement git/url support as Pype location, so it would be
|
||||
possible to enter git url, Pype would check it out and if it is
|
||||
implement git/url support as OpenPype location, so it would be
|
||||
possible to enter git url, OpenPype would check it out and if it is
|
||||
ok install it as normal version.
|
||||
|
||||
"""
|
||||
if pype_path and not isinstance(pype_path, Path):
|
||||
if openpype_path and not isinstance(openpype_path, Path):
|
||||
raise NotImplementedError(
|
||||
("Finding Pype in non-filesystem locations is"
|
||||
("Finding OpenPype in non-filesystem locations is"
|
||||
" not implemented yet."))
|
||||
|
||||
dir_to_search = self.data_dir
|
||||
|
||||
# if we have pype_path specified, search only there.
|
||||
if pype_path:
|
||||
dir_to_search = pype_path
|
||||
# if we have openpype_path specified, search only there.
|
||||
if openpype_path:
|
||||
dir_to_search = openpype_path
|
||||
else:
|
||||
if os.getenv("PYPE_PATH"):
|
||||
if Path(os.getenv("PYPE_PATH")).exists():
|
||||
dir_to_search = Path(os.getenv("PYPE_PATH"))
|
||||
if os.getenv("OPENPYPE_PATH"):
|
||||
if Path(os.getenv("OPENPYPE_PATH")).exists():
|
||||
dir_to_search = Path(os.getenv("OPENPYPE_PATH"))
|
||||
else:
|
||||
try:
|
||||
registry_dir = Path(
|
||||
str(self.registry.get_item("pypePath")))
|
||||
str(self.registry.get_item("openPypePath")))
|
||||
if registry_dir.exists():
|
||||
dir_to_search = registry_dir
|
||||
|
||||
|
|
@ -674,22 +647,22 @@ class BootstrapRepos:
|
|||
# nothing found in registry, we'll use data dir
|
||||
pass
|
||||
|
||||
pype_versions = self.get_pype_versions(dir_to_search, staging)
|
||||
openpype_versions = self.get_openpype_versions(dir_to_search, staging)
|
||||
|
||||
# remove zip file version if needed.
|
||||
if not include_zips:
|
||||
pype_versions = [
|
||||
v for v in pype_versions if v.path.suffix != ".zip"
|
||||
openpype_versions = [
|
||||
v for v in openpype_versions if v.path.suffix != ".zip"
|
||||
]
|
||||
|
||||
return pype_versions
|
||||
return openpype_versions
|
||||
|
||||
def process_entered_location(self, location: str) -> Union[Path, None]:
|
||||
"""Process user entered location string.
|
||||
|
||||
It decides if location string is mongodb url or path.
|
||||
If it is mongodb url, it will connect and load ``PYPE_PATH`` from
|
||||
there and use it as path to Pype. In it is _not_ mongodb url, it
|
||||
If it is mongodb url, it will connect and load ``OPENPYPE_PATH`` from
|
||||
there and use it as path to OpenPype. In it is _not_ mongodb url, it
|
||||
is assumed we have a path, this is tested and zip file is
|
||||
produced and installed using :meth:`create_version_from_live_code`.
|
||||
|
||||
|
|
@ -697,51 +670,52 @@ class BootstrapRepos:
|
|||
location (str): User entered location.
|
||||
|
||||
Returns:
|
||||
Path: to Pype zip produced from this location.
|
||||
Path: to OpenPype zip produced from this location.
|
||||
None: Zipping failed.
|
||||
|
||||
"""
|
||||
pype_path = None
|
||||
# try to get pype path from mongo.
|
||||
openpype_path = None
|
||||
# try to get OpenPype path from mongo.
|
||||
if location.startswith("mongodb"):
|
||||
pype_path = get_pype_path_from_db(location)
|
||||
if not pype_path:
|
||||
self._print("cannot find PYPE_PATH in settings.")
|
||||
pype_path = get_openpype_path_from_db(location)
|
||||
if not openpype_path:
|
||||
self._print("cannot find OPENPYPE_PATH in settings.")
|
||||
return None
|
||||
|
||||
# if not successful, consider location to be fs path.
|
||||
if not pype_path:
|
||||
pype_path = Path(location)
|
||||
if not openpype_path:
|
||||
openpype_path = Path(location)
|
||||
|
||||
# test if this path does exist.
|
||||
if not pype_path.exists():
|
||||
self._print(f"{pype_path} doesn't exists.")
|
||||
if not openpype_path.exists():
|
||||
self._print(f"{openpype_path} doesn't exists.")
|
||||
return None
|
||||
|
||||
# test if entered path isn't user data dir
|
||||
if self.data_dir == pype_path:
|
||||
if self.data_dir == openpype_path:
|
||||
self._print("cannot point to user data dir", LOG_ERROR)
|
||||
return None
|
||||
|
||||
# find pype zip files in location. There can be
|
||||
# either "live" Pype repository, or multiple zip files or even
|
||||
# multiple pype version directories. This process looks into zip
|
||||
# find openpype zip files in location. There can be
|
||||
# either "live" OpenPype repository, or multiple zip files or even
|
||||
# multiple OpenPype version directories. This process looks into zip
|
||||
# files and directories and tries to parse `version.py` file.
|
||||
versions = self.find_pype(pype_path, include_zips=True)
|
||||
versions = self.find_openpype(openpype_path, include_zips=True)
|
||||
if versions:
|
||||
self._print(f"found Pype in [ {pype_path} ]")
|
||||
self._print(f"found OpenPype in [ {openpype_path} ]")
|
||||
self._print(f"latest version found is [ {versions[-1]} ]")
|
||||
|
||||
return self.install_version(versions[-1])
|
||||
|
||||
# if we got here, it means that location is "live" Pype repository.
|
||||
# we'll create zip from it and move it to user data dir.
|
||||
live_pype = self.create_version_from_live_code(pype_path)
|
||||
if not live_pype.path.exists():
|
||||
self._print(f"installing zip {live_pype} failed.", LOG_ERROR)
|
||||
# if we got here, it means that location is "live"
|
||||
# OpenPype repository. We'll create zip from it and move it to user
|
||||
# data dir.
|
||||
live_openpype = self.create_version_from_live_code(openpype_path)
|
||||
if not live_openpype.path.exists():
|
||||
self._print(f"installing zip {live_openpype} failed.", LOG_ERROR)
|
||||
return None
|
||||
# install it
|
||||
return self.install_version(live_pype)
|
||||
return self.install_version(live_openpype)
|
||||
|
||||
def _print(self,
|
||||
message: str,
|
||||
|
|
@ -769,11 +743,11 @@ class BootstrapRepos:
|
|||
return
|
||||
self._log.info(message, exc_info=exc_info)
|
||||
|
||||
def extract_pype(self, version: PypeVersion) -> Union[Path, None]:
|
||||
"""Extract zipped Pype version to user data directory.
|
||||
def extract_openpype(self, version: OpenPypeVersion) -> Union[Path, None]:
|
||||
"""Extract zipped OpenPype version to user data directory.
|
||||
|
||||
Args:
|
||||
version (PypeVersion): Version of Pype.
|
||||
version (OpenPypeVersion): Version of OpenPype.
|
||||
|
||||
Returns:
|
||||
Path: path to extracted version.
|
||||
|
|
@ -819,40 +793,41 @@ class BootstrapRepos:
|
|||
is_inside = path.resolve().relative_to(
|
||||
self.data_dir)
|
||||
except ValueError:
|
||||
# if relative path cannot be calculated, Pype version is not
|
||||
# if relative path cannot be calculated, OpenPype version is not
|
||||
# inside user data dir
|
||||
pass
|
||||
return is_inside
|
||||
|
||||
def install_version(self,
|
||||
pype_version: PypeVersion,
|
||||
openpype_version: OpenPypeVersion,
|
||||
force: bool = False) -> Path:
|
||||
"""Install Pype version to user data directory.
|
||||
"""Install OpenPype version to user data directory.
|
||||
|
||||
Args:
|
||||
pype_version (PypeVersion): Pype version to install.
|
||||
oepnpype_version (OpenPypeVersion): OpenPype version to install.
|
||||
force (bool, optional): Force overwrite existing version.
|
||||
|
||||
Returns:
|
||||
Path: Path to installed Pype.
|
||||
Path: Path to installed OpenPype.
|
||||
|
||||
Raises:
|
||||
PypeVersionExists: If not forced and this version already exist
|
||||
OpenPypeVersionExists: If not forced and this version already exist
|
||||
in user data directory.
|
||||
PypeVersionInvalid: If version to install is invalid.
|
||||
PypeVersionIOError: If copying or zipping fail.
|
||||
OpenPypeVersionInvalid: If version to install is invalid.
|
||||
OpenPypeVersionIOError: If copying or zipping fail.
|
||||
|
||||
"""
|
||||
|
||||
if self.is_inside_user_data(pype_version.path) and not pype_version.path.is_file(): # noqa
|
||||
raise PypeVersionExists("Pype already inside user data dir")
|
||||
if self.is_inside_user_data(openpype_version.path) and not openpype_version.path.is_file(): # noqa
|
||||
raise OpenPypeVersionExists(
|
||||
"OpenPype already inside user data dir")
|
||||
|
||||
# determine destination directory name
|
||||
# for zip file strip suffix, in case of dir use whole dir name
|
||||
if pype_version.path.is_dir():
|
||||
dir_name = pype_version.path.name
|
||||
if openpype_version.path.is_dir():
|
||||
dir_name = openpype_version.path.name
|
||||
else:
|
||||
dir_name = pype_version.path.stem
|
||||
dir_name = openpype_version.path.stem
|
||||
|
||||
destination = self.data_dir / dir_name
|
||||
|
||||
|
|
@ -864,82 +839,82 @@ class BootstrapRepos:
|
|||
self._print(
|
||||
f"cannot remove already existing {destination}",
|
||||
LOG_ERROR, exc_info=True)
|
||||
raise PypeVersionIOError(
|
||||
raise OpenPypeVersionIOError(
|
||||
f"cannot remove existing {destination}") from e
|
||||
elif destination.exists() and not force:
|
||||
raise PypeVersionExists(f"{destination} already exist.")
|
||||
raise OpenPypeVersionExists(f"{destination} already exist.")
|
||||
else:
|
||||
# create destination parent directories even if they don't exist.
|
||||
destination.mkdir(parents=True)
|
||||
|
||||
# version is directory
|
||||
if pype_version.path.is_dir():
|
||||
if openpype_version.path.is_dir():
|
||||
# create zip inside temporary directory.
|
||||
self._print("Creating zip from directory ...")
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
temp_zip = \
|
||||
Path(temp_dir) / f"pype-v{pype_version}.zip"
|
||||
Path(temp_dir) / f"openpype-v{openpype_version}.zip"
|
||||
self._print(f"creating zip: {temp_zip}")
|
||||
|
||||
self._create_pype_zip(temp_zip, pype_version.path)
|
||||
self._create_openpype_zip(temp_zip, openpype_version.path)
|
||||
if not os.path.exists(temp_zip):
|
||||
self._print("make archive failed.", LOG_ERROR)
|
||||
raise PypeVersionIOError("Zip creation failed.")
|
||||
raise OpenPypeVersionIOError("Zip creation failed.")
|
||||
|
||||
# set zip as version source
|
||||
pype_version.path = temp_zip
|
||||
openpype_version.path = temp_zip
|
||||
|
||||
elif pype_version.path.is_file():
|
||||
elif openpype_version.path.is_file():
|
||||
# check if file is zip (by extension)
|
||||
if pype_version.path.suffix.lower() != ".zip":
|
||||
raise PypeVersionInvalid("Invalid file format")
|
||||
if openpype_version.path.suffix.lower() != ".zip":
|
||||
raise OpenPypeVersionInvalid("Invalid file format")
|
||||
|
||||
if not self.is_inside_user_data(pype_version.path):
|
||||
if not self.is_inside_user_data(openpype_version.path):
|
||||
try:
|
||||
# copy file to destination
|
||||
self._print("Copying zip to destination ...")
|
||||
_destination_zip = destination.parent / pype_version.path.name
|
||||
_destination_zip = destination.parent / openpype_version.path.name # noqa: E501
|
||||
copyfile(
|
||||
pype_version.path.as_posix(),
|
||||
openpype_version.path.as_posix(),
|
||||
_destination_zip.as_posix())
|
||||
except OSError as e:
|
||||
self._print(
|
||||
"cannot copy version to user data directory", LOG_ERROR,
|
||||
exc_info=True)
|
||||
raise PypeVersionIOError((
|
||||
f"can't copy version {pype_version.path.as_posix()} "
|
||||
raise OpenPypeVersionIOError((
|
||||
f"can't copy version {openpype_version.path.as_posix()} "
|
||||
f"to destination {destination.parent.as_posix()}")) from e
|
||||
|
||||
# extract zip there
|
||||
self._print("extracting zip to destination ...")
|
||||
with ZipFile(pype_version.path, "r") as zip_ref:
|
||||
with ZipFile(openpype_version.path, "r") as zip_ref:
|
||||
zip_ref.extractall(destination)
|
||||
|
||||
return destination
|
||||
|
||||
def _is_pype_in_dir(self,
|
||||
dir_item: Path,
|
||||
detected_version: PypeVersion) -> bool:
|
||||
"""Test if path item is Pype version matching detected version.
|
||||
def _is_openpype_in_dir(self,
|
||||
dir_item: Path,
|
||||
detected_version: OpenPypeVersion) -> bool:
|
||||
"""Test if path item is OpenPype version matching detected version.
|
||||
|
||||
If item is directory that might (based on it's name)
|
||||
contain Pype version, check if it really does contain
|
||||
Pype and that their versions matches.
|
||||
contain OpenPype version, check if it really does contain
|
||||
OpenPype and that their versions matches.
|
||||
|
||||
Args:
|
||||
dir_item (Path): Directory to test.
|
||||
detected_version (PypeVersion): Pype version detected from name.
|
||||
detected_version (OpenPypeVersion): OpenPype version detected
|
||||
from name.
|
||||
|
||||
Returns:
|
||||
True if it is valid Pype version, False otherwise.
|
||||
True if it is valid OpenPype version, False otherwise.
|
||||
|
||||
"""
|
||||
try:
|
||||
# add one 'pype' level as inside dir there should
|
||||
# add one 'openpype' level as inside dir there should
|
||||
# be many other repositories.
|
||||
version_str = BootstrapRepos.get_version(
|
||||
dir_item / "pype")
|
||||
version_check = PypeVersion(version=version_str)
|
||||
version_str = BootstrapRepos.get_version(dir_item)
|
||||
version_check = OpenPypeVersion(version=version_str)
|
||||
except ValueError:
|
||||
self._print(
|
||||
f"cannot determine version from {dir_item}", True)
|
||||
|
|
@ -955,21 +930,21 @@ class BootstrapRepos:
|
|||
return False
|
||||
return True
|
||||
|
||||
def _is_pype_in_zip(self,
|
||||
zip_item: Path,
|
||||
detected_version: PypeVersion) -> bool:
|
||||
"""Test if zip path is Pype version matching detected version.
|
||||
def _is_openpype_in_zip(self,
|
||||
zip_item: Path,
|
||||
detected_version: OpenPypeVersion) -> bool:
|
||||
"""Test if zip path is OpenPype version matching detected version.
|
||||
|
||||
Open zip file, look inside and parse version from Pype
|
||||
Open zip file, look inside and parse version from OpenPype
|
||||
inside it. If there is none, or it is different from
|
||||
version specified in file name, skip it.
|
||||
|
||||
Args:
|
||||
zip_item (Path): Zip file to test.
|
||||
detected_version (PypeVersion): Pype version detected from name.
|
||||
detected_version (OpenPypeVersion): Pype version detected from name.
|
||||
|
||||
Returns:
|
||||
True if it is valid Pype version, False otherwise.
|
||||
True if it is valid OpenPype version, False otherwise.
|
||||
|
||||
"""
|
||||
# skip non-zip files
|
||||
|
|
@ -979,10 +954,10 @@ class BootstrapRepos:
|
|||
try:
|
||||
with ZipFile(zip_item, "r") as zip_file:
|
||||
with zip_file.open(
|
||||
"pype/pype/version.py") as version_file:
|
||||
"openpype/version.py") as version_file:
|
||||
zip_version = {}
|
||||
exec(version_file.read(), zip_version)
|
||||
version_check = PypeVersion(
|
||||
version_check = OpenPypeVersion(
|
||||
version=zip_version["__version__"])
|
||||
|
||||
version_main = version_check.get_main_version() # noqa: E501
|
||||
|
|
@ -999,70 +974,72 @@ class BootstrapRepos:
|
|||
self._print(f"{zip_item} is not a zip file", True)
|
||||
return False
|
||||
except KeyError:
|
||||
self._print("Zip does not contain Pype", True)
|
||||
self._print("Zip does not contain OpenPype", True)
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_pype_versions(self, pype_dir: Path, staging: bool = False) -> list:
|
||||
"""Get all detected Pype versions in directory.
|
||||
def get_openpype_versions(self,
|
||||
openpype_dir: Path,
|
||||
staging: bool = False) -> list:
|
||||
"""Get all detected OpenPype versions in directory.
|
||||
|
||||
Args:
|
||||
pype_dir (Path): Directory to scan.
|
||||
openpype_dir (Path): Directory to scan.
|
||||
staging (bool, optional): Find staging versions if True.
|
||||
|
||||
Returns:
|
||||
list of PypeVersion
|
||||
list of OpenPypeVersion
|
||||
|
||||
Throws:
|
||||
ValueError: if invalid path is specified.
|
||||
|
||||
"""
|
||||
if not pype_dir.exists() and not pype_dir.is_dir():
|
||||
if not openpype_dir.exists() and not openpype_dir.is_dir():
|
||||
raise ValueError("specified directory is invalid")
|
||||
|
||||
_pype_versions = []
|
||||
_openpype_versions = []
|
||||
# iterate over directory in first level and find all that might
|
||||
# contain Pype.
|
||||
for item in pype_dir.iterdir():
|
||||
# contain OpenPype.
|
||||
for item in openpype_dir.iterdir():
|
||||
|
||||
# if file, strip extension, in case of dir not.
|
||||
name = item.name if item.is_dir() else item.stem
|
||||
result = PypeVersion.version_in_str(name)
|
||||
result = OpenPypeVersion.version_in_str(name)
|
||||
|
||||
if result[0]:
|
||||
detected_version: PypeVersion
|
||||
detected_version: OpenPypeVersion
|
||||
detected_version = result[1]
|
||||
|
||||
if item.is_dir() and not self._is_pype_in_dir(
|
||||
if item.is_dir() and not self._is_openpype_in_dir(
|
||||
item, detected_version
|
||||
):
|
||||
continue
|
||||
|
||||
if item.is_file() and not self._is_pype_in_zip(
|
||||
if item.is_file() and not self._is_openpype_in_zip(
|
||||
item, detected_version
|
||||
):
|
||||
continue
|
||||
|
||||
detected_version.path = item
|
||||
if staging and detected_version.is_staging():
|
||||
_pype_versions.append(detected_version)
|
||||
_openpype_versions.append(detected_version)
|
||||
|
||||
if not staging and not detected_version.is_staging():
|
||||
_pype_versions.append(detected_version)
|
||||
_openpype_versions.append(detected_version)
|
||||
|
||||
return sorted(_pype_versions)
|
||||
return sorted(_openpype_versions)
|
||||
|
||||
|
||||
class PypeVersionExists(Exception):
|
||||
"""Exception for handling existing Pype version."""
|
||||
class OpenPypeVersionExists(Exception):
|
||||
"""Exception for handling existing OpenPype version."""
|
||||
pass
|
||||
|
||||
|
||||
class PypeVersionInvalid(Exception):
|
||||
"""Exception for handling invalid Pype version."""
|
||||
class OpenPypeVersionInvalid(Exception):
|
||||
"""Exception for handling invalid OpenPype version."""
|
||||
pass
|
||||
|
||||
|
||||
class PypeVersionIOError(Exception):
|
||||
"""Exception for handling IO errors in Pype version."""
|
||||
class OpenPypeVersionIOError(Exception):
|
||||
"""Exception for handling IO errors in OpenPype version."""
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ from .install_thread import InstallThread, InstallResult
|
|||
from .tools import (
|
||||
validate_path_string,
|
||||
validate_mongo_connection,
|
||||
get_pype_path_from_db
|
||||
get_openpype_path_from_db
|
||||
)
|
||||
from .user_settings import PypeSettingsRegistry
|
||||
from .user_settings import OpenPypeSettingsRegistry
|
||||
from .version import __version__
|
||||
|
||||
|
||||
|
|
@ -42,17 +42,21 @@ class InstallDialog(QtWidgets.QDialog):
|
|||
|
||||
def __init__(self, parent=None):
|
||||
super(InstallDialog, self).__init__(parent)
|
||||
self.registry = PypeSettingsRegistry()
|
||||
self.registry = OpenPypeSettingsRegistry()
|
||||
|
||||
self.mongo_url = ""
|
||||
try:
|
||||
self.mongo_url = os.getenv("PYPE_MONGO", "") or self.registry.get_secure_item("pypeMongo") # noqa: E501
|
||||
self.mongo_url = (
|
||||
os.getenv("OPENPYPE_MONGO", "")
|
||||
or self.registry.get_secure_item("openPypeMongo")
|
||||
)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
self.setWindowTitle(f"Pype Igniter {__version__} - Pype installation")
|
||||
self.setWindowTitle(
|
||||
f"OpenPype Igniter {__version__} - OpenPype installation")
|
||||
self._icon_path = os.path.join(
|
||||
os.path.dirname(__file__), 'pype_icon.png')
|
||||
os.path.dirname(__file__), 'openpype_icon.png')
|
||||
icon = QtGui.QIcon(self._icon_path)
|
||||
self.setWindowIcon(icon)
|
||||
self.setWindowFlags(
|
||||
|
|
@ -81,7 +85,7 @@ class InstallDialog(QtWidgets.QDialog):
|
|||
os.path.join(
|
||||
os.path.dirname(__file__), 'RobotoMono-Regular.ttf')
|
||||
)
|
||||
self._pype_run_ready = False
|
||||
self._openpype_run_ready = False
|
||||
|
||||
self._init_ui()
|
||||
|
||||
|
|
@ -97,35 +101,35 @@ class InstallDialog(QtWidgets.QDialog):
|
|||
# Main info
|
||||
# --------------------------------------------------------------------
|
||||
self.main_label = QtWidgets.QLabel(
|
||||
"""Welcome to <b>Pype</b>
|
||||
"""Welcome to <b>OpenPype</b>
|
||||
<p>
|
||||
We've detected <b>Pype</b> is not configured yet. But don't worry,
|
||||
We've detected <b>OpenPype</b> is not configured yet. But don't worry,
|
||||
this is as easy as setting one or two things.
|
||||
<p>
|
||||
""")
|
||||
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 <b>Path to studio location</b> where Pype versions
|
||||
self.openpype_path_label = QtWidgets.QLabel(
|
||||
"""This is <b>Path to studio location</b> where OpenPype versions
|
||||
are stored. It will be pre-filled if your MongoDB connection is
|
||||
already set and your studio defined this location.
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
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".
|
||||
</p>
|
||||
"""
|
||||
)
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
BIN
igniter/openpype.ico
Normal file
BIN
igniter/openpype.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 124 KiB |
BIN
igniter/openpype_icon.png
Normal file
BIN
igniter/openpype_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
igniter/pype.ico
BIN
igniter/pype.ico
Binary file not shown.
|
Before Width: | Height: | Size: 107 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
|
|
@ -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)
|
||||
|
|
|
|||
102
igniter/tools.py
102
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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Definition of Igniter version."""
|
||||
|
||||
__version__ = "1.0.0"
|
||||
__version__ = "1.0.0-beta"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
]
|
||||
|
|
@ -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:
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from pype.lib import PreLaunchHook
|
||||
from openpype.lib import PreLaunchHook
|
||||
|
||||
|
||||
class AddLastWorkfileToLaunchArgs(PreLaunchHook):
|
||||
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from pype.lib import PreLaunchHook
|
||||
from openpype.lib import PreLaunchHook
|
||||
|
||||
|
||||
class LaunchWithWindowsShell(PreLaunchHook):
|
||||
|
|
@ -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")
|
||||
|
|
@ -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()
|
||||
|
|
@ -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()
|
||||
|
||||
|
|
@ -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"],
|
||||
|
|
@ -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"])
|
||||
|
|
@ -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))
|
||||
|
|
@ -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()
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
@ -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")
|
||||
|
|
@ -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):
|
||||
|
|
@ -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"]
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
import subprocess
|
||||
from pype.lib import PreLaunchHook
|
||||
from openpype.lib import PreLaunchHook
|
||||
|
||||
|
||||
class InstallPySideToBlender(PreLaunchHook):
|
||||
|
|
@ -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')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
|
@ -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"
|
||||
|
|
@ -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"
|
||||
|
|
@ -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"
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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:
|
||||
3
openpype/hosts/blender/startup/init.py
Normal file
3
openpype/hosts/blender/startup/init.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from openpype.hosts.blender import api
|
||||
|
||||
api.install()
|
||||
|
|
@ -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}")
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -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):
|
||||
|
|
@ -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))
|
||||
|
||||
|
|
@ -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",
|
||||
]
|
||||
|
|
@ -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)
|
||||
|
|
@ -20,7 +20,7 @@ QPushButton:hover {
|
|||
color: #e64b3d;
|
||||
}
|
||||
|
||||
#PypeMenu {
|
||||
#OpenPypeMenu {
|
||||
border: 1px solid #fef9ef;
|
||||
}
|
||||
|
||||
|
|
@ -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")
|
||||
|
|
@ -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"
|
||||
)]
|
||||
|
||||
|
|
@ -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):
|
||||
|
|
@ -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"
|
||||
|
|
@ -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", {})
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue