Skip to content

Commit

Permalink
[Automated] Merged develop into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ynbot committed Aug 9, 2023
2 parents 511b899 + 7debe12 commit 1162549
Show file tree
Hide file tree
Showing 55 changed files with 329 additions and 324 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ body:
label: Version
description: What version are you running? Look to OpenPype Tray
options:
- 3.16.3-nightly.4
- 3.16.3-nightly.3
- 3.16.3-nightly.2
- 3.16.3-nightly.1
Expand Down Expand Up @@ -134,7 +135,6 @@ body:
- 3.14.7-nightly.5
- 3.14.7-nightly.4
- 3.14.7-nightly.3
- 3.14.7-nightly.2
validations:
required: true
- type: dropdown
Expand Down
58 changes: 13 additions & 45 deletions openpype/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,47 +196,6 @@ def publish(paths, targets, gui):
PypeCommands.publish(list(paths), targets, gui)


@main.command()
@click.argument("path")
@click.option("-h", "--host", help="Host")
@click.option("-u", "--user", help="User email address")
@click.option("-p", "--project", help="Project")
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
def remotepublishfromapp(project, path, host, user=None, targets=None):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
"""

if AYON_SERVER_ENABLED:
raise RuntimeError(
"AYON does not support 'remotepublishfromapp' command."
)
PypeCommands.remotepublishfromapp(
project, path, host, user, targets=targets
)


@main.command()
@click.argument("path")
@click.option("-u", "--user", help="User email address")
@click.option("-p", "--project", help="Project")
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
def remotepublish(project, path, user=None, targets=None):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
"""

if AYON_SERVER_ENABLED:
raise RuntimeError("AYON does not support 'remotepublish' command.")
PypeCommands.remotepublish(project, path, user, targets=targets)


@main.command(context_settings={"ignore_unknown_options": True})
def projectmanager():
if AYON_SERVER_ENABLED:
Expand Down Expand Up @@ -338,12 +297,18 @@ def runtests(folder, mark, pyargs, test_data_folder, persist, app_variant,
persist, app_variant, timeout, setup_only)


@main.command()
@main.command(help="DEPRECATED - run sync server")
@click.pass_context
@click.option("-a", "--active_site", required=True,
help="Name of active stie")
def syncserver(active_site):
help="Name of active site")
def syncserver(ctx, active_site):
"""Run sync site server in background.
Deprecated:
This command is deprecated and will be removed in future versions.
Use '~/openpype_console module sync_server syncservice' instead.
Details:
Some Site Sync use cases need to expose site to another one.
For example if majority of artists work in studio, they are not using
SS at all, but if you want to expose published assets to 'studio' site
Expand All @@ -359,7 +324,10 @@ def syncserver(active_site):

if AYON_SERVER_ENABLED:
raise RuntimeError("AYON does not support 'syncserver' command.")
PypeCommands().syncserver(active_site)

from openpype.modules.sync_server.sync_server_module import (
syncservice)
ctx.invoke(syncservice, active_site=active_site)


@main.command()
Expand Down
4 changes: 0 additions & 4 deletions openpype/client/server/conversion_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def _get_default_template_name(templates):
def _template_replacements_to_v3(template):
return (
template
.replace("{folder[name]}", "{asset}")
.replace("{product[name]}", "{subset}")
.replace("{product[type]}", "{family}")
)
Expand Down Expand Up @@ -715,7 +714,6 @@ def convert_v4_representation_to_v3(representation):
if "template" in output_data:
output_data["template"] = (
output_data["template"]
.replace("{folder[name]}", "{asset}")
.replace("{product[name]}", "{subset}")
.replace("{product[type]}", "{family}")
)
Expand Down Expand Up @@ -977,7 +975,6 @@ def convert_create_representation_to_v4(representation, con):
representation_data = representation["data"]
representation_data["template"] = (
representation_data["template"]
.replace("{asset}", "{folder[name]}")
.replace("{subset}", "{product[name]}")
.replace("{family}", "{product[type]}")
)
Expand Down Expand Up @@ -1266,7 +1263,6 @@ def convert_update_representation_to_v4(
if "template" in attribs:
attribs["template"] = (
attribs["template"]
.replace("{asset}", "{folder[name]}")
.replace("{family}", "{product[type]}")
.replace("{subset}", "{product[name]}")
)
Expand Down
3 changes: 2 additions & 1 deletion openpype/hooks/pre_ocio_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def execute(self):
host_name=self.host_name,
project_settings=self.data["project_settings"],
anatomy_data=template_data,
anatomy=self.data["anatomy"]
anatomy=self.data["anatomy"],
env=self.launch_context.env,
)

if config_data:
Expand Down
35 changes: 23 additions & 12 deletions openpype/host/dirmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,26 @@ class HostDirmap(object):
"""

