Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

update 2.x with develop #344

Merged
merged 31 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
03daa23
movedmoved app icons to ~/pype/resources
iLLiCiTiT Jun 24, 2020
7eb36b4
moved ftrack resource files to ~/pype/resources
iLLiCiTiT Jun 24, 2020
5a2ae24
rest api statics path changed to ~/pype/resources
iLLiCiTiT Jun 24, 2020
880c91b
modified ftrack message file getting
iLLiCiTiT Jun 24, 2020
a72c9a0
added resources to pype.api
iLLiCiTiT Jun 24, 2020
42dce83
fixing vray rendering on deadline
antirotor Jun 25, 2020
5e7ce98
fix(celaction): adding hosts into imports
jakubjezek001 Jun 26, 2020
18742dc
fix(celaction): resolution assigning from missing asset attr problem
jakubjezek001 Jun 26, 2020
84f1907
fix(global): removing obsolete "PYPE_PYTHON_EXE"
jakubjezek001 Jun 26, 2020
6b3f950
fix(celaciton): adding missing ftrack envs
jakubjezek001 Jun 26, 2020
546eb1e
tray can set attributes for modules
iLLiCiTiT Jun 26, 2020
2afe643
rest api and timers manager got CLASS_DEFINITION variable in module d…
iLLiCiTiT Jun 26, 2020
79542b6
rest api and timers manager does not load presets but are based on cl…
iLLiCiTiT Jun 26, 2020
f4971c0
removed unused import
iLLiCiTiT Jun 26, 2020
258d76c
loader plugin for DJV has hardcoded extensions and path to DJV is tak…
iLLiCiTiT Jun 26, 2020
cf171b0
ftrack djv action has hardocoded extensions and find path to djv from…
iLLiCiTiT Jun 26, 2020
d1c369b
Merge pull request #306 from pypeclub/feature/move_module_imports_to_…
mkolar Jul 8, 2020
d114325
Merge pull request #312 from pypeclub/feature/static_files_to_resources
mkolar Jul 8, 2020
f495910
Merge branch 'develop' into feature/module_attributes_in_tray_menu
mkolar Jul 8, 2020
5341151
Merge branch 'hotfix/celaction-premiere-workflow-glithes'
mkolar Jul 8, 2020
ebbe3fd
Merge pull request #316 from pypeclub/hotfix/vray-rendering
mkolar Jul 8, 2020
323b8b2
Merge pull request #323 from pypeclub/feature/djv_without_presets
mkolar Jul 8, 2020
62ff1b2
Merge pull request #328 from simonebarbieri/feature/blender-namespace…
mkolar Jul 8, 2020
51bb034
Merge pull request #321 from pypeclub/feature/module_attributes_in_tr…
mkolar Jul 8, 2020
53a69ff
Merge branch 'hotfix/allow_not_set_template_names'
mkolar Jul 8, 2020
9dda57a
Merge branch 'hotfix/allow_not_set_template_names' into develop
mkolar Jul 8, 2020
6f5a018
Merge remote-tracking branch 'origin/master'
mkolar Jul 8, 2020
7e07bf2
Merge branch '2.x/develop' into develop
iLLiCiTiT Jul 8, 2020
0317c44
for output length is not used -frames argument but -t because of audi…
iLLiCiTiT Jul 9, 2020
fc5a416
Merge branch 'hotfix/frames_in_extract_review' into develop
mkolar Jul 9, 2020
aa97c54
Merge branch '2.x/develop' into develop
iLLiCiTiT Jul 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pype/hosts/celaction/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from pype.api import Logger
import pype
import pype.celaction
from pype.hosts import celaction

log = Logger().get_logger("Celaction_cli_publisher")

Expand Down Expand Up @@ -49,7 +49,7 @@ def cli():
# parser.add_argument("--programDir",
# help=("Directory with celaction program installation"))

pype.celaction.kwargs = parser.parse_args(sys.argv[1:]).__dict__
celaction.kwargs = parser.parse_args(sys.argv[1:]).__dict__


def _prepare_publish_environments():
Expand Down
9 changes: 9 additions & 0 deletions pype/hosts/maya/expected_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,15 @@ def get_renderer_prefix(self):
prefix = "{}_<aov>".format(prefix)
return prefix

def _get_layer_data(self):
"""Override to get vray specific extension."""
layer_data = super(ExpectedFilesVray, self)._get_layer_data()
default_ext = cmds.getAttr("vraySettings.imageFormatStr")
if default_ext == "exr (multichannel)" or default_ext == "exr (deep)":
default_ext = "exr"
layer_data["defaultExt"] = default_ext
return layer_data

