This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3717 from pypeclub/feature/OP-3775_Hiero-as-module
Hiero: Define hiero as module
- Loading branch information
Showing
56 changed files
with
17,255 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,10 @@ | ||
import os | ||
import platform | ||
from .module import ( | ||
HIERO_ROOT_DIR, | ||
HieroModule, | ||
) | ||
|
||
|
||
def add_implementation_envs(env, _app): | ||
# Add requirements to HIERO_PLUGIN_PATH | ||
pype_root = os.environ["OPENPYPE_REPOS_ROOT"] | ||
new_hiero_paths = [ | ||
os.path.join(pype_root, "openpype", "hosts", "hiero", "api", "startup") | ||
] | ||
old_hiero_path = env.get("HIERO_PLUGIN_PATH") or "" | ||
for path in old_hiero_path.split(os.pathsep): | ||
if not path: | ||
continue | ||
|
||
norm_path = os.path.normpath(path) | ||
if norm_path not in new_hiero_paths: | ||
new_hiero_paths.append(norm_path) | ||
|
||
env["HIERO_PLUGIN_PATH"] = os.pathsep.join(new_hiero_paths) | ||
env.pop("QT_AUTO_SCREEN_SCALE_FACTOR", None) | ||
|
||
# Try to add QuickTime to PATH | ||
quick_time_path = "C:/Program Files (x86)/QuickTime/QTSystem" | ||
if platform.system() == "windows" and os.path.exists(quick_time_path): | ||
path_value = env.get("PATH") or "" | ||
path_paths = [ | ||
path | ||
for path in path_value.split(os.pathsep) | ||
if path | ||
] | ||
path_paths.append(quick_time_path) | ||
env["PATH"] = os.pathsep.join(path_paths) | ||
|
||
# Set default values if are not already set via settings | ||
defaults = { | ||
"LOGLEVEL": "DEBUG" | ||
} | ||
for key, value in defaults.items(): | ||
if not env.get(key): | ||
env[key] = value | ||
__all__ = ( | ||
"HIERO_ROOT_DIR", | ||
"HieroModule", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import os | ||
import platform | ||
from openpype.modules import OpenPypeModule | ||
from openpype.modules.interfaces import IHostModule | ||
|
||
HIERO_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
class HieroModule(OpenPypeModule, IHostModule): | ||
name = "hiero" | ||
host_name = "hiero" | ||
|
||
def initialize(self, module_settings): | ||
self.enabled = True | ||
|
||
def add_implementation_envs(self, env, _app): | ||
# Add requirements to HIERO_PLUGIN_PATH | ||
new_hiero_paths = [ | ||
os.path.join(HIERO_ROOT_DIR, "api", "startup") | ||
] | ||
old_hiero_path = env.get("HIERO_PLUGIN_PATH") or "" | ||
for path in old_hiero_path.split(os.pathsep): | ||
if not path: | ||
continue | ||
|
||
norm_path = os.path.normpath(path) | ||
if norm_path not in new_hiero_paths: | ||
new_hiero_paths.append(norm_path) | ||
|
||
env["HIERO_PLUGIN_PATH"] = os.pathsep.join(new_hiero_paths) | ||
env.pop("QT_AUTO_SCREEN_SCALE_FACTOR", None) | ||
|
||
# Add vendor to PYTHONPATH | ||
python_path = env["PYTHONPATH"] | ||
python_path_parts = [] | ||
if python_path: | ||
python_path_parts = python_path.split(os.pathsep) | ||
vendor_path = os.path.join(HIERO_ROOT_DIR, "vendor") | ||
python_path_parts.insert(0, vendor_path) | ||
env["PYTHONPATH"] = os.pathsep.join(python_path_parts) | ||
|
||
# Set default values if are not already set via settings | ||
defaults = { | ||
"LOGLEVEL": "DEBUG" | ||
} | ||
for key, value in defaults.items(): | ||
if not env.get(key): | ||
env[key] = value | ||
|
||
# Try to add QuickTime to PATH | ||
quick_time_path = "C:/Program Files (x86)/QuickTime/QTSystem" | ||
if platform.system() == "windows" and os.path.exists(quick_time_path): | ||
path_value = env.get("PATH") or "" | ||
path_paths = [ | ||
path | ||
for path in path_value.split(os.pathsep) | ||
if path | ||
] | ||
path_paths.append(quick_time_path) | ||
env["PATH"] = os.pathsep.join(path_paths) | ||
|
||
def get_workfile_extensions(self): | ||
return [".hrox"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Protocol Buffers - Google's data interchange format | ||
# Copyright 2008 Google Inc. All rights reserved. | ||
# https://developers.google.com/protocol-buffers/ | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are | ||
# met: | ||
# | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above | ||
# copyright notice, this list of conditions and the following disclaimer | ||
# in the documentation and/or other materials provided with the | ||
# distribution. | ||
# * Neither the name of Google Inc. nor the names of its | ||
# contributors may be used to endorse or promote products derived from | ||
# this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
# Copyright 2007 Google Inc. All Rights Reserved. | ||
|
||
__version__ = '3.20.1' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
35 changes: 35 additions & 0 deletions
35
openpype/hosts/hiero/vendor/google/protobuf/compiler/plugin_pb2.py
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.