def __init__(
self, host_name, project_name, project_settings=None, sync_module=None
self,
host_name,
project_name,
project_settings=None,
sync_module=None
):
self.host_name = host_name
self.project_name = project_name
self._project_settings = project_settings
self._sync_module = sync_module # to limit reinit of Modules
self._sync_module = sync_module
# to limit reinit of Modules
self._sync_module_discovered = sync_module is not None
self._log = None

@property
def sync_module(self):
if self._sync_module is None:
if not self._sync_module_discovered:
self._sync_module_discovered = True
manager = ModulesManager()
self._sync_module = manager["sync_server"]
self._sync_module = manager.get("sync_server")
return self._sync_module

@property
Expand Down Expand Up @@ -151,21 +158,25 @@ def _get_local_sync_dirmap(self):
"""
project_name = self.project_name

sync_module = self.sync_module
mapping = {}
if (not self.sync_module.enabled or
project_name not in self.sync_module.get_enabled_projects()):
if (
sync_module is None
or not sync_module.enabled
or project_name not in sync_module.get_enabled_projects()
):
return mapping

active_site = self.sync_module.get_local_normalized_site(
self.sync_module.get_active_site(project_name))
remote_site = self.sync_module.get_local_normalized_site(
self.sync_module.get_remote_site(project_name))
active_site = sync_module.get_local_normalized_site(
sync_module.get_active_site(project_name))
remote_site = sync_module.get_local_normalized_site(
sync_module.get_remote_site(project_name))
self.log.debug(
"active {} - remote {}".format(active_site, remote_site)
)

if active_site == "local" and active_site != remote_site:
sync_settings = self.sync_module.get_sync_project_setting(
sync_settings = sync_module.get_sync_project_setting(
project_name,
exclude_locals=False,
cached=False)
Expand All @@ -179,7 +190,7 @@ def _get_local_sync_dirmap(self):
self.log.debug("remote overrides {}".format(remote_overrides))

current_platform = platform.system().lower()
remote_provider = self.sync_module.get_provider_for_site(
remote_provider = sync_module.get_provider_for_site(
project_name, remote_site
)
# dirmap has sense only with regular disk provider, in the workfile
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/aftereffects/plugins/publish/closeAE.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CloseAE(pyblish.api.ContextPlugin):
active = True

hosts = ["aftereffects"]
targets = ["remotepublish"]
targets = ["automated"]

def process(self, context):
self.log.info("CloseAE")
Expand Down
1 change: 0 additions & 1 deletion openpype/hosts/houdini/plugins/create/create_arnold_ass.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class CreateArnoldAss(plugin.HoudiniCreator):
label = "Arnold ASS"
family = "ass"
icon = "magic"
defaults = ["Main"]

# Default extension: `.ass` or `.ass.gz`
# however calling HoudiniCreator.create()
Expand Down
1 change: 0 additions & 1 deletion openpype/hosts/houdini/plugins/create/create_arnold_rop.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class CreateArnoldRop(plugin.HoudiniCreator):
label = "Arnold ROP"
family = "arnold_rop"
icon = "magic"
defaults = ["master"]

# Default extension
ext = "exr"
Expand Down
1 change: 0 additions & 1 deletion openpype/hosts/houdini/plugins/create/create_karma_rop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class CreateKarmaROP(plugin.HoudiniCreator):
label = "Karma ROP"
family = "karma_rop"
icon = "magic"
defaults = ["master"]

def create(self, subset_name, instance_data, pre_create_data):
import hou # noqa
Expand Down
1 change: 0 additions & 1 deletion openpype/hosts/houdini/plugins/create/create_mantra_rop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class CreateMantraROP(plugin.HoudiniCreator):
label = "Mantra ROP"
family = "mantra_rop"
icon = "magic"
defaults = ["master"]

def create(self, subset_name, instance_data, pre_create_data):
import hou # noqa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class CreateRedshiftROP(plugin.HoudiniCreator):
label = "Redshift ROP"
family = "redshift_rop"
icon = "magic"
defaults = ["master"]
ext = "exr"

def create(self, subset_name, instance_data, pre_create_data):
Expand Down
2 changes: 0 additions & 2 deletions openpype/hosts/houdini/plugins/create/create_vray_rop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class CreateVrayROP(plugin.HoudiniCreator):
label = "VRay ROP"
family = "vray_rop"
icon = "magic"
defaults = ["master"]

ext = "exr"

def create(self, subset_name, instance_data, pre_create_data):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
def process(self, instance):
invalid = self.get_invalid(instance)
if invalid:
nodes = [n.path() for n in invalid]
raise PublishValidationError(
"See log for details. " "Invalid nodes: {0}".format(invalid),
"See log for details. " "Invalid nodes: {0}".format(nodes),
title=self.label
)

Expand Down
18 changes: 14 additions & 4 deletions openpype/hosts/max/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
temp_arr = #()
for x in all_handles do
(
if x.node == undefined do continue
handle_name = node_to_name x.node
append temp_arr handle_name
)
Expand Down Expand Up @@ -185,7 +186,10 @@ def create_instance_node(node):
node = rt.Container(name=node)

attrs = rt.Execute(MS_CUSTOM_ATTRIB)
rt.custAttributes.add(node.baseObject, attrs)
modifier = rt.EmptyModifier()
rt.addModifier(node, modifier)
node.modifiers[0].name = "OP Data"
rt.custAttributes.add(node.modifiers[0], attrs)

return node

Expand All @@ -209,13 +213,19 @@ def create(self, subset_name, instance_data, pre_create_data):
if pre_create_data.get("use_selection"):

node_list = []
sel_list = []
for i in self.selected_nodes:
node_ref = rt.NodeTransformMonitor(node=i)
node_list.append(node_ref)
sel_list.append(str(i))

# Setting the property
rt.setProperty(
instance_node.openPypeData, "all_handles", node_list)
instance_node.modifiers[0].openPypeData,
"all_handles", node_list)
rt.setProperty(
instance_node.modifiers[0].openPypeData,
"sel_list", sel_list)

self._add_instance_to_context(instance)
imprint(instance_node.name, instance.data_to_store())
Expand Down Expand Up @@ -254,8 +264,8 @@ def remove_instances(self, instances):
instance_node = rt.GetNodeByName(
instance.data.get("instance_node"))
if instance_node:
count = rt.custAttributes.count(instance_node)
rt.custAttributes.delete(instance_node, count)
count = rt.custAttributes.count(instance_node.modifiers[0])
rt.custAttributes.delete(instance_node.modifiers[0], count)
rt.Delete(instance_node)

self._remove_instance_from_context(instance)
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/max/plugins/publish/collect_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def process(self, instance):
container = rt.GetNodeByName(instance.data["instance_node"])
instance.data["members"] = [
member.node for member
in container.openPypeData.all_handles
in container.modifiers[0].openPypeData.all_handles
]
self.log.debug("{}".format(instance.data["members"]))
7 changes: 5 additions & 2 deletions openpype/hosts/maya/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,15 @@ def load(
raise LoadError("No namespace specified in "
"Maya ReferenceLoader settings")
elif not custom_naming['group_name']:
raise LoadError("No group name specified in "
"Maya ReferenceLoader settings")
self.log.debug("No custom group_name, no group will be created.")
options["attach_to_root"] = False

formatting_data = {
"asset_name": asset['name'],
"asset_type": asset['type'],
"folder": {
"name": asset["name"],
},
"subset": subset['name'],
"family": (
subset['data'].get('family') or
Expand Down
Loading

0 comments on commit 1162549

Please sign in to comment.