def get_files(self):
"""Get expected files.

Expand Down
2 changes: 1 addition & 1 deletion pype/modules/adobe_communicator/lib/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main(env):
# Register Host (and it's pyblish plugins)
host_name = env["AVALON_APP"]
# TODO not sure if use "pype." or "avalon." for host import
host_import_str = f"pype.{host_name}"
host_import_str = f"pype.hosts.{host_name}"

try:
host_module = importlib.import_module(host_import_str)
Expand Down
71 changes: 11 additions & 60 deletions pype/modules/ftrack/actions/action_djvview.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import os
import sys
import logging
import subprocess
from operator import itemgetter
import ftrack_api
from pype.modules.ftrack.lib import BaseAction, statics_icon
from pype.api import Logger, config

log = Logger().get_logger(__name__)


class DJVViewAction(BaseAction):
Expand All @@ -19,20 +13,18 @@ class DJVViewAction(BaseAction):

type = 'Application'

allowed_types = [
"cin", "dpx", "avi", "dv", "gif", "flv", "mkv", "mov", "mpg", "mpeg",
"mp4", "m4v", "mxf", "iff", "z", "ifl", "jpeg", "jpg", "jfif", "lut",
"1dl", "exr", "pic", "png", "ppm", "pnm", "pgm", "pbm", "rla", "rpf",
"sgi", "rgba", "rgb", "bw", "tga", "tiff", "tif", "img"
]

def __init__(self, session, plugins_presets):
'''Expects a ftrack_api.Session instance'''
super().__init__(session, plugins_presets)
self.djv_path = None

self.config_data = config.get_presets()['djv_view']['config']
self.set_djv_path()

if self.djv_path is None:
return

self.allowed_types = self.config_data.get(
'file_ext', ["img", "mov", "exr"]
)
self.djv_path = self.find_djv_path()

def preregister(self):
if self.djv_path is None:
Expand All @@ -53,11 +45,10 @@ def discover(self, session, entities, event):
return True
return False

def set_djv_path(self):
for path in self.config_data.get("djv_paths", []):
def find_djv_path(self):
for path in (os.environ.get("DJV_PATH") or "").split(os.pathsep):
if os.path.exists(path):
self.djv_path = path
break
return path

def interface(self, session, entities, event):
if event['data'].get('values', {}):
Expand Down Expand Up @@ -221,43 +212,3 @@ def register(session, plugins_presets={}):
"""Register hooks."""

DJVViewAction(session, plugins_presets).register()


def main(arguments=None):
'''Set up logging and register action.'''
if arguments is None:
arguments = []

import argparse
parser = argparse.ArgumentParser()
# Allow setting of logging level from arguments.
loggingLevels = {}
for level in (
logging.NOTSET, logging.DEBUG, logging.INFO, logging.WARNING,
logging.ERROR, logging.CRITICAL
):
loggingLevels[logging.getLevelName(level).lower()] = level

parser.add_argument(
'-v', '--verbosity',
help='Set the logging output verbosity.',
choices=loggingLevels.keys(),
default='info'
)
namespace = parser.parse_args(arguments)

# Set up basic logging
logging.basicConfig(level=loggingLevels[namespace.verbosity])

session = ftrack_api.Session()
register(session)

# Wait for events
logging.info(
'Registered actions and listening for events. Use Ctrl-C to abort.'
)
session.event_hub.wait()


if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))
33 changes: 15 additions & 18 deletions pype/modules/ftrack/tray/login_tools.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib import parse
import os
import webbrowser
import functools
import pype
import inspect
from Qt import QtCore
from pype.api import resources


class LoginServerHandler(BaseHTTPRequestHandler):
'''Login server handler.'''

message_filepath = resources.get_resource("ftrack", "sign_in_message.html")

def __init__(self, login_callback, *args, **kw):
'''Initialise handler.'''
self.login_callback = login_callback
Expand All @@ -28,23 +28,21 @@ def do_GET(self):
login_credentials = parse.parse_qs(query)
api_user = login_credentials['api_user'][0]
api_key = login_credentials['api_key'][0]
# get path to resources
path_items = os.path.dirname(
inspect.getfile(pype)
).split(os.path.sep)
del path_items[-1]
path_items.extend(['res', 'ftrack', 'sign_in_message.html'])
message_filepath = os.path.sep.join(path_items)
message_file = open(message_filepath, 'r')
sign_in_message = message_file.read()
message_file.close()

with open(self.message_filepath, "r") as message_file:
sign_in_message = message_file.read()

# formatting html code for python
replacement = [('{', '{{'), ('}', '}}'), ('{{}}', '{}')]
for r in (replacement):
sign_in_message = sign_in_message.replace(*r)
replacements = (
("{", "{{"),
("}", "}}"),
("{{}}", "{}")
)
for replacement in (replacements):
sign_in_message = sign_in_message.replace(*replacement)
message = sign_in_message.format(api_user)
else:
message = '<h1>Failed to sign in</h1>'
message = "<h1>Failed to sign in</h1>"

self.send_response(200)
self.end_headers()
Expand Down Expand Up @@ -74,7 +72,6 @@ def _handle_login(self, api_user, api_key):

def run(self):
'''Listen for events.'''
# self._server = BaseHTTPServer.HTTPServer(
self._server = HTTPServer(
('localhost', 0),
functools.partial(
Expand Down
2 changes: 2 additions & 0 deletions pype/modules/rest_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from .base_class import RestApi, abort, route, register_statics
from .lib import RestMethods, CallbackResult

CLASS_DEFINIION = RestApiServer


def tray_init(tray_widget, main_widget):
return RestApiServer()
24 changes: 11 additions & 13 deletions pype/modules/rest_api/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from http.server import HTTPServer
from .lib import RestApiFactory, Handler
from .base_class import route, register_statics
from pype.api import config, Logger
from pype.api import Logger

log = Logger().get_logger("RestApiServer")

Expand Down Expand Up @@ -85,24 +85,22 @@ def get_projects(request_info):
Callback may return many types. For more information read docstring of
`_handle_callback_result` defined in handler.
"""
default_port = 8011
exclude_ports = []

