Merge branch 'develop' of github.com:pypeclub/OpenPype into PYPE-1901_RD-publishing-psd-with-studio-postprocessing

This commit is contained in:
Petr Kalis 2021-10-12 16:51:50 +02:00
commit ef4399a57b
10 changed files with 94 additions and 31 deletions

View file

@ -1,9 +1,13 @@
# Changelog
## [3.5.0-nightly.4](https://github.com/pypeclub/OpenPype/tree/HEAD)
## [3.5.0-nightly.5](https://github.com/pypeclub/OpenPype/tree/HEAD)
[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.4.1...HEAD)
**Deprecated:**
- Maya: Change mayaAscii family to mayaScene [\#2106](https://github.com/pypeclub/OpenPype/pull/2106)
**🆕 New features**
- Added running configurable disk mapping command before start of OP [\#2091](https://github.com/pypeclub/OpenPype/pull/2091)
@ -13,6 +17,7 @@
**🚀 Enhancements**
- Settings UI: Project model refreshing and sorting [\#2104](https://github.com/pypeclub/OpenPype/pull/2104)
- Create Read From Rendered - Disable Relative paths by default [\#2093](https://github.com/pypeclub/OpenPype/pull/2093)
- Added choosing different dirmap mapping if workfile synched locally [\#2088](https://github.com/pypeclub/OpenPype/pull/2088)
- General: Remove IdleManager module [\#2084](https://github.com/pypeclub/OpenPype/pull/2084)
- Tray UI: Message box about missing settings defaults [\#2080](https://github.com/pypeclub/OpenPype/pull/2080)
@ -27,6 +32,7 @@
**🐛 Bug fixes**
- Add startup script for Houdini Core. [\#2110](https://github.com/pypeclub/OpenPype/pull/2110)
- TVPaint: Behavior name of loop also accept repeat [\#2109](https://github.com/pypeclub/OpenPype/pull/2109)
- Ftrack: Project settings save custom attributes skip unknown attributes [\#2103](https://github.com/pypeclub/OpenPype/pull/2103)
- Fix broken import in sftp provider [\#2100](https://github.com/pypeclub/OpenPype/pull/2100)
@ -35,11 +41,14 @@
- TVPaint: Creator use context from workfile [\#2087](https://github.com/pypeclub/OpenPype/pull/2087)
- Blender: fix texture missing when publishing blend files [\#2085](https://github.com/pypeclub/OpenPype/pull/2085)
- General: Startup validations oiio tool path fix on linux [\#2083](https://github.com/pypeclub/OpenPype/pull/2083)
- Deadline: Collect deadline server does not check existence of deadline key [\#2082](https://github.com/pypeclub/OpenPype/pull/2082)
- Blender: fixed Curves with modifiers in Rigs [\#2081](https://github.com/pypeclub/OpenPype/pull/2081)
- Maya: Fix multi-camera renders [\#2065](https://github.com/pypeclub/OpenPype/pull/2065)
- Fix Sync Queue when project disabled [\#2063](https://github.com/pypeclub/OpenPype/pull/2063)
**Merged pull requests:**
- Blender: Fix NoneType error when animation\_data is missing for a rig [\#2101](https://github.com/pypeclub/OpenPype/pull/2101)
- Delivery Action Files Sequence fix [\#2096](https://github.com/pypeclub/OpenPype/pull/2096)
- Bump pywin32 from 300 to 301 [\#2086](https://github.com/pypeclub/OpenPype/pull/2086)
- Nuke UI scaling [\#2077](https://github.com/pypeclub/OpenPype/pull/2077)
@ -60,7 +69,6 @@
- Settings UI: Deffered set value on entity [\#2044](https://github.com/pypeclub/OpenPype/pull/2044)
- Loader: Families filtering [\#2043](https://github.com/pypeclub/OpenPype/pull/2043)
- Settings UI: Project view enhancements [\#2042](https://github.com/pypeclub/OpenPype/pull/2042)
- Added possibility to configure of synchronization of workfile version… [\#2041](https://github.com/pypeclub/OpenPype/pull/2041)
- Settings for Nuke IncrementScriptVersion [\#2039](https://github.com/pypeclub/OpenPype/pull/2039)
- Loader & Library loader: Use tools from OpenPype [\#2038](https://github.com/pypeclub/OpenPype/pull/2038)
- Adding predefined project folders creation in PM [\#2030](https://github.com/pypeclub/OpenPype/pull/2030)
@ -75,7 +83,6 @@
- Differentiate jpg sequences from thumbnail [\#2056](https://github.com/pypeclub/OpenPype/pull/2056)
- FFmpeg: Split command to list does not work [\#2046](https://github.com/pypeclub/OpenPype/pull/2046)
- Removed shell flag in subprocess call [\#2045](https://github.com/pypeclub/OpenPype/pull/2045)
- Hiero: Fix "none" named tags [\#2033](https://github.com/pypeclub/OpenPype/pull/2033)
**Merged pull requests:**
@ -95,6 +102,7 @@
**🚀 Enhancements**
- Added possibility to configure of synchronization of workfile version… [\#2041](https://github.com/pypeclub/OpenPype/pull/2041)
- General: Task types in profiles [\#2036](https://github.com/pypeclub/OpenPype/pull/2036)
- Console interpreter: Handle invalid sizes on initialization [\#2022](https://github.com/pypeclub/OpenPype/pull/2022)
- Ftrack: Show OpenPype versions in event server status [\#2019](https://github.com/pypeclub/OpenPype/pull/2019)
@ -113,6 +121,7 @@
- Workfiles tool: Task selection [\#2040](https://github.com/pypeclub/OpenPype/pull/2040)
- Ftrack: Delete old versions missing settings key [\#2037](https://github.com/pypeclub/OpenPype/pull/2037)
- Nuke: typo on a button [\#2034](https://github.com/pypeclub/OpenPype/pull/2034)
- Hiero: Fix "none" named tags [\#2033](https://github.com/pypeclub/OpenPype/pull/2033)
- FFmpeg: Subprocess arguments as list [\#2032](https://github.com/pypeclub/OpenPype/pull/2032)
- General: Fix Python 2 breaking line [\#2016](https://github.com/pypeclub/OpenPype/pull/2016)
- Bugfix/webpublisher task type [\#2006](https://github.com/pypeclub/OpenPype/pull/2006)
@ -121,10 +130,6 @@
- nuke, resolve, hiero: precollector order lest then 0.5 [\#1984](https://github.com/pypeclub/OpenPype/pull/1984)
- Last workfile with multiple work templates [\#1981](https://github.com/pypeclub/OpenPype/pull/1981)
- Collectors order [\#1977](https://github.com/pypeclub/OpenPype/pull/1977)
- Stop timer was within validator order range. [\#1975](https://github.com/pypeclub/OpenPype/pull/1975)
- Ftrack: arrow submodule has https url source [\#1974](https://github.com/pypeclub/OpenPype/pull/1974)
- Ftrack: Fix hosts attribute in collect ftrack username [\#1972](https://github.com/pypeclub/OpenPype/pull/1972)
- Deadline: Houdini plugins in different hierarchy [\#1970](https://github.com/pypeclub/OpenPype/pull/1970)
## [3.3.1](https://github.com/pypeclub/OpenPype/tree/3.3.1) (2021-08-20)

View file

@ -288,7 +288,8 @@ def script_name():
def add_button_write_to_read(node):
name = "createReadNode"
label = "Create Read From Rendered"
value = "import write_to_read;write_to_read.write_to_read(nuke.thisNode())"
value = "import write_to_read;\
write_to_read.write_to_read(nuke.thisNode(), allow_relative=False)"
knob = nuke.PyScript_Knob(name, label, value)
knob.clearFlag(nuke.STARTLINE)
node.addKnob(knob)

View file

@ -9,7 +9,9 @@ SINGLE_FILE_FORMATS = ['avi', 'mp4', 'mxf', 'mov', 'mpg', 'mpeg', 'wmv', 'm4v',
'm2v']
def evaluate_filepath_new(k_value, k_eval, project_dir, first_frame):
def evaluate_filepath_new(
k_value, k_eval, project_dir, first_frame, allow_relative):
# get combined relative path
combined_relative_path = None
if k_eval is not None and project_dir is not None:
@ -26,8 +28,9 @@ def evaluate_filepath_new(k_value, k_eval, project_dir, first_frame):
combined_relative_path = None
try:
k_value = k_value % first_frame
if os.path.exists(k_value):
# k_value = k_value % first_frame
if os.path.isdir(os.path.basename(k_value)):
# doesn't check for file, only parent dir
filepath = k_value
elif os.path.exists(k_eval):
filepath = k_eval
@ -37,10 +40,12 @@ def evaluate_filepath_new(k_value, k_eval, project_dir, first_frame):
filepath = os.path.abspath(filepath)
except Exception as E:
log.error("Cannot create Read node. Perhaps it needs to be rendered first :) Error: `{}`".format(E))
log.error("Cannot create Read node. Perhaps it needs to be \
rendered first :) Error: `{}`".format(E))
return None
filepath = filepath.replace('\\', '/')
# assumes last number is a sequence counter
current_frame = re.findall(r'\d+', filepath)[-1]
padding = len(current_frame)
basename = filepath[: filepath.rfind(current_frame)]
@ -51,11 +56,13 @@ def evaluate_filepath_new(k_value, k_eval, project_dir, first_frame):
pass
else:
# Image sequence needs hashes
# to do still with no number not handled
filepath = basename + '#' * padding + '.' + filetype
# relative path? make it relative again
if not isinstance(project_dir, type(None)):
filepath = filepath.replace(project_dir, '.')
if allow_relative:
if (not isinstance(project_dir, type(None))) and project_dir != "":
filepath = filepath.replace(project_dir, '.')
# get first and last frame from disk
frames = []
@ -95,41 +102,40 @@ def create_read_node(ndata, comp_start):
return
def write_to_read(gn):
def write_to_read(gn,
allow_relative=False):
comp_start = nuke.Root().knob('first_frame').value()
comp_end = nuke.Root().knob('last_frame').value()
project_dir = nuke.Root().knob('project_directory').getValue()
if not os.path.exists(project_dir):
project_dir = nuke.Root().knob('project_directory').evaluate()
group_read_nodes = []
with gn:
height = gn.screenHeight() # get group height and position
new_xpos = int(gn.knob('xpos').value())
new_ypos = int(gn.knob('ypos').value()) + height + 20
group_writes = [n for n in nuke.allNodes() if n.Class() == "Write"]
print("__ group_writes: {}".format(group_writes))
if group_writes != []:
# there can be only 1 write node, taking first
n = group_writes[0]
if n.knob('file') is not None:
file_path_new = evaluate_filepath_new(
myfile, firstFrame, lastFrame = evaluate_filepath_new(
n.knob('file').getValue(),
n.knob('file').evaluate(),
project_dir,
comp_start
comp_start,
allow_relative
)
if not file_path_new:
if not myfile:
return
myfiletranslated, firstFrame, lastFrame = file_path_new
# get node data
ndata = {
'filepath': myfiletranslated,
'firstframe': firstFrame,
'lastframe': lastFrame,
'filepath': myfile,
'firstframe': int(firstFrame),
'lastframe': int(lastFrame),
'new_xpos': new_xpos,
'new_ypos': new_ypos,
'colorspace': n.knob('colorspace').getValue(),
@ -139,7 +145,6 @@ def write_to_read(gn):
}
group_read_nodes.append(ndata)
# create reads in one go
for oneread in group_read_nodes:
# create read node

View file

@ -1,7 +1,6 @@
import os
import json
import collections
import openpype
from openpype.modules import OpenPypeModule
from openpype_interfaces import (
@ -397,3 +396,16 @@ class FtrackModule(
def timer_stopped(self):
if self._timers_manager_module is not None:
self._timers_manager_module.timer_stopped(self.id)
def get_task_time(self, project_name, asset_name, task_name):
session = self.create_ftrack_session()
query = (
'Task where name is "{}"'
' and parent.name is "{}"'
' and project.full_name is "{}"'
).format(task_name, asset_name, project_name)
task_entity = session.query(query).first()
if not task_entity:
return 0
hours_logged = (task_entity["time_logged"] / 60) / 60
return hours_logged

View file

@ -1,3 +1,5 @@
import json
from aiohttp.web_response import Response
from openpype.api import Logger
@ -28,6 +30,11 @@ class TimersManagerModuleRestApi:
self.prefix + "/stop_timer",
self.stop_timer
)
self.server_manager.add_route(
"GET",
self.prefix + "/get_task_time",
self.get_task_time
)
async def start_timer(self, request):
data = await request.json()
@ -48,3 +55,20 @@ class TimersManagerModuleRestApi:
async def stop_timer(self, request):
self.module.stop_timers()
return Response(status=200)
async def get_task_time(self, request):
data = await request.json()
try:
project_name = data['project_name']
asset_name = data['asset_name']
task_name = data['task_name']
except KeyError:
message = (
"Payload must contain fields 'project_name, 'asset_name',"
" 'task_name'"
)
log.warning(message)
return Response(text=message, status=404)
time = self.module.get_task_time(project_name, asset_name, task_name)
return Response(text=json.dumps(time))

View file

@ -191,6 +191,16 @@ class TimersManager(OpenPypeModule, ITrayService):
}
self.timer_started(None, data)
def get_task_time(self, project_name, asset_name, task_name):
times = {}
for module_id, connector in self._connectors_by_module_id.items():
if hasattr(connector, "get_task_time"):
module = self._modules_by_id[module_id]
times[module.name] = connector.get_task_time(
project_name, asset_name, task_name
)
return times
def timer_started(self, source_id, data):
for module_id, connector in self._connectors_by_module_id.items():
if module_id == source_id:

View file

@ -68,6 +68,12 @@ class CollectResourcesPath(pyblish.api.InstancePlugin):
"representation": "TEMP"
})
# For the first time publish
if instance.data.get("hierarchy"):
template_data.update({
"hierarchy": instance.data["hierarchy"]
})
anatomy_filled = anatomy.format(template_data)
if "folder" in anatomy.templates["publish"]:

View file

@ -44,6 +44,7 @@
"type": "dict",
"key": "disk_mapping",
"label": "Disk mapping",
"is_group": true,
"use_label_wrap": false,
"collapsible": false,
"children": [

View file

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring Pype version."""
__version__ = "3.5.0-nightly.4"
__version__ = "3.5.0-nightly.5"

View file

@ -287,9 +287,8 @@ def run_disk_mapping_commands(mongo_url):
if not disk_mapping:
return
for mapping in disk_mapping.get(low_platform):
source, destination = mapping
mappings = disk_mapping.get(low_platform) or []
for source, destination in mappings:
args = ["subst", destination.rstrip('/'), source.rstrip('/')]
_print("disk mapping args:: {}".format(args))
try: