Skip to content

Commit

Permalink
Merge branch 'develop' into feature/OP-2053_Add-validator-to-check-co…
Browse files Browse the repository at this point in the history
…rrect-version-of-extension-for-PS-and-AE
  • Loading branch information
kalisp authored Dec 14, 2021
2 parents 621118c + 3b9db7d commit 61bf279
Show file tree
Hide file tree
Showing 180 changed files with 646 additions and 176 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [3.7.0-nightly.6](https://github.com/pypeclub/OpenPype/tree/HEAD)
## [3.7.0-nightly.7](https://github.com/pypeclub/OpenPype/tree/HEAD)

[Full Changelog](https://github.com/pypeclub/OpenPype/compare/3.6.4...HEAD)

Expand Down Expand Up @@ -30,6 +30,7 @@
- General: Reduce vendor imports [\#2305](https://github.com/pypeclub/OpenPype/pull/2305)
- Tools: Cleanup of unused classes [\#2304](https://github.com/pypeclub/OpenPype/pull/2304)
- Project Manager: Added ability to delete project [\#2298](https://github.com/pypeclub/OpenPype/pull/2298)
- Ftrack: Synchronize input links [\#2287](https://github.com/pypeclub/OpenPype/pull/2287)
- Nuke: extract baked review videos presets [\#2248](https://github.com/pypeclub/OpenPype/pull/2248)

**🐛 Bug fixes**
Expand Down Expand Up @@ -93,7 +94,6 @@
- Tools: Assets widget [\#2265](https://github.com/pypeclub/OpenPype/pull/2265)
- SceneInventory: Choose loader in asset switcher [\#2262](https://github.com/pypeclub/OpenPype/pull/2262)
- Style: New fonts in OpenPype style [\#2256](https://github.com/pypeclub/OpenPype/pull/2256)
- Tools: SceneInventory in OpenPype [\#2255](https://github.com/pypeclub/OpenPype/pull/2255)
- Tools: Tasks widget [\#2251](https://github.com/pypeclub/OpenPype/pull/2251)
- Tools: Creator in OpenPype [\#2244](https://github.com/pypeclub/OpenPype/pull/2244)

Expand Down Expand Up @@ -121,8 +121,8 @@

**🚀 Enhancements**

- Tools: SceneInventory in OpenPype [\#2255](https://github.com/pypeclub/OpenPype/pull/2255)
- Tools: Subset manager in OpenPype [\#2243](https://github.com/pypeclub/OpenPype/pull/2243)
- General: Skip module directories without init file [\#2239](https://github.com/pypeclub/OpenPype/pull/2239)

**🐛 Bug fixes**

Expand Down
17 changes: 15 additions & 2 deletions openpype/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,22 @@ def run(script):
"--pyargs",
help="Run tests from package",
default=None)
def runtests(folder, mark, pyargs):
@click.option("-t",
"--test_data_folder",
help="Unzipped directory path of test file",
default=None)
@click.option("-s",
"--persist",
help="Persist test DB and published files after test end",
default=None)
@click.option("-a",
"--app_variant",
help="Provide specific app variant for test, empty for latest",
default=None)
def runtests(folder, mark, pyargs, test_data_folder, persist, app_variant):
"""Run all automatic tests after proper initialization via start.py"""
PypeCommands().run_tests(folder, mark, pyargs)
PypeCommands().run_tests(folder, mark, pyargs, test_data_folder,
persist, app_variant)


@main.command()
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions openpype/hosts/flame/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def _sync_utility_scripts(env=None):

fsd_paths = [os.path.join(
HOST_DIR,
"api",
"utility_scripts"
)]

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/flame/hooks/pre_flame_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FlamePrelaunch(PreLaunchHook):
flame_python_exe = "/opt/Autodesk/python/2021/bin/python2.7"

wtc_script_path = os.path.join(
opflame.HOST_DIR, "scripts", "wiretap_com.py")
opflame.HOST_DIR, "api", "scripts", "wiretap_com.py")

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
13 changes: 7 additions & 6 deletions openpype/hosts/nuke/plugins/publish/extract_render_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ def process(self, instance):
self.log.info("Start frame: {}".format(first_frame))
self.log.info("End frame: {}".format(last_frame))

# write node url might contain nuke's ctl expressin
# as [python ...]/path...
path = node["file"].evaluate()

# Ensure output directory exists.
directory = os.path.dirname(node["file"].value())
if not os.path.exists(directory):
os.makedirs(directory)
out_dir = os.path.dirname(path)
if not os.path.exists(out_dir):
os.makedirs(out_dir)

# Render frames
nuke.execute(
Expand All @@ -58,15 +62,12 @@ def process(self, instance):
if "slate" in families:
first_frame += 1

path = node['file'].value()
out_dir = os.path.dirname(path)
ext = node["file_type"].value()

if "representations" not in instance.data:
instance.data["representations"] = []

collected_frames = os.listdir(out_dir)

if len(collected_frames) == 1:
repre = {
'name': ext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def process(self, instance):

if not repre.get("files"):
msg = ("no frames were collected, "
"you need to render them")
"you need to render them.\n"
"Check properties of write node (group) and"
"select 'Local' option in 'Publish' dropdown.")
self.log.error(msg)
raise ValidationException(msg)

Expand Down
2 changes: 2 additions & 0 deletions openpype/lib/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ def __init__(self, application, executable, **data):
# subprocess.Popen launch arguments (first argument in constructor)
self.launch_args = executable.as_args()
self.launch_args.extend(application.arguments)
if self.data.get("app_args"):
self.launch_args.extend(self.data.pop("app_args"))

# Handle launch environemtns
env = self.data.pop("env", None)
Expand Down
10 changes: 8 additions & 2 deletions openpype/lib/avalon_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,18 @@ def get_workdir_data(project_doc, asset_doc, task_name, host_name):
Returns:
dict: Data prepared for filling workdir template.
"""
hierarchy = "/".join(asset_doc["data"]["parents"])

task_type = asset_doc['data']['tasks'].get(task_name, {}).get('type')

project_task_types = project_doc["config"]["tasks"]
task_code = project_task_types.get(task_type, {}).get("short_name")

asset_parents = asset_doc["data"]["parents"]
hierarchy = "/".join(asset_parents)

parent_name = project_doc["name"]
if asset_parents:
parent_name = asset_parents[-1]

data = {
"project": {
"name": project_doc["name"],
Expand All @@ -526,6 +531,7 @@ def get_workdir_data(project_doc, asset_doc, task_name, host_name):
"short": task_code,
},
"asset": asset_doc["name"],
"parent": parent_name,
"app": host_name,
"user": getpass.getuser(),
"hierarchy": hierarchy,
Expand Down
1 change: 0 additions & 1 deletion openpype/lib/path_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def _get_local_sync_dirmap(self, project_settings):
mapping = {}

if not project_settings["global"]["sync_server"]["enabled"]:
log.debug("Site Sync not enabled")
return mapping

from openpype.settings.lib import get_site_local_overrides
Expand Down
5 changes: 4 additions & 1 deletion openpype/lib/remote_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from datetime import datetime
import sys
from bson.objectid import ObjectId
import collections

import pyblish.util
import pyblish.api
Expand Down Expand Up @@ -186,7 +187,9 @@ def find_variant_key(application_manager, host):

found_variant_key = None
# finds most up-to-date variant if any installed
for variant_key, variant in app_group.variants.items():
sorted_variants = collections.OrderedDict(
sorted(app_group.variants.items()))
for variant_key, variant in sorted_variants.items():
for executable in variant.executables:
if executable.exists():
found_variant_key = variant_key
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 20 additions & 10 deletions openpype/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@
from openpype.lib import PypeLogger


DEFAULT_OPENPYPE_MODULES = (
"avalon_apps",
"clockify",
"log_viewer",
"muster",
"python_console_interpreter",
"slack",
"webserver",
"launcher_action",
"project_manager_action",
"settings_action",
"standalonepublish_action",
)


# Inherit from `object` for Python 2 hosts
class _ModuleClass(object):
"""Fake module class for storing OpenPype modules.
Expand Down Expand Up @@ -272,17 +287,12 @@ def _load_modules():
log = PypeLogger.get_logger("ModulesLoader")

# Import default modules imported from 'openpype.modules'
for default_module_name in (
"settings_action",
"launcher_action",
"project_manager_action",
"standalonepublish_action",
):
for default_module_name in DEFAULT_OPENPYPE_MODULES:
try:
default_module = __import__(
"openpype.modules.{}".format(default_module_name),
fromlist=("", )
)
import_str = "openpype.modules.{}".format(default_module_name)
new_import_str = "{}.{}".format(modules_key, default_module_name)
default_module = __import__(import_str, fromlist=("", ))
sys.modules[new_import_str] = default_module
setattr(openpype_modules, default_module_name, default_module)

except Exception:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 9 additions & 6 deletions openpype/plugins/publish/collect_anatomy_context_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,27 @@ def process(self, context):
project_entity = context.data["projectEntity"]
asset_entity = context.data["assetEntity"]

hierarchy_items = asset_entity["data"]["parents"]
hierarchy = ""
if hierarchy_items:
hierarchy = os.path.join(*hierarchy_items)

asset_tasks = asset_entity["data"]["tasks"]
task_type = asset_tasks.get(task_name, {}).get("type")

project_task_types = project_entity["config"]["tasks"]
task_code = project_task_types.get(task_type, {}).get("short_name")

asset_parents = asset_entity["data"]["parents"]
hierarchy = "/".join(asset_parents)

parent_name = project_entity["name"]
if asset_parents:
parent_name = asset_parents[-1]

context_data = {
"project": {
"name": project_entity["name"],
"code": project_entity["data"].get("code")
},
"asset": asset_entity["name"],
"hierarchy": hierarchy.replace("\\", "/"),
"parent": parent_name,
"hierarchy": hierarchy,
"task": {
"name": task_name,
"type": task_type,
Expand Down
4 changes: 4 additions & 0 deletions openpype/plugins/publish/collect_anatomy_instance_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ def fill_anatomy_data(self, context):
asset_doc = instance.data.get("assetEntity")
if asset_doc and asset_doc["_id"] != context_asset_doc["_id"]:
parents = asset_doc["data"].get("parents") or list()
parent_name = project_doc["name"]
if parents:
parent_name = parents[-1]
anatomy_updates["hierarchy"] = "/".join(parents)
anatomy_updates["parent"] = parent_name

# Task
task_name = instance.data.get("task")
Expand Down
34 changes: 25 additions & 9 deletions openpype/pype_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def remotepublishfromapp(project, batch_dir, host_name,
task_name,
app_name
)
print("env:: {}".format(env))
os.environ.update(env)

os.environ["OPENPYPE_PUBLISH_DATA"] = batch_dir
Expand Down Expand Up @@ -340,33 +341,48 @@ def run_application(self, app, project, asset, task, tools, arguments):
def validate_jsons(self):
pass

def run_tests(self, folder, mark, pyargs):
def run_tests(self, folder, mark, pyargs,
test_data_folder, persist, app_variant):
"""
Runs tests from 'folder'
Args:
folder (str): relative path to folder with tests
mark (str): label to run tests marked by it (slow etc)
pyargs (str): package path to test
test_data_folder (str): url to unzipped folder of test data
persist (bool): True if keep test db and published after test
end
app_variant (str): variant (eg 2020 for AE), empty if use
latest installed version
"""
print("run_tests")
import subprocess

if folder:
folder = " ".join(list(folder))
else:
folder = "../tests"

mark_str = pyargs_str = ''
# disable warnings and show captured stdout even if success
args = ["--disable-pytest-warnings", "-rP", folder]

if mark:
mark_str = "-m {}".format(mark)
args.extend(["-m", mark])

if pyargs:
pyargs_str = "--pyargs {}".format(pyargs)
args.extend(["--pyargs", pyargs])

if persist:
args.extend(["--test_data_folder", test_data_folder])

if persist:
args.extend(["--persist", persist])

if app_variant:
args.extend(["--app_variant", app_variant])

cmd = "pytest {} {} {}".format(folder, mark_str, pyargs_str)
print("Running {}".format(cmd))
subprocess.run(cmd)
print("run_tests args: {}".format(args))
import pytest
pytest.main(args)

def syncserver(self, active_site):
"""Start running sync_server in background."""
Expand Down
4 changes: 2 additions & 2 deletions openpype/settings/defaults/system_settings/applications.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"icon": "{}/app_icons/nuke.png",
"host_name": "nuke",
"environment": {
"NUKE_PATH": "{OPENPYPE_STUDIO_PLUGINS}/nuke"
"NUKE_PATH": ["{NUKE_PATH}", "{OPENPYPE_STUDIO_PLUGINS}/nuke"]
},
"variants": {
"13-0": {
Expand Down Expand Up @@ -248,7 +248,7 @@
"icon": "{}/app_icons/nuke.png",
"host_name": "nuke",
"environment": {
"NUKE_PATH": "{OPENPYPE_STUDIO_PLUGINS}/nuke"
"NUKE_PATH": ["{NUKE_PATH}", "{OPENPYPE_STUDIO_PLUGINS}/nuke"]
},
"variants": {
"13-0": {
Expand Down
Loading

0 comments on commit 61bf279

Please sign in to comment.