def __init__(self):
self.qaction = None
self.failed_icon = None
self._is_running = False

try:
self.presets = config.get_presets()["services"]["rest_api"]
except Exception:
self.presets = {"default_port": 8011, "exclude_ports": []}
log.debug((
"There are not set presets for RestApiModule."
" Using defaults \"{}\""
).format(str(self.presets)))

port = self.find_port()
self.rest_api_thread = RestApiThread(self, port)

statics_dir = os.path.sep.join([os.environ["PYPE_MODULE_ROOT"], "res"])
statics_dir = os.path.join(
os.environ["PYPE_MODULE_ROOT"],
"pype",
"resources"
)
self.register_statics("/res", statics_dir)
os.environ["PYPE_STATICS_SERVER"] = "{}/res".format(
os.environ["PYPE_REST_API_URL"]
Expand All @@ -126,8 +124,8 @@ def register_obj(self, obj):
RestApiFactory.register_obj(obj)

def find_port(self):
start_port = self.presets["default_port"]
exclude_ports = self.presets["exclude_ports"]
start_port = self.default_port
exclude_ports = self.exclude_ports
found_port = None
# port check takes time so it's lowered to 100 ports
for port in range(start_port, start_port+100):
Expand Down
2 changes: 2 additions & 0 deletions pype/modules/timers_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .timers_manager import TimersManager
from .widget_user_idle import WidgetUserIdle

CLASS_DEFINIION = TimersManager


def tray_init(tray_widget, main_widget):
return TimersManager(tray_widget, main_widget)
27 changes: 14 additions & 13 deletions pype/modules/timers_manager/timers_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ class TimersManager(metaclass=Singleton):
If IdleManager is imported then is able to handle about stop timers
when user idles for a long time (set in presets).
"""
modules = []
is_running = False
last_task = None

# Presetable attributes
# - when timer will stop if idle manager is running (minutes)
full_time = 15
# - how many minutes before the timer is stopped will popup the message
message_time = 0.5

def __init__(self, tray_widget, main_widget):
self.log = Logger().get_logger(self.__class__.__name__)

self.modules = []
self.is_running = False
self.last_task = None

self.tray_widget = tray_widget
self.main_widget = main_widget

Expand All @@ -37,20 +45,13 @@ def __init__(self, tray_widget, main_widget):

def set_signal_times(self):
try:
timer_info = (
config.get_presets()
.get('services')
.get('timers_manager')
.get('timer')
)
full_time = int(float(timer_info['full_time'])*60)
message_time = int(float(timer_info['message_time'])*60)
full_time = int(self.full_time * 60)
message_time = int(self.message_time * 60)
self.time_show_message = full_time - message_time
self.time_stop_timer = full_time
return True
except Exception:
self.log.warning('Was not able to load presets for TimersManager')
return False
self.log.error("Couldn't set timer signals.", exc_info=True)

def add_module(self, module):
""" Adds module to context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pyblish.api
import pype.celaction
from pype.hosts import celaction


class CollectCelactionCliKwargs(pyblish.api.Collector):
Expand All @@ -9,7 +9,7 @@ class CollectCelactionCliKwargs(pyblish.api.Collector):
order = pyblish.api.Collector.order - 0.1

def process(self, context):
kwargs = pype.celaction.kwargs.copy()
kwargs = celaction.kwargs.copy()

self.log.info("Storing kwargs: %s" % kwargs)
context.set_data("kwargs", kwargs)
Expand Down
9 changes: 7 additions & 2 deletions pype/plugins/celaction/publish/collect_celaction_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def process(self, context):
scene_file = os.path.basename(current_file)
version = context.data["version"]
asset_entity = context.data["assetEntity"]
project_entity = context.data["projectEntity"]

shared_instance_data = {
"asset": asset_entity["name"],
Expand All @@ -24,8 +25,12 @@ def process(self, context):
"handleStart": asset_entity["data"]["handleStart"],
"handleEnd": asset_entity["data"]["handleEnd"],
"fps": asset_entity["data"]["fps"],
"resolutionWidth": asset_entity["data"]["resolutionWidth"],
"resolutionHeight": asset_entity["data"]["resolutionHeight"],
"resolutionWidth": asset_entity["data"].get(
"resolutionWidth",
project_entity["data"]["resolutionWidth"]),
"resolutionHeight": asset_entity["data"].get(
"resolutionHeight",
project_entity["data"]["resolutionHeight"]),
"pixelAspect": 1,
"step": 1,
"version": version
Expand Down
